Skip to main content

n8n Automation Workflows

Complete Setup Guide for Python Asset Management

Overview

These n8n workflows keep your Airtable, GitHub, and notifications in sync. No manual updates needed.

Workflow 1: GitHub → Airtable Sync (Hourly)

Purpose: Update tool metadata automatically (stars, forks, last commit, etc.) Trigger: Cron job (every hour)

Step-by-Step Setup

  1. Create Workflow in n8n
    • Dashboard → Click “Create new workflow”
    • Name: “GitHub → Airtable Sync”
  2. Add Trigger Node
    • Click ”+” to add node
    • Search: “Cron”
    • Set: “Every hour” (or your preference)
  3. Add GitHub Integration Node
    • Click ”+” → Search “GitHub”
    • Connect to your GitHub account
    • Set operation: “Get Repository”
    • For each tool in your org:
      • Input: Repository = “async-retry” (example)
      • Extract: stars, forks, watchers, last commit date, open issues
  4. Add Airtable Update Node
    • Click ”+” → Search “Airtable”
    • Connect to your Airtable workspace
    • Set operation: “Update Record”
    • Map fields:
      GitHub URL → GitHub URL field
      Stars → GitHub Stars field
      Last Commit → Last Updated field
      Forks → Forks field
      Open Issues → Open Issues field
      
  5. Add Slack Notification (Optional)
    • Click ”+” → Search “Slack”
    • Send message: ”✅ Updated X tools in Airtable”
  6. Save & Activate
    • Click Save
    • Click “Activate” toggle

Workflow JSON Template

{
  "name": "GitHub → Airtable Sync",
  "nodes": [
    {
      "name": "Cron Trigger",
      "type": "n8n-nodes-base.cron",
      "parameters": {
        "rule": {
          "interval": [1, "hours"]
        }
      }
    },
    {
      "name": "Loop Through Tools",
      "type": "n8n-nodes-base.function",
      "parameters": {
        "functionCode": "// Get all tools from Airtable first\nreturn [\n  {name: 'async-retry', repo: 'async-retry'},\n  {name: 'concur', repo: 'concur'},\n  // ... add all 50+ tools\n];"
      }
    },
    {
      "name": "Get GitHub Data",
      "type": "n8n-nodes-github-oauth.github",
      "parameters": {
        "resource": "repository",
        "operation": "get",
        "owner": "yourname-tools",
        "repository": "{{ $node['Loop Through Tools'].json.body[0].repo }}"
      }
    },
    {
      "name": "Update Airtable",
      "type": "n8n-nodes-base.airtable",
      "parameters": {
        "resource": "record",
        "operation": "update",
        "base": "appXXXXXXXXXXXXXX", // Your Airtable base ID
        "table": "Tool Inventory",
        "id": "{{ $node['Get GitHub Data'].json.body.id }}",
        "fieldsToUpdate": {
          "Stars": "{{ $node['Get GitHub Data'].json.body.stargazers_count }}",
          "Last Updated": "{{ $now.toISOString() }}"
        }
      }
    }
  ]
}

Workflow 2: New Release → PyPI + Slack

Purpose: When you create a GitHub release, notify the world Trigger: GitHub Webhook (release created)

Step-by-Step Setup

  1. Create Workflow
    • Name: “Release → Notification”
  2. Add Webhook Trigger
    • Click ”+” → Search “GitHub”
    • Click “GitHub” → Connect account
    • Select “Trigger” type
    • Choose: “Webhook”
    • Event: “Release”
  3. Extract Release Data
    • Add node: “Function”
    • Extract tag version, repo name, release notes
    • Code:
    return {
      version: $node['GitHub Webhook'].json.body.release.tag_name,
      repo: $node['GitHub Webhook'].json.body.repository.name,
      notes: $node['GitHub Webhook'].json.body.release.body
    };
    
  4. Update Airtable
    • Add “Airtable” node
    • Operation: “Update Record”
    • Find tool by GitHub URL
    • Update:
      • “Last Updated” → Today
      • “Status” → “Production”
      • “Version” → Release tag
  5. Post to Slack
    • Add “Slack” node
    • Post to #announcements
    • Message template:
     🚀 Released `{{$node['Extract Data'].json.body.repo}}` v`{{$node['Extract Data'].json.body.version}}`
     
     `{{$node['Extract Data'].json.body.notes}}`
     
     Install: pip install `{{$node['Extract Data'].json.body.repo}}`
     Docs: https://docs.yourname.dev/`{{$node['Extract Data'].json.body.repo}}`
     GitHub: `{{$node['GitHub Webhook'].json.body.repository.html_url}}`
    
  6. Post to Twitter (Optional)
    • Add “Twitter” node
    • Same message (shortened for 280 chars)
  7. Save & Activate

Workflow 3: Weekly Stats Report

Purpose: Every Monday morning, get a summary of your portfolio Trigger: Cron (every Monday at 9am)

Step-by-Step Setup

  1. Create Workflow
    • Name: “Weekly Summary Report”
  2. Add Cron Trigger
    • Set: “Every Monday at 09:00”
  3. Query Airtable
    • Add “Airtable” node
    • Operation: “Search Records”
    • Filters:
      • Status contains “Production”
      • Status contains “Beta”
      • Status contains “Concept”
    • Extract all records
  4. Calculate Stats
    • Add “Function” node
    • Calculate:
      const tools = $node['Get Tools'].json.body;
      
      const stats = {
        total: tools.length,
        production: tools.filter(t => t.fields.Status === 'Production').length,
        beta: tools.filter(t => t.fields.Status === 'Beta').length,
        concept: tools.filter(t => t.fields.Status === 'Concept').length,
        avgStars: (tools.reduce((sum, t) => sum + (t.fields['GitHub Stars'] || 0), 0) / tools.length).toFixed(1),
        docsCoverage: (tools.filter(t => t.fields['Docs %'] >= 80).length / tools.length * 100).toFixed(0)
      };
      
      return stats;
      
  5. Post to Slack
    • Message template:
     📊 Weekly Python Assets Report
     
     Total Tools: `{{$node['Calculate Stats'].json.body.total}}`
     • Production: `{{$node['Calculate Stats'].json.body.production}}`
     • Beta: `{{$node['Calculate Stats'].json.body.beta}}`
     • Concept: `{{$node['Calculate Stats'].json.body.concept}}`
     
     Average Stars: `{{$node['Calculate Stats'].json.body.avgStars}}`
     Docs Coverage: `{{$node['Calculate Stats'].json.body.docsCoverage}}`%
    
    🎯 Next steps: Review 3 tools needing doc updates
    
  6. Send Email (Optional)
    • Add “Send Email” node
    • Same message, formatted as email
    • Send to: your email

Workflow 4: Tool Milestone Alerts

Purpose: Alert you when a tool hits a milestone (100 stars, 1000 downloads, etc.) Trigger: Manual or Cron (daily)

Step-by-Step Setup

  1. Create Workflow
    • Name: “Milestone Alerts”
  2. Add Cron Trigger
    • Set: “Every day at 08:00”
  3. Get Tool Data from Airtable
    • Add “Airtable” node
    • Operation: “Get All Records”
    • Get all tools with stars
  4. Check for Milestones
    • Add “Function” node
    • Check if any tool crossed a threshold:
    const tools = $node['Get Tools'].json.body;
    const milestones = [];
    
    tools.forEach(tool => {
      const stars = tool.fields['GitHub Stars'] || 0;
      const downloads = tool.fields['PyPI Downloads'] || 0;
      
      // Check milestones
      if (stars === 100 || stars === 500 || stars === 1000) {
        milestones.push({
          name: tool.fields['Tool Name'],
          type: 'stars',
          value: stars
        });
      }
      if (downloads === 1000 || downloads === 10000) {
        milestones.push({
          name: tool.fields['Tool Name'],
          type: 'downloads',
          value: downloads
        });
      }
    });
    
    return milestones;
    
  5. Post to Slack (if milestones found)
    • Add “Slack” node with condition:
    • Only run if milestones.length > 0
    • Message:
     🌟 Milestone Alert!
     
     `{{$node['Check Milestones'].json.body.map(m => 
       `${m.name} reached ${m.value} ${m.type}!`
     ).join('\n')}}`
    
    💡 Idea: Write a blog post celebrating this! 🎉
    

Workflow 5: Auto-Sync New Tool to GitHub

Purpose: When you add a tool to Airtable, auto-create a GitHub repo Trigger: Airtable webhook (record created)

Step-by-Step Setup

  1. Create Workflow
    • Name: “New Tool → GitHub Repo”
  2. Add Airtable Webhook
    • In Airtable: Automations → Webhooks
    • Event: “Record created in Tool Inventory”
    • Webhook URL: Copy from n8n
  3. Create GitHub Repository
    • Add “GitHub” node
    • Operation: “Create Repository”
    • Input:
       name: `{{$node['Airtable Webhook'].json.body.fields['Tool Name']}}`
       description: `{{$node['Airtable Webhook'].json.body.fields['Purpose']}}`
      org: yourname-tools
      private: false
      
  4. Add Repository Template Files
    • Add “GitHub” node (for each file)
    • Operation: “Create File”
    • Files to create:
      • README.md (with tool name + purpose)
      • pyproject.toml (template)
      • .github/workflows/publish.yml
      • src/module_name/init.py
      • tests/test_basic.py
      • docs/index.md
  5. Update Airtable with Repo URL
    • Add “Airtable” node
    • Operation: “Update Record”
    • Update: “GitHub URL” field with new repo URL
  6. Post Slack Confirmation
    • Message: ”✅ Created repo for {{$node['Airtable Webhook'].json.body.fields['Tool Name']}}

Workflow 6: PyPI Download Tracker

Purpose: Track PyPI statistics for all published tools Trigger: Cron (daily)

Step-by-Step Setup

  1. Create Workflow
    • Name: “PyPI Stats Tracker”
  2. Add Cron Trigger
    • Set: “Every day at 10:00”
  3. Get Tools from Airtable
    • Add “Airtable” node
    • Operation: “Search Records”
    • Filter: Status = “Production”
  4. Query PyPI API
    • For each tool, call PyPI JSON API
    • Add “HTTP Request” node
    • URL: https://pypi.org/pypi/{{tool_name}}/json
    • Extract: stats.last_month downloads
  5. Update Airtable
    • Add “Airtable” node
    • Update “PyPI Downloads” field
    • Update “Last Stats Check” date
  6. Post Growth Report (Optional)
    • Compare to last week
    • Post top gainers to Slack

How to Use These Workflows

Step 1: Set Up n8n

# Use n8n Cloud (easiest)
# Go to n8n.cloud and sign up
# OR self-host:
docker run -it --rm --name n8n -p 5678:5678 \
  -e N8N_USER_EMAIL=you@example.com \
  -e N8N_USER_PASSWORD=password \
  n8nio/n8n

Step 2: Connect Accounts

In n8n Settings:
  • GitHub: Create OAuth app, connect
  • Airtable: Generate API token, add
  • Slack: Create app, add webhook
  • Twitter: Create API app, connect
  • Email: Add SMTP credentials

Step 3: Import Workflows

  • Copy JSON templates above
  • In n8n: File → Import → Paste JSON
  • Update variables (tool names, IDs, etc.)
  • Activate each workflow

Step 4: Test

  • Run each workflow manually first
  • Check Airtable + Slack for correct output
  • Then activate for scheduled runs

Variables & Configuration

Airtable Base ID

Found in: https://airtable.com/appXXXXXXXXXXXXXX
Copy: appXXXXXXXXXXXXXX

GitHub Organization

yourname-tools
(update in all workflows)

Slack Webhook URL

https://hooks.slack.com/services/YOUR/WEBHOOK/URL
(from Slack App settings)

PyPI Package Names

Must match exactly:
async-retry (not async_retry)
concur (not concur-lib)
etc.

Troubleshooting

Airtable not updating?

  • Check: API token is valid
  • Check: Base ID is correct
  • Check: Field names match exactly (case-sensitive)
  • Check: Record ID is correct

GitHub not syncing?

  • Check: OAuth credentials are valid
  • Check: Repo exists in your org
  • Check: API rate limits (60 req/hr for unauthenticated)

Slack notifications not posting?

  • Check: Webhook URL is valid
  • Check: Slack app has permissions
  • Check: Channel exists and bot is invited

Workflow running but no output?

  • Click workflow → “Executions” tab
  • Check error logs
  • Click “Debug” to trace execution

Performance Tips

  1. Rate Limiting: GitHub API has 60 req/hour for basic auth
    • Solution: Batch queries, use pagination
    • Or: Reduce frequency (sync every 3 hours instead of 1)
  2. Cost Optimization: Airtable is free up to 1,200 records
    • Solution: Archive old/deprecated tools
    • Solution: Use separate base for archival
  3. Execution Time: Long workflows can timeout
    • Solution: Split into smaller workflows
    • Solution: Use n8n’s “Trigger” node instead of Function calls

Next Steps

  1. Start with Workflow 1 (GitHub → Airtable sync)
    • This is the foundation
    • Once working, build others on top
  2. Add Workflow 2 (Release notifications)
    • Creates your announcement flow
    • Gets people excited
  3. Add Workflow 3 (Weekly report)
    • Keeps you informed
    • Shows progress
  4. Expand gradually as you have time

Pro Tips

Use n8n’s Built-in Nodes

  • For AWS integration: “AWS”
  • For Google Sheets: “Google Sheets”
  • For Discord: “Discord”
  • For Telegram: “Telegram”
  • For emails: “Email” or “Gmail”

Create Reusable Sub-Workflows

  • Use “Call Workflow” node
  • Example: Shared “GitHub → Airtable” sub-workflow
  • Call from multiple main workflows

Add Error Handling

  • Use “Try/Catch” node
  • Send alert to Slack on failure
  • Example: ”❌ Workflow ‘Release Notification’ failed”

Schedule Wisely

  • GitHub Sync: Every hour (stale data is fine)
  • Release Notification: Instant (time-sensitive)
  • Weekly Report: Monday 9am (regular cadence)
  • PyPI Stats: Daily (don’t need real-time)

Sample Slack Message Templates

Release Notification

🚀 New Release: async-retry v1.2.3

📝 What's New
- Added jitter support
- Fixed edge case in exponential backoff
- Performance improvements (15% faster)

📦 Install: pip install async-retry

📖 Docs: https://docs.yourname.dev/async-retry
💻 Code: https://github.com/yourname-tools/async-retry
🌟 Star: https://github.com/yourname-tools/async-retry

vs 1.2.2 +47 commits from 3 contributors

Weekly Summary

📊 This Week in Python Assets

✅ Deployments
- async-retry v1.2.3
- concur v2.0.1

📈 Growth
- Total stars: +23 (now 156 combined)
- PyPI downloads: 2,847 this week
- New GitHub followers: 12

📚 Content
- Blog: "Async Patterns in Production"
- Course: 47 new email subscribers

⚠️ Needs Attention
- 3 tools need doc updates (< 60% coverage)
- 2 repos have open issues (1mo+ old)

🎯 Next Week Focus
- Complete async-retry enterprise features
- Film video tutorial for concur
- Outreach to 5 potential consulting clients

Workflows ready? Let’s automate your way to 100+ stars. 🚀