$npx -y skills add czlonkowski/n8n-skills --skill n8n-workflow-patternsProven workflow architectural patterns from real n8n workflows. Use when building new workflows, designing workflow structure, choosing workflow patterns, planning workflow architecture, or asking about webhook processing, HTTP API integration, database operations, AI agent workf
| 1 | # n8n Workflow Patterns |
| 2 | |
| 3 | Proven architectural patterns for building n8n workflows. |
| 4 | |
| 5 | --- |
| 6 | |
| 7 | ## The 6 Core Patterns |
| 8 | |
| 9 | Based on analysis of real workflow usage: |
| 10 | |
| 11 | 1. **[Webhook Processing](webhook_processing.md)** (Most Common) |
| 12 | - Receive HTTP requests → Process → Output |
| 13 | - Pattern: Webhook → Validate → Transform → Respond/Notify |
| 14 | |
| 15 | 2. **[HTTP API Integration](http_api_integration.md)** |
| 16 | - Fetch from REST APIs → Transform → Store/Use |
| 17 | - Pattern: Trigger → HTTP Request → Transform → Action → Error Handler |
| 18 | |
| 19 | 3. **[Database Operations](database_operations.md)** |
| 20 | - Read/Write/Sync database data |
| 21 | - Pattern: Schedule → Query → Transform → Write → Verify |
| 22 | |
| 23 | 4. **[AI Agent Workflow](ai_agent_workflow.md)** |
| 24 | - AI agents with tools and memory |
| 25 | - Pattern: Trigger → AI Agent (Model + Tools + Memory) → Output |
| 26 | |
| 27 | 5. **[Scheduled Tasks](scheduled_tasks.md)** |
| 28 | - Recurring automation workflows |
| 29 | - Pattern: Schedule → Fetch → Process → Deliver → Log |
| 30 | |
| 31 | 6. **Batch Processing** (below) |
| 32 | - Process large datasets in chunks with API rate limits |
| 33 | - Pattern: Prepare → SplitInBatches → Process per batch → Accumulate → Aggregate |
| 34 | |
| 35 | --- |
| 36 | |
| 37 | ## Pattern Selection Guide |
| 38 | |
| 39 | ### When to use each pattern: |
| 40 | |
| 41 | **Webhook Processing** - Use when: |
| 42 | - Receiving data from external systems |
| 43 | - Building integrations (Slack commands, form submissions, GitHub webhooks) |
| 44 | - Need instant response to events |
| 45 | - Example: "Receive Stripe payment webhook → Update database → Send confirmation" |
| 46 | |
| 47 | **HTTP API Integration** - Use when: |
| 48 | - Fetching data from external APIs |
| 49 | - Synchronizing with third-party services |
| 50 | - Building data pipelines |
| 51 | - Example: "Fetch GitHub issues → Transform → Create Jira tickets" |
| 52 | |
| 53 | **Database Operations** - Use when: |
| 54 | - Syncing between databases |
| 55 | - Running database queries on schedule |
| 56 | - ETL workflows |
| 57 | - Example: "Read Postgres records → Transform → Write to MySQL" |
| 58 | |
| 59 | **AI Agent Workflow** - Use when: |
| 60 | - Building conversational AI |
| 61 | - Need AI with tool access |
| 62 | - Multi-step reasoning tasks |
| 63 | - Example: "Chat with AI that can search docs, query database, send emails" |
| 64 | |
| 65 | **Scheduled Tasks** - Use when: |
| 66 | - Recurring reports or summaries |
| 67 | - Periodic data fetching |
| 68 | - Maintenance tasks |
| 69 | - Example: "Daily: Fetch analytics → Generate report → Email team" |
| 70 | |
| 71 | **Batch Processing** - Use when: |
| 72 | - Processing large datasets that exceed API batch limits |
| 73 | - Need to accumulate results across multiple API calls |
| 74 | - Nested loops (e.g., multiple categories × paginated API calls per category) |
| 75 | - Example: "Fetch products for 4 markets × 1000 per API call → Aggregate all results" |
| 76 | |
| 77 | --- |
| 78 | |
| 79 | ## Common Workflow Components |
| 80 | |
| 81 | All patterns share these building blocks: |
| 82 | |
| 83 | ### 1. Triggers |
| 84 | - **Webhook** - HTTP endpoint (instant) |
| 85 | - **Schedule** - Cron-based timing (periodic) |
| 86 | - **Manual** - Click to execute (testing) |
| 87 | - **Polling** - Check for changes (intervals) |
| 88 | |
| 89 | ### 2. Data Sources |
| 90 | - **HTTP Request** - REST APIs |
| 91 | - **Database nodes** - Postgres, MySQL, MongoDB |
| 92 | - **Service nodes** - Slack, Google Sheets, etc. |
| 93 | - **Code** - Custom JavaScript/Python |
| 94 | |
| 95 | ### 3. Transformation |
| 96 | - **Set** - Map/transform fields |
| 97 | - **Code** - Complex logic |
| 98 | - **IF/Switch** - Conditional routing |
| 99 | - **Merge** - Combine data streams |
| 100 | |
| 101 | ### 4. Outputs |
| 102 | - **HTTP Request** - Call APIs |
| 103 | - **Database** - Write data |
| 104 | - **Communication** - Email, Slack, Discord |
| 105 | - **Storage** - Files, cloud storage |
| 106 | |
| 107 | ### 5. Error Handling |
| 108 | - **Error Trigger** - Catch workflow errors |
| 109 | - **IF** - Check for error conditions |
| 110 | - **Stop and Error** - Explicit failure |
| 111 | - **Continue On Fail** - Per-node setting |
| 112 | |
| 113 | --- |
| 114 | |
| 115 | ## Workflow Creation Checklist |
| 116 | |
| 117 | When building ANY workflow, follow this checklist: |
| 118 | |
| 119 | ### Planning Phase |
| 120 | - [ ] Identify the pattern (webhook, API, database, AI, scheduled) |
| 121 | - [ ] List required nodes (use search_nodes) |
| 122 | - [ ] Understand data flow (input → transform → output) |
| 123 | - [ ] Plan error handling strategy |
| 124 | |
| 125 | ### Implementation Phase |
| 126 | - [ ] Create workflow with appropriate trigger |
| 127 | - [ ] Add data source nodes |
| 128 | - [ ] Configure authentication/credentials |
| 129 | - [ ] Add transformation nodes (Set, Code, IF) |
| 130 | - [ ] Add output/action nodes |
| 131 | - [ ] Configure error handling |
| 132 | |
| 133 | ### Validation Phase |
| 134 | - [ ] Validate each node configuration (validate_node) |
| 135 | - [ ] Validate complete workflow (validate_workflow) |
| 136 | - [ ] Test with sample data |
| 137 | - [ ] H |