N8n workflow patterns

From sickn33/agentic-awesome-skills · View interactive version

N8n workflow patterns is an AI agent skill from the GitHub repository sickn33/agentic-awesome-skills. Proven architectural patterns for building n8n workflows.

How to use this skill

Skill file

n8n Workflow Patterns

Proven architectural patterns for building n8n workflows.

When to Use


The 5 Core Patterns

Common design patterns:

  1. Webhook Processing
  1. [HTTP API Integration]
  1. Database Operations
  1. AI Agent Workflow
  1. Scheduled Tasks

Pattern Selection Guide

When to use each pattern:

Webhook Processing - Use when:

HTTP API Integration - Use when:

Database Operations - Use when:

AI Agent Workflow - Use when:

Scheduled Tasks - Use when:


Common Workflow Components

All patterns share these building blocks:

1. Triggers

2. Data Sources

3. Transformation

4. Outputs

5. Error Handling


Before activation, confirm credential scope, destination recipients and paid/API effects. Authenticate webhooks, validate payloads, deduplicate delivery IDs and use idempotent writes. Retry with bounds and backoff; a timeout may follow a successful side effect. Restrict AI tools and treat retrieved content as untrusted. The Error Trigger belongs to a separate configured error workflow, not an ordinary branch of the main workflow. Sequential branches are not necessarily concurrent execution.

Workflow Creation Checklist

When building ANY workflow, follow this checklist:

Planning Phase

Implementation Phase

Validation Phase

Deployment Phase


Data Flow Patterns

Linear Flow

Trigger → Transform → Action → End

Use when: Simple workflows with single path

Branching Flow

Trigger → IF → [True Path]
             └→ [False Path]

Use when: Different actions based on conditions

Parallel Processing

Trigger → [Branch 1] → Merge
       └→ [Branch 2] ↗

Use when: Independent operations that can run simultaneously

Loop Pattern

Trigger → Split in Batches → Process → Loop (until done)

Use when: Processing large datasets in chunks

Error Handler Pattern

Main Flow → [Success Path]
         └→ [Error Trigger → Error Handler]

Use when: Need separate error handling workflow


Common Gotchas

1. Webhook Data Structure

Problem: Can't access webhook payload data

Solution: Data is nested under $json.body

❌ {{$json.email}}
✅ {{$json.body.email}}

See: n8n Expression Syntax skill

2. Multiple Input Items

Problem: Node processes all input items, but I only want one

Solution: Use "Execute Once" mode or process first item only

{{$input.first().json.field}}  // First item only

3. Authentication Issues

Problem: API calls failing with 401/403

Solution:

4. Node Execution Order

Problem: Nodes executing in unexpected order

Solution: Check workflow settings → Execution Order

5. Expression Errors

Problem: Expressions showing as literal text

Solution: Use {{}} around expressions


Integration with Other Skills

These skills work together with Workflow Patterns:

n8n MCP Tools Expert - Use to:

n8n Expression Syntax - Use to:

n8n Node Configuration - Use to:

n8n Validation Expert - Use to:


Evidence and version scope

The patterns are design heuristics, not measured usage statistics. No dataset or methodology is bundled to establish prevalence, percentages or average editing times. Node names and available operations vary by installed n8n and MCP version. The detailed pattern files listed later are not bundled here; use installed documentation or the official n8n docs rather than claiming they were read.


Quick Start Examples

Example 1: Simple Webhook → Slack

1. Webhook (path: "form-submit", POST)
2. Set (map form fields)
3. Slack (post message to #notifications)

Example 2: Scheduled Report

1. Schedule (daily at 9 AM)
2. HTTP Request (fetch analytics)
3. Code (aggregate data)
4. Email (send formatted report)
5. Error Trigger → Slack (notify on failure)

Example 3: Database Sync

1. Schedule (every 15 minutes)
2. Postgres (query new records)
3. IF (check if records exist)
4. MySQL (insert records)
5. Postgres (update sync timestamp)

Example 4: AI Assistant

1. Webhook (receive chat message)
2. AI Agent
   ├─ OpenAI Chat Model (ai_languageModel)
   ├─ HTTP Request Tool (ai_tool)
   ├─ Database Tool (ai_tool)
   └─ Window Buffer Memory (ai_memory)
3. Webhook Response (send AI reply)

Example 5: API Integration

1. Manual Trigger (for testing)
2. HTTP Request (GET /api/users)
3. Split In Batches (process 100 at a time)
4. Set (transform user data)
5. Postgres (upsert users)
6. Loop (back to step 3 until done)

Detailed Pattern Files

For comprehensive guidance on each pattern:


Real Template Examples

From n8n template library:

Template #2947: Weather to Slack

Webhook Processing: Most common pattern

HTTP API: Common pattern

Database Operations: Common pattern

AI Agents: Growing in usage

Use search_templates and get_template from n8n-mcp tools to find examples!


Best Practices

✅ Do

❌ Don't


Summary

Key Points:

  1. 5 core patterns provide a starting structure
  2. Webhook processing suits incoming events
  3. Use the workflow creation checklist for every workflow
  4. Plan pattern → Select nodes → Build → Validate → Deploy
  5. Integrate with other skills for complete workflow development

Next Steps:

  1. Identify your use case pattern
  2. Read the detailed pattern file
  3. Use n8n MCP Tools Expert to find nodes
  4. Follow the workflow creation checklist
  5. Use n8n Validation Expert to validate

Related Skills:

Limitations

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.