Skip to main content

Overview

The n8n Workflow Patterns skill teaches five proven architectural patterns drawn from analysis of real-world n8n usage. These five patterns cover over 90% of automation use cases.

Webhook Processing

Receive HTTP requests from external systems and process them instantly. The most common pattern (35% of workflows).

HTTP API Integration

Fetch data from REST APIs, transform it, and use it in your workflow. Ideal for data pipelines.

Database Operations

Read, write, sync, and manage database data. For ETL, data sync, and maintenance tasks.

AI Agent Workflow

Build AI agents with tool access, memory, and reasoning capabilities.

Scheduled Tasks

Recurring automation workflows that run automatically on a time-based schedule.

Pattern Selection Guide

Choose based on what triggers the workflow and what it does with data:

Webhook Processing

Use when: Receiving data from external systems (Slack commands, form submissions, payment webhooks, GitHub events) Key characteristic: Instant, event-driven processing

Node Structure

Configuration Notes

The most common webhook mistake: webhook payload data is nested under $json.body, not at the root level.
The webhook node supports two response modes:

Example Use Cases

Data access:

Template References

From the n8n template library (1,085 webhook templates):
  • Simple Form to Slack: Webhook → Set → Slack
  • Payment Processing: Webhook → Verify Signature → Update Database → Send Receipt → Notify Admin
  • Chat Bot: Webhook → Parse Command → AI Agent → Format Response → Webhook Response

HTTP API Integration

Use when: Fetching data from external APIs, synchronizing with third-party services, or building data pipelines Key characteristic: External data fetching with error handling

Node Structure

Configuration Notes

Always use n8n’s credentials system for API keys — never hardcode them in parameters. Use environment variables for API base URLs: ={{$env.API_BASE_URL}}/users
For large datasets, implement pagination to avoid memory issues:

Example Use Cases

Fetch GitHub issues hourly and store in Postgres:

Template References

From the n8n template library (892 API integration templates):
  • GitHub to Notion: Schedule → HTTP Request (GitHub) → Transform → HTTP Request (Notion)
  • Weather to Slack: Schedule → HTTP Request (Weather API) → Set (format) → Slack
  • CRM Sync: Schedule → HTTP Request (CRM A) → Transform → HTTP Request (CRM B)

Database Operations

Use when: Syncing between databases, running database queries on schedule, ETL workflows Key characteristic: Data persistence and synchronization

Node Structure

Configuration Notes

Always use parameterized queries to prevent SQL injection:
Supported databases: Postgres, MySQL, MongoDB, Microsoft SQL, SQLite, Redis, and more via community nodes.

Example Use Cases

Sync Postgres to MySQL every 15 minutes:

Template References

From the n8n template library (456 database templates):
  • Data Sync: Schedule → Postgres (SELECT new records) → Transform → MySQL (INSERT)
  • ETL Pipeline: Schedule → [Multiple DB reads] → Merge → Transform → Warehouse (INSERT)
  • Backup: Schedule → Postgres (SELECT all) → JSON → Google Drive (upload)

AI Agent Workflow

Use when: Building conversational AI, creating agents with tool access, or automating multi-step reasoning tasks Key characteristic: AI-powered decision making with tool use

Node Structure

Configuration Notes

n8n supports 8 AI connection types. The most critical rule: connect tools via the ai_tool port, not the main port.
The 8 AI connection types:

Example Use Cases

Template References

From the n8n template library (234 AI templates):
  • Simple Chatbot: Webhook → AI Agent (GPT-4 + Memory) → Webhook Response
  • Document Q&A: Setup: Files → Embed → Vector Store / Query: Webhook → AI Agent → Response
  • SQL Analyst: Webhook → AI Agent (GPT-4 + Postgres Tool) → Format → Response

Scheduled Tasks

Use when: Recurring reports or summaries, periodic data fetching, maintenance tasks Key characteristic: Time-based automated execution

Node Structure

Configuration Notes

Always set an explicit timezone in the workflow settings. Without it, the schedule runs in the server’s local time, which may shift with daylight saving transitions.
The Schedule node supports three modes: Common cron expressions:

Example Use Cases

Sales report at 9 AM every day:

Template References

From the n8n template library:
  • Template #2947 (Weather to Slack): Schedule (daily 8 AM) → HTTP Request (weather API) → Set (format) → Slack
  • Daily backup: Schedule (nightly 2 AM) → Postgres (export) → Google Drive (upload) → Email (confirmation)
  • Monitoring: Schedule (every 5 min) → HTTP Request (health check) → IF (down) → PagerDuty alert

Workflow Creation Checklist

Apply this checklist to every workflow regardless of pattern:
1

Planning Phase

  • Identify the pattern (webhook, API, database, AI, scheduled)
  • List required nodes using search_nodes
  • Understand the data flow (input → transform → output)
  • Plan the error handling strategy
2

Implementation Phase

  • Create the workflow with the appropriate trigger
  • Add data source nodes
  • Configure authentication and credentials
  • Add transformation nodes (Set, Code, IF)
  • Add output and action nodes
  • Configure error handling
3

Validation Phase

  • Validate each node configuration with validate_node
  • Validate the complete workflow with validate_workflow
  • Test with sample data
  • Handle edge cases (empty data, errors)
4

Deployment Phase

  • Review workflow settings (execution order, timeout, error handling)
  • Activate the workflow using the activateWorkflow operation
  • Monitor the first few executions
  • Document the workflow purpose and data flow

Pattern Statistics

Based on analysis of real n8n workflow usage: Most common triggers:
  1. Webhook — 35%
  2. Schedule (periodic tasks) — 28%
  3. Manual (testing/admin) — 22%
  4. Service triggers (Slack, email, etc.) — 15%
Most common transformations:
  1. Set (field mapping) — 68%
  2. Code (custom logic) — 42%
  3. IF (conditional routing) — 38%
  4. Switch (multi-condition) — 18%
Average workflow complexity:
  • Simple (3–5 nodes): 42%
  • Medium (6–10 nodes): 38%
  • Complex (11+ nodes): 20%
Start with the simplest pattern that solves your problem. Most workflows fall in the 3–5 node range.

Common Data Flow Shapes


Getting Help