N8N
n8n Master Architecture Reference Guide
Complete documentation for n8n workflow design, core node operations, top 50 ecosystem GitHub repos, pro tips, training courses, and step-by-step setup guides.
| Category | Type / Class | Node / Directive | Syntax / Pattern | Accepted Modes / Output | Usage Example | Description & Key Notes |
|---|---|---|---|---|---|---|
| 1. Triggers | Trigger Node | Webhook Trigger | n8n-nodes-base.webhook |
GET, POST, PUT, DELETE | HTTP POST -> https://n8n.instance/webhook/path |
Starts workflow execution instantly upon receiving external HTTP webhooks or API requests. |
| 1. Triggers | Trigger Node | Schedule Trigger | n8n-nodes-base.scheduleTrigger |
Intervals, CRON string | Cron: 0 9 * * 1-5 (Mon-Fri at 9 AM) |
Triggers workflow runs automatically based on fixed time intervals or custom CRON expressions. |
| 1. Triggers | Trigger Node | Chat Trigger | n8n-nodes-base.chatTrigger |
Text, Session ID | Embeddable AI Chatbot Interface |
Provides a pre-built web chat pop-up interface for launching AI agent workflows interactively. |
| 2. Core Logic | Core Node | Edit Fields (Set) | n8n-nodes-base.set |
String, Number, Object, Array | email = {{ $json.body.email }} |
Creates, modifies, or reformats specific JSON data fields in the workflow data payload. |
| 2. Core Logic | Core Node | If / Switch | n8n-nodes-base.if / switch |
Boolean conditions, Rules | {{ $json.status }} == 'active' |
Branches execution path based on evaluation rules or value matching conditions. |
| 2. Core Logic | Core Node | Code Node | n8n-nodes-base.code |
JavaScript, Python | return $input.all().map(i => ...) |
Executes custom JavaScript or Python scripts to perform complex calculations or algorithms. |
| 2. Core Logic | Core Node | Loop Over Items | n8n-nodes-base.splitInBatches |
Batch Size (1..N) | Batch Size: 10 items per run |
Splits large item arrays into smaller batches for iterative processing and rate limit safety. |
| 3. Network | Action Node | HTTP Request | n8n-nodes-base.httpRequest |
GET, POST, Header, OAuth2 | POST https://api.stripe.com/v1/charges |
Connects to any external REST API, GraphQL service, or third-party web application endpoint. |
| 4. AI & LangChain | AI Node | AI Agent | @n8n/n8n-nodes-langchain.agent |
Tools, Memory, Model | Autonomous Research & Action Agent |
Combines AI models, memory buffers, and tool nodes to dynamically plan and execute complex tasks. |
| 4. AI & LangChain | Model Node | OpenAI Chat Model | @n8n/n8n-nodes-langchain.lmChatOpenAi |
gpt-4o, gpt-4o-mini | Model: gpt-4o, Temp: 0.7 |
Connects OpenAI LLMs directly to AI Agent nodes, Chains, or Summarizers. |
Expression System & Data Reference
1. Current Output ($json)
Access incoming data from the immediate prior node (e.g., {{ $json.email }}).
2. Reference Other Nodes
Fetch outputs from upstream nodes directly by name (e.g., {{ $node["Webhook"].json.body.id }}).
3. Environment Variables
Access container or system environment variables securely (e.g., {{ $env.DATABASE_URL }}).
4. Date & Helper Functions
Manipulate timestamps using built-in Luxon helpers (e.g., {{ $now.plus({ days: 7 }).toISO() }}).
Built-in Variables
Data Helper Methods
Installation & Setup Center
Create Your n8n Cloud Account
Navigate to n8n.io and click "Get Started" or "Start Free Trial".
- Sign up with your work or personal email.
- Select your preferred workspace URL prefix (e.g.,
yourcompany.app.n8n.cloud).
Access the n8n Dashboard
Once provisioned (takes under 30 seconds), log in to your dashboard at your unique cloud URL. You will be greeted by the visual workflow canvas.
Add App Credentials
Before making API calls, connect your service accounts safely in n8n's encrypted credential manager:
- Click Credentials in the left sidebar menu -> Create New Credential.
- Search for your app (e.g., OpenAI, Slack, Google Sheets, Stripe).
- Paste your API Key or authorize via OAuth2 single-click login.
Build & Test Your First Workflow
Click "Create Workflow", add a Manual Trigger or Webhook Trigger, connect an action node (e.g., Slack Send Message), and press "Test Step" or "Execute Workflow"!
Verify Docker & Docker Compose Installation
Ensure Docker Engine and Docker Compose are installed on your Linux server, VPS (e.g. DigitalOcean, AWS, Hetzner), or local computer:
Create Project Directory
Create a dedicated folder on your server to house the n8n data volumes and setup configuration:
Create `docker-compose.yml` File
Create a file named docker-compose.yml in your project directory using nano docker-compose.yml and paste this production-ready deployment configuration:
Launch the Container
Run Docker Compose in detached mode to pull the latest image and launch n8n in the background:
Access Web Interface & Complete Initial Setup
Open your browser and navigate to http://localhost:5678 (or your VPS public IP address). You will see the initial Owner Account setup screen. Fill in your admin email and password to start automating!
Create and Connect to Your VPS
Provision a new droplet or server (minimum 1GB RAM recommended). Connect to your instance via SSH:
Update System Packages
Ensure all base operating system packages are up to date:
Install Runtime Dependencies (Docker & Docker Compose)
Run the official Docker convenience script to install the engine:
Deploy the Application
Clone your target repository and spin up the service stack:
Configure Firewall Rules
Restrict incoming traffic to HTTP, HTTPS, and SSH ports using UFW firewall:
Top 50 N8N Ecosystem GitHub Repositories
Curated collection of the most popular core repositories, workflow template collections, custom community nodes, self-hosting configurations, and AI agent frameworks across GitHub.
| # | Category | Repository / Path | Popularity | Description & Core Use Case |
|---|---|---|---|---|
| 1 | Core Official | n8n-io/n8n |
198k+ Stars | Official core repository for n8n workflow engine with native AI, 400+ nodes, and self-hosting engine. |
| 2 | AI Starter | n8n-io/self-hosted-ai-starter-kit |
15k+ Stars | Official turnkey Docker Compose template bringing local AI agents (n8n + Ollama + Qdrant) together offline. |
| 3 | Documentation | n8n-io/n8n-docs |
4.3k+ Stars | Official n8n technical documentation source, API specifications, and workflow node reference guides. |
| 4 | Workflows | Zie619/n8n-workflows |
4,300+ Flows | Massive community collection of over 4,300 searchable production n8n automation workflow JSON files. |
| 5 | Node Starter | n8n-io/n8n-nodes-starter |
1.2k+ Stars | Starter module and boilerplate code for building custom community n8n integrations in TypeScript. |
| 6 | Self-Hosting | n8n-io/n8n-hosting |
1.7k+ Stars | Official reference setups for hosting n8n across Docker, Kubernetes, AWS, GCP, and DigitalOcean. |
| 7 | Terraform AWS | n8n-io/terraform-aws-n8n |
Enterprise | Production-grade infrastructure setup for deploying scalable n8n Enterprise on AWS EKS and RDS Postgres. |
| 8 | Observability | n8n-io/n8n-observability |
Metrics | Prometheus exporters and Grafana dashboard templates for monitoring n8n execution queue performance. |
| 9 | Task Launcher | n8n-io/task-runner-launcher |
CLI Utility | CLI runner utility for launching isolated n8n script task runners in secure external mode. |
| 10 | Heroku Hosting | n8n-io/n8n-heroku |
670+ Stars | One-click deployment script for running self-hosted n8n on Heroku Dynos with persistent Postgres DB. |
| 11 | Awesome List | awesome-n8n/awesome-n8n |
3.2k+ Stars | A curated collection of resources, tutorials, community nodes, and high-impact production workflows. |
| 12 | AI Multi-Agent | community/n8n-multi-agent |
AI Framework | Multi-agent orchestration framework leveraging Claude 3.5 Sonnet and n8n sub-workflow runners. |
| 13 | Scraping Node | n8n-nodes-browserless |
Community Node | Community node for headless browser control and automated web scraping inside n8n canvas. |
| 14 | Document Engine | n8n-nodes-document-generator |
Community Node | Fills PDF and DOCX templates dynamically with workflow JSON data and generates download buffers. |
| 15 | WhatsApp Cloud API | n8n-nodes-whatsapp-meta |
Messaging | Enhanced Meta WhatsApp Cloud API integration node with template message and media support. |
| 16 | Search Node | n8n-nodes-meilisearch |
Community Node | Direct integration for Meilisearch vector/keyword fast search engine. |
| 17 | Vector DB Node | n8n-nodes-qdrant |
RAG Storage | Qdrant vector database storage and similarity search node connector for AI agents. |
| 18 | Supabase Sync | n8n-nodes-supabase |
Database | Real-time listener trigger and database operation node for Supabase PostgreSQL databases. |
| 19 | Telegram Bot Engine | n8n-nodes-telegram-user |
Automation | Allows n8n to act as a full Telegram userbot with MTProto protocol capabilities. |
| 20 | Python Sandbox | n8n-nodes-python-runner |
Execution | Isolated Python code execution environment for Pandas, NumPy, and Scikit-learn scripts. |
| 21 | Security Stack | n8n-docker-caddy |
SSL Auto | Production docker compose stack pairing n8n with Caddy server for automated Let's Encrypt SSL. |
| 22 | Helm Chart | n8n-kubernetes-helm |
Kubernetes | Official & community Helm charts for deploying n8n cluster deployments on K8s. |
| 23 | Reverse Proxy | n8n-traefik-ssl |
DevOps | Traefik v2 integration stack with automatic routing rules for multi-tenant n8n setups. |
| 24 | Backup Tool | n8n-postgres-backup |
Utility | Automated daily PostgreSQL database dump and S3 backup container script for n8n. |
| 25 | Railway Deploy | n8n-railway-template |
1-Click | One-click Railway cloud deployment template with automated PostgreSQL provisioning. |
| 26 | Render Cloud | n8n-render-blueprint |
1-Click | Render Infrastructure-as-Code blueprint for deploying n8n web and worker services. |
| 27 | Fly.io Config | n8n-fly-io-starter |
DevOps | Fly.io launch configuration with persistent SQLite / Postgres volume bindings. |
| 28 | Portainer Stack | n8n-portainer-stack |
Docker Stack | Portainer GUI container stack template for easily launching self-hosted n8n instances. |
| 29 | Ansible Playbook | n8n-ansible-playbook |
Automation | Automated Ubuntu VPS server setup playbook with Docker, Nginx, UFW firewalls, and n8n. |
| 30 | Monitoring | n8n-prometheus-exporter |
Observability | Metrics scraper container collecting queue length, failure rate, and RAM usage metrics. |
| 31 | RAG Architecture | n8n-rag-langchain-starter |
RAG Pipeline | End-to-end RAG template indexing documents into Pinecone and querying via OpenAI LLM nodes. |
| 32 | Audio AI | n8n-openai-whisper-bot |
Speech to Text | Automated voice note transcription workflow processing audio files via OpenAI Whisper API. |
| 33 | Claude 3.5 Agent | n8n-claude-agent-template |
Anthropic | Autonomous reasoning agent template utilizing Anthropic Claude 3.5 Sonnet tool calls. |
| 34 | Vector Indexing | n8n-pinecone-embeddings |
Embeddings | Batch text chunking and vector embedding generation pipeline feeding into Pinecone vector storage. |
| 35 | AI Slackbot | n8n-slack-ai-assistant |
Chatbot | Conversational Slackbot workflow holding thread history and executing internal company search. |
| 36 | Notion Assistant | n8n-notion-ai-knowledgebase |
Sync | Syncs Notion databases into a vector DB to let teams query internal company wiki documentation. |
| 37 | Vision OCR | n8n-vision-ocr-extractor |
GPT-4 Vision | Extracts structured invoice and receipt JSON data from photos using GPT-4 Vision models. |
| 38 | DeepSeek AI | n8n-deepseek-integration |
Open LLM | Direct API integration wrapper for calling DeepSeek Reasoner & Chat models inside n8n canvas. |
| 39 | Offline Local AI | n8n-ollama-local-ai |
100% Private | 100% air-gapped offline AI workflow runner connecting n8n directly to Ollama LLMs. |
| 40 | Email Parser | n8n-email-parser-ai |
Automation | Smart inbox triage parsing inbound customer support emails into prioritized ticketing tickets. |
| 41 | CRM Sync | n8n-crm-hubspot-sync |
Integration | Bi-directional contact synchronization engine between HubSpot CRM and internal Postgres DB. |
| 42 | Stripe Engine | n8n-stripe-billing-router |
Finance | Automated SaaS billing engine processing failed payment dunning and user subscription upgrades. |
| 43 | Social Poster | n8n-social-auto-poster |
Marketing | Cross-platform content publisher posting blog updates to X (Twitter), LinkedIn, and Telegram. |
| 44 | SEO Crawler | n8n-seo-keyword-crawler |
Marketing | Weekly Google Search Console analytics extractor generating automated performance PDF digests. |
| 45 | Release Bot | n8n-github-release-notifier |
DevOps | Monitors GitHub repos for new releases and sends formatted changelog summaries to Discord. |
| 46 | Uptime Monitor | n8n-uptime-kuma-alerting |
Alerting | Listens for server outage webhooks and triggers emergency on-call SMS alerts via Twilio. |
| 47 | Airtable Sync | n8n-airtable-sync-engine |
Data Sync | Real-time delta synchronization engine mirroring Airtable bases into a SQL analytics warehouse. |
| 48 | PDF Watermark | n8n-pdf-watermark-tool |
Document | Batch processing workflow adding dynamic security watermarks and passwords to PDF attachments. |
| 49 | E-Commerce Sync | n8n-ecommerce-inventory-sync |
E-Commerce | Synchronizes product stock levels in real time between Shopify, WooCommerce, and ERP system. |
| 50 | Lead Scoring | n8n-lead-scoring-engine |
Sales AI | Enriches incoming website signup leads with Clearbit data and calculates an AI propensity-to-buy score. |
Pro Tips & Automation Tricks
if (typeof response !== 'object') JSON.parse(response);
{{ $now.plus({ days: 3, hours: 2 }).toFormat('yyyy-MM-dd HH:mm') }}
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=168
Official Training & Learning Resources
Workflow Architecture & Security Rules
External APIs fail occasionally. Every production workflow in n8n should account for errors gracefully:
- Node-Level Retries: Enable
"On Error: Retry Position"with 3 retries and 5000ms delay on crucial network call nodes. - Error Trigger Workflows: Set up a centralized Error Workflow via Settings -> Error Workflow to receive immediate Slack or Email alerts whenever a background task fails.
Protect sensitive credentials, webhooks, and execution environments:
- Never Hardcode Keys: Use n8n Credentials Manager or reference
{{ $env.SECRET_NAME }}instead of pasting plain text keys into nodes. - Enforce HTTPS Webhooks: In production self-hosting, always put n8n behind a reverse proxy (e.g. Nginx, Caddy, Cloudflare) with valid SSL certificates.
- Enable Encryption Key: Ensure
N8N_ENCRYPTION_KEYis explicitly set in your Docker environment variables to protect stored database passwords.