n8n

n8n Comprehensive

Automation

Complete guide to n8n workflow automation covering core concepts, advanced AI with LangChain, code/expressions, integrations, API management, and embedding.

Available MCP Tools

Workflow Management

Node Discovery

Execution & Testing

Templates & Deployment

When to Use

Decision Trees

Data Transformation

AI Implementation

Integration Method

Common Workflow Patterns

Pattern 1: Webhook to Database

Webhook Trigger → Validate Data (Code) → Transform (Set) → Insert to DB → Return Response

Pattern 2: Scheduled Data Sync

Schedule Trigger → Get Data from Source → Transform → Upsert to Destination → Log Results

Pattern 3: AI Document Processing

Trigger → Load Document → Extract Text → Chunk → Embed → Store in Vector DB

Pattern 4: Multi-Service Orchestration

Trigger → [Service A, B, C in parallel] → Merge Results → Transform → Output

Quick Reference: Expression Syntax

// Current item
{{ $json.fieldName }}
{{ $json.nested.property }}
{{ $json.array[0] }}

// Other nodes
{{ $('Node Name').item.json.field }}

// Dates
{{ $now }}
{{ $today.format('YYYY-MM-DD') }}

// Transformations
{{ $json.text.toUpperCase() }}
{{ $json.items.map(i => i.name) }}
{{ $json.price * 1.1 }}

Quick Reference: Code Node

// Basic structure
const items = $input.all();
return items.map(item => ({
  json: {
    // transformed data
  }
}));

// Access other nodes
const data = $('Previous Node').all();

// Binary preservation
return [{
  json: { processed: true },
  binary: item.binary
}];

Best Practices