N8N Guide
# Docker (easiest): docker run -d --name n8n -p 5678:5678 \ -v n8n_data:/home/node/.n8n \ n8nio/n8n # npm: npx n8n # Open: http://localhost:5678
N8N is the open-source alternative to Zapier/Make. Build workflows visually by connecting nodes — triggers (webhook, schedule, email) → actions (HTTP request, database query, Slack message, AI generation). Each node has a GUI for configuration with zero code.
N8N supports 400+ integrations: Slack, email (SMTP), Google Sheets, Notion, GitHub, Jira, PostgreSQL, MongoDB, OpenAI, Pinecone, and more. The HTTP Request node can call any REST/gRPC API. The Code node lets you write JavaScript/Python for custom logic.
Self-host N8N for sensitive data workflows. It supports queues with Redis for scaling, worker separation, and multi-user with roles. The execution log shows every step with input/output data for debugging. GUI is the primary interface — perfect for ops teams.
Setup
docker run -d --restart=always \ --name n8n \ -p 5678:5678 \ -v n8n_data:/home/node/.n8n \ -e N8N_SECURE_COOKIE=false \ n8nio/n8n # With basic auth: -e N8N_BASIC_AUTH_ACTIVE=true \ -e N8N_BASIC_AUTH_USER=admin \ -e N8N_BASIC_AUTH_PASSWORD=secret # Open: http://localhost:5678
npm install n8n -g n8n start # Or: npx n8n # Configuration: export N8N_PORT=5678 export DB_TYPE=postgresdb export DB_POSTGRESDB_DATABASE=n8n export DB_POSTGRESDB_USER=n8n export DB_POSTGRESDB_PASSWORD=secret n8n start
Core Nodes
# Node: HTTP Request
# Method: GET/POST/PUT/DELETE
# URL: https://api.example.com/users
# Authentication: Basic / OAuth2 / API Key / Header
# Parse JSON response:
# Response data is available in subsequent nodes as:
# {{ $json.body }}
# {{ $json.headers }}
# Pagination:
# Headers.Link parsing or loop over pagesTriggers
# Add "Webhook" node # Method: POST # Path: my-webhook # Then any service POSTs to: # POST http://your-n8n:5678/webhook/my-webhook # Example: GitHub webhook → save issue to Notion # or: Stripe webhook → send Slack alert # The webhook URL is auto-generated: echo "Your URL: http://localhost:5678/webhook/$(openssl rand -hex 8)"
# Add "Schedule Trigger" node # Mode: Every Day / Every Hour / Custom # Custom cron: */15 * * * * (every 15 min) # Or: 0 6 * * 1-5 (weekdays at 6am) # Common patterns: # - Every hour: 0 * * * * # - Every Monday 9am: 0 9 * * 1 # - First of month: 0 0 1 * *
AI Nodes
# Nodes: # - OpenAI (Chat, Completion, Embedding, Image) # - Anthropic Claude # - Hugging Face Inference # - LangChain (advanced chains) # Example: Email → AI summarize → Slack # 1. Email (IMAP) trigger # 2. OpenAI node: summarize body text # 3. Slack node: post summary to channel
Advanced
# Each node has:
# - "Continue on Fail" toggle
# - "Error Workflow" (separate workflow that runs on error)
# - Retry on Fail (with backoff)
# Error workflow receives:
# { error: "...", workflow: { ... }, execution: { ... } }
# Use: send notification, log to database, create ticket# Export all workflows as JSON: n8n export:workflow --all --output=./backups/ # Import: n8n import:workflow --input=./backups/my-workflow.json # Export credentials: n8n export:credentials --all --output=./secrets/ # List workflows: n8n list:workflow # Start with specific workflows: n8n start --tunnel # Expose to internet via n8n tunnel