n8n-workflow-patterns – skill Agent & Tự động hóa cho agent AI
Các mẫu kiến trúc đã được kiểm chứng để xây dựng workflow n8n.
Cài skill n8n-workflow-patterns bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/n8n-workflow-patterns-8aa15.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /n8n-workflow-patterns – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/n8n-workflow-patterns-8aa15.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $n8n-workflow-patterns – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/n8n-workflow-patterns-8aa15.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /n8n-workflow-patterns – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/n8n-workflow-patterns-8aa15.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /n8n-workflow-patterns – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
n8n Workflow Patterns
Proven architectural patterns for building n8n workflows.
When to Use
- You need to choose an architectural pattern for an n8n workflow before building it.
- The task involves webhook processing, API integration, scheduled jobs, database sync, or AI-agent workflow design.
- You want a high-level workflow structure rather than node-by-node troubleshooting.
---
The 5 Core Patterns
Common design patterns:
1. Webhook Processing
- Receive HTTP requests → Process → Output
- Pattern: Webhook → Validate → Transform → Respond/Notify
2. [HTTP API Integration]
- Fetch from REST APIs → Transform → Store/Use
- Pattern: Trigger → HTTP Request → Transform → Action → Error Handler
3. Database Operations
- Read/Write/Sync database data
- Pattern: Schedule → Query → Transform → Write → Verify
4. AI Agent Workflow
- AI agents with tools and memory
- Pattern: Trigger → AI Agent (Model + Tools + Memory) → Output
5. Scheduled Tasks
- Recurring automation workflows
- Pattern: Schedule → Fetch → Process → Deliver → Log
---
Pattern Selection Guide
When to use each pattern:
Webhook Processing - Use when:
- Receiving data from external systems
- Building integrations (Slack commands, form submissions, GitHub webhooks)
- Need instant response to events
- Example: "Receive Stripe payment webhook → Update database → Send confirmation"
HTTP API Integration - Use when:
- Fetching data from external APIs
- Synchronizing with third-party services
- Building data pipelines
- Example: "Fetch GitHub issues → Transform → Create Jira tickets"
Database Operations - Use when:
- Syncing between databases
- Running database queries on schedule
- ETL workflows
- Example: "Read Postgres records → Transform → Write to MySQL"
AI Agent Workflow - Use when:
- Building conversational AI
- Need AI with tool access
- Multi-step reasoning tasks
- Example: "Chat with AI that can search docs, query database, send emails"
Scheduled Tasks - Use when:
- Recurring reports or summaries
- Periodic data fetching
- Maintenance tasks
- Example: "Daily: Fetch analytics → Generate report → Email team"
---
Common Workflow Components
All patterns share these building blocks:
1. Triggers
- Webhook - HTTP endpoint (instant)
- Schedule - Cron-based timing (periodic)
- Manual - Click to execute (testing)
- Polling - Check for changes (intervals)
2. Data Sources
- HTTP Request - REST APIs
- Database nodes - Postgres, MySQL, MongoDB
- Service nodes - Slack, Google Sheets, etc.
- Code - Custom JavaScript/Python
3. Transformation
- Set - Map/transform fields
- Code - Complex logic
- IF/Switch - Conditional routing
- Merge - Combine data streams
4. Outputs
- HTTP Request - Call APIs
- Database - Write data
- Communication - Email, Slack, Discord
- Storage - Files, cloud storage
5. Error Handling
- Error Trigger - Catch workflow errors
- IF - Check for error conditions
- Stop and Error - Explicit failure
- Continue On Fail - Per-node setting
---
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
- [ ] Identify the pattern (webhook, API, database, AI, scheduled)
- [ ] List required nodes (use search_nodes)
- [ ] Understand data flow (input → transform → output)
- [ ] Plan error handling strategy
Implementation Phase
- [ ] Create workflow with appropriate trigger
- [ ] Add data source nodes
- [ ] Configure authentication/credentials
- [ ] Add transformation nodes (Set, Code, IF)
- [ ] Add output/action nodes
- [ ] Configure error handling
Validation Phase
- [ ] Validate each node configuration (validate_node)
- [ ] Validate complete workflow (validate_workflow)
- [ ] Test with sample data
- [ ] Handle edge cases (empty data, errors)
Deployment Phase
- [ ] Review workflow settings (execution order, timeout, error handling)
- [ ] Activate workflow using
activateWorkflowoperation - [ ] Monitor first executions
- [ ] Document workflow purpose and data flow
---
Data Flow Patterns
Linear Flow
Trigger → Transform → Action → EndUse 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 only3. Authentication Issues
Problem: API calls failing with 401/403
Solution:
- Configure credentials properly
- Use the "Credentials" section, not parameters
- Test credentials before workflow activation
4. Node Execution Order
Problem: Nodes executing in unexpected order
Solution: Check workflow settings → Execution Order
- v0: Top-to-bottom (legacy)
- v1: Connection-based (recommended)
5. Expression Errors
Problem: Expressions showing as literal text
Solution: Use {{}} around expressions
- See n8n Expression Syntax skill for details
---
Integration with Other Skills
These skills work together with Workflow Patterns:
n8n MCP Tools Expert - Use to:
- Find nodes for your pattern (search_nodes)
- Understand node operations (get_node)
- Create workflows (n8n_create_workflow)
- Deploy templates (n8n_deploy_template)
- Use ai_agents_guide for AI pattern guidance
n8n Expression Syntax - Use to:
- Write expressions in transformation nodes
- Access webhook data correctly ({{$json.body.field}})
- Reference previous nodes ({{$node["Node Name"].json.field}})
n8n Node Configuration - Use to:
- Configure specific operations for pattern nodes
- Understand node-specific requirements
n8n Validation Expert - Use to:
- Validate workflow structure
- Fix validation errors
- Ensure workflow correctness before deployment
---
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:
- webhook_processing.md - Webhook patterns, data structure, response handling
- http_api_integration - REST APIs, authentication, pagination, retries
- **database_operations
… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- neverapply – Tìm việc phù hợp, tùy chỉnh CV, chuẩn bị phỏng vấn và ứng tuyển với sự đồng ý của người…
- nika – Chạy các công việc AI lặp lại dưới dạng tệp quy trình có kiểm tra và giới hạn ngân sách.
- not-human-search-mcp – Tìm kiếm website sẵn sàng cho AI, kiểm tra chi tiết site đã được index, xác minh…
- notebooklm – Tương tác với Google NotebookLM để truy vấn tài liệu bằng câu trả lời có nguồn từ…
- notion-automation – Tự động hóa tác vụ Notion qua Rube MCP (Composio): trang, database, block, bình luận…
- odoo-purchase-workflow – Hướng dẫn chuyên sâu Odoo Purchase: quy trình RFQ → PO → Receipt → Vendor Bill, thỏa…
- odw – Quy trình đa tác nhân động: lập kế hoạch trước, sau đó điều phối các agent chạy song…
- omentir-linkedin-outreach – Thực hiện prospecting và outreach trên LinkedIn qua máy chủ MCP Omentir: tìm người, chấm…