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. šŸš€