What is n8n?

n8n (pronounced “n-eight-n”) is a workflow automation platform that combines the speed of no-code visual builders with the flexibility of full-code development. The name is a numeronym derived from “nodemation” — a fusion of node and automation, with the 8 representing the eight letters between the first and last “n”.

Think of it as Zapier or Make.com, but self-hostable, developer-friendly, and with native AI agent capabilities built in.

Why n8n Over Zapier or Make?

Featuren8nZapierMake (Integromat)
Self-hosting✅ Free Community Edition❌ Cloud only❌ Cloud only
Pricing modelPer workflow execution (unlimited steps)Per task (each step = 1 task)Per operation
Code in workflows✅ JavaScript & Python nodes❌ Limited⚠️ Limited
AI agent builder✅ Native, 70+ AI nodes⚠️ Basic⚠️ Basic
Custom nodes✅ Build your own
Data control✅ Your infrastructure❌ Their cloud❌ Their cloud
Open source✅ Fair-code licensed
Free tier✅ Self-hosted = free unlimited⚠️ Limited free tier⚠️ Limited free tier
Integrations400+ nodes7,000+ apps1,500+ apps
Cost at scaleVery low (self-hosted)Expensive (per-task pricing)Moderate

The key difference: Zapier and Make charge per step/operation. A workflow with 10 steps costs 10 tasks. n8n charges per execution (one complete workflow run) regardless of how many steps it has. Self-hosted n8n Community Edition is free with unlimited executions.

What n8n is Good For

  • Automating repetitive tasks — sync data between apps, send notifications, process files
  • API orchestration — connect multiple APIs into complex multi-step workflows
  • AI agent workflows — build RAG chatbots, autonomous agents, and AI-powered automations
  • Data pipelines — ETL operations, data transformation, database syncing
  • DevOps automation — CI/CD triggers, infrastructure monitoring, alerting
  • Business operations — lead processing, email campaigns, CRM sync, reporting

Who Uses n8n?

n8n is designed for technical users — developers, DevOps engineers, sysadmins, and technically-minded power users. You don’t need to be a developer to use it, but comfort with JSON, basic JavaScript, and API concepts will take you much further.


Pricing: n8n Cloud vs Self-Hosted

n8n Cloud (Hosted by n8n)

PlanPriceExecutions/moConcurrentBest For
Starter$20/mo (billed annually)2,5005Getting started, testing
Pro$50/mo (billed annually)10,00020Solo builders, small teams
Business$800/mo (billed annually)40,00030+Companies <100 employees
EnterpriseContact salesCustom200+Large orgs, compliance needs

What counts as an execution? One complete run of a workflow from start to finish. It doesn’t matter how many steps/nodes the workflow has — a 1-node workflow and a 50-node workflow both count as 1 execution.

Self-Hosted

EditionCostKey Features
CommunityFreeFull core product, unlimited workflows & executions, 400+ nodes, AI nodes, code nodes
Business$800/moAdds SSO/SAML, version control via Git, multi-environment, advanced roles, scaling
EnterpriseCustomAdds external secret store, log streaming, extended data retention, dedicated SLA

Key insight: The Community Edition is remarkably capable. It has all 400+ integration nodes, AI agent nodes, code nodes, webhooks — everything you need to build production automations. The paid tiers are mainly about team collaboration, SSO, and enterprise governance, not about unlocking core automation features.

Cost Comparison at Scale

Scenarion8n Self-Hostedn8n Cloud ProZapier
1,000 executions/mo, 10 steps eachFree (just server cost ~$5-10/mo)$50/mo~$50-100/mo (10K tasks)
10,000 executions/mo, 20 steps eachFree (just server cost)$50/mo~$200-500/mo (200K tasks)
50,000 executions/mo, 15 steps eachFree (just server cost)$800/mo (Business)~$500-1,500/mo

Bottom line: Self-hosting n8n on a $5-10/month VPS gives you unlimited automations that would cost hundreds or thousands per month on Zapier.


Deployment: How to Host n8n

Hosting Options Overview

MethodDifficultyCostBest For
n8n CloudEasiest$20-800/moNon-technical users, no server management
Docker (single container)Easy~$5-10/mo VPSQuick self-hosting, testing
Docker ComposeMedium~$5-20/mo VPSProduction self-hosting with PostgreSQL + SSL
npmMediumYour machineLocal development only
KubernetesAdvancedVariesEnterprise scaling, high availability
Cloud providersMediumVariesAWS, Azure, GCP, DigitalOcean, Hetzner

Option 1: n8n Cloud (Easiest)

Sign up at n8n.io/cloud. No server, no setup. Choose a plan, get a URL, start building. Data stored in EU (Frankfurt, Germany).

Pros: Zero maintenance, automatic updates, managed infrastructure Cons: Monthly cost, data not on your infrastructure, execution limits

This is the sweet spot — full control, production-ready, with PostgreSQL for the database and Traefik for automatic SSL.

Prerequisites

  • A Linux server (VPS or local machine)
  • Docker and Docker Compose installed
  • A domain name with DNS access

Step-by-Step

1. Install Docker and Docker Compose:

# Verify Docker is installed
docker --version
docker compose version

2. Set up DNS:

Create an A record pointing your subdomain to your server’s IP:

Record TypeNameDestination
An8nyour.server.ip.address

3. Create project directory and .env file:

mkdir n8n-compose
cd n8n-compose
mkdir local-files

Create a .env file:

# Your domain
DOMAIN_NAME=example.com
SUBDOMAIN=n8n
# Result: https://n8n.example.com

# Timezone (affects cron schedules)
GENERIC_TIMEZONE=Australia/Melbourne

# Email for SSL certificate
SSL_EMAIL=you@example.com

4. Create compose.yaml:

services:
  traefik:
    image: "traefik"
    restart: always
    command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
      - "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}"
      - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - traefik_data:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock:ro

  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: always
    labels:
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
      - traefik.http.routers.n8n.tls=true
      - traefik.http.routers.n8n.entrypoints=websecure
      - traefik.http.routers.n8n.tls.certresolver=mytlschallenge
      - traefik.http.services.n8n.loadbalancer.server.port=5678
    environment:
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=443
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
      - N8N_ENCRYPTION_KEY=your-random-64-char-string-here
    volumes:
      - n8n_data:/home/node/.n8n
      - ./local-files:/files

volumes:
  n8n_data:
  traefik_data:

5. Generate an encryption key:

openssl rand -hex 32

Add the output to your .env file as N8N_ENCRYPTION_KEY.

⚠️ Critical: Save this key somewhere safe. If you lose it, all stored credentials become permanently undecryptable after a restart.

6. Start n8n:

docker compose up -d

7. Access n8n:

Navigate to https://n8n.example.com and create your admin account. Done!

Option 3: Docker Compose with PostgreSQL (Production) ⭐⭐

For production workloads, replace the default SQLite with PostgreSQL for better performance and reliability. Add this to your compose.yaml:

  postgres:
    image: postgres:16-alpine
    restart: always
    environment:
      - POSTGRES_DB=n8n
      - POSTGRES_USER=n8n
      - POSTGRES_PASSWORD=your-strong-password
    volumes:
      - postgres_data:/var/lib/postgresql/data

  n8n:
    # ... same as above, plus:
    environment:
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_DATABASE=n8n
      - DB_POSTGRESDB_USER=n8n
      - DB_POSTGRESDB_PASSWORD=your-strong-password
    depends_on:
      - postgres

volumes:
  n8n_data:
  traefik_data:
  postgres_data:

Option 4: Quick Local Docker (Testing)

For local testing without SSL or a domain:

docker run -it --rm \
  --name n8n \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n

Then open http://localhost:5678.


Key Concepts: How n8n Works

The Building Blocks

ConceptWhat It IsAnalogy
WorkflowA complete automation — a series of connected nodesA recipe
NodeA single step in a workflow (trigger, action, logic, etc.)One instruction in a recipe
TriggerThe first node that starts a workflow”When the oven is ready…”
ConnectionThe link between nodes that passes dataThe flow of ingredients
ItemA single piece of data flowing through the workflowOne egg
ExpressionDynamic value referencing data from other nodes{{$json.fieldName}}
ExecutionOne complete run of a workflow from start to finishCooking one batch

How Data Flows

Trigger Node → Node A → Node B → Node C → Output
     ↓             ↓          ↓          ↓
  Starts the   Receives   Receives   Receives
  workflow     items      items      items
               from A     from B     from C

Each node receives items (JSON objects) from the previous node, processes them, and passes results to the next node. A single execution can process multiple items — if a trigger receives 10 emails, the workflow runs 10 times through the pipeline.

Node Types

TypeWhat It DoesExamples
TriggerStarts the workflowSchedule, Webhook, Polling, Manual
ActionPerforms an operationSend email, Create record, HTTP request
TransformModifies dataSet, Edit Fields, Filter, Sort, Merge
LogicControls flowIf, Switch, Loop, Error Trigger
CodeRun custom codeFunction (JavaScript), Python
AIAI/LLM operationsAI Agent, OpenAI, Anthropic, LangChain

Expressions

Expressions let you dynamically reference data from other nodes. They use the {{ }} syntax:

{{ $json.fieldName }}              → Access a field from current item
{{ $node["NodeName"].json.field }}  → Access data from a specific node
{{ $now }}                          → Current timestamp
{{ $workflow.id }}                  → Current workflow ID

JSON: The Universal Language

n8n is built on JSON. Every item that flows through a workflow is a JSON object:

{
  "name": "John",
  "email": "john@example.com",
  "order_total": 150.00,
  "items": ["widget", "gadget"]
}

Understanding JSON is essential for n8n. If you’re not comfortable with JSON, spend an hour learning the basics — it’ll make everything else much easier.


AI in n8n: Building AI Agent Workflows

n8n has 70+ AI nodes built in, making it one of the most powerful platforms for building AI agent workflows. It integrates natively with LangChain concepts.

AI Node Categories

CategoryNodesWhat You Can Build
AI AgentAI Agent, Agent Memory, Agent ToolsAutonomous agents that reason and act
Chat ModelsOpenAI, Anthropic, Google Gemini, Ollama, GroqConnect to any LLM
MemoryWindow Buffer, Postgres, RedisGive agents conversation memory
ToolsCalculator, HTTP Request, Custom Code, DatabaseLet agents take actions
RAGEmbeddings, Vector Store, Document LoaderBuild retrieval-augmented generation
Output ParsersStructured Output, Auto-fixingForce structured LLM responses

Example: RAG Chatbot Workflow

Webhook (receives question)

AI Agent
    ├── Chat Model: OpenAI GPT-4
    ├── Memory: Postgres (conversation history)
    └── Tools:
        ├── Vector Store (search your documents)
        └── HTTP Request (look up external data)

Respond to Webhook (sends answer)

Example: Email Triage Agent

Schedule Trigger (every 5 minutes)

Read Emails (IMAP node)

AI Agent (classifies each email)
    ├── Chat Model: Claude
    ├── Memory: Window Buffer
    └── Tools:
        ├── Slack (notify team of urgent emails)
        ├── Google Sheets (log all emails)
        └── HTTP Request (create ticket in helpdesk)

Move Email to folder (based on AI classification)

Supported AI Providers

ProviderNodeUse Case
OpenAIGPT-4, GPT-4o, o1, o3General purpose, most popular
AnthropicClaude 3.5/4 Sonnet, OpusLong context, reasoning
GoogleGemini Pro, FlashMultimodal
OllamaLocal LLMs (Llama, Mistral, etc.)Privacy, no API cost
GroqFast inferenceSpeed-critical
MistralMistral modelsOpen weights
CohereCommand R+Enterprise

Pro tip: Use Ollama with n8n to connect to your local LLM (like the Mac Mini M4 Pro we discussed!). This gives you fully private AI automation with zero API costs.


Environment Variables: The Important Ones

VariablePurposeExample
N8N_HOSTThe hostname n8n runs onn8n.example.com
N8N_PORTThe port (use 443 with SSL)443
N8N_PROTOCOLhttp or httpshttps
N8N_ENCRYPTION_KEYEncrypts stored credentialsRandom 64-char hex string
GENERIC_TIMEZONETimezone for schedule triggersAustralia/Melbourne
DB_TYPEDatabase typesqlitedb or postgresdb
DB_POSTGRESDB_HOSTPostgreSQL hostpostgres
DB_POSTGRESDB_PASSWORDPostgreSQL passwordStrong password
N8N_BASIC_AUTH_ACTIVEEnable basic authtrue
N8N_BASIC_AUTH_USERBasic auth usernameadmin
N8N_BASIC_AUTH_PASSWORDBasic auth passwordStrong password
EXECUTIONS_DATA_PRUNEAuto-delete old execution logstrue
EXECUTIONS_DATA_MAX_AGEDays to keep execution logs30
N8N_METRICSEnable Prometheus metricstrue

VPS Recommendations for Self-Hosting

ProviderMinimum SpecPriceNotes
Hetzner CloudCX22 (2 vCPU, 4GB RAM)~€4-6/moBest value, EU servers
DigitalOceanBasic Droplet (1 vCPU, 2GB)~$12/moSimple, good docs
VultrCloud Compute (1 vCPU, 2GB)~$12/moSimilar to DO
AWS EC2t3.small (2 vCPU, 2GB)~$15-20/moOverkill but familiar
Oracle CloudAlways Free (4 vCPU, 24GB)FreeARM instance, great if available
Home serverYour hardwareFreeYou already have hardware

Minimum specs: 1 vCPU, 1GB RAM for light workloads (a few workflows, low frequency). 2 vCPU, 4GB RAM for production with PostgreSQL and multiple active workflows.


Common Use Cases

1. Sync Data Between Apps

Schedule (daily at 9am)

Read from Google Sheets

Transform data (Filter, Set fields)

Write to Notion / Airtable / Database

2. Webhook-Triggered API

Webhook (receives POST request)

Process payload (validate, transform)

Create record in database

Send Slack notification

Respond to webhook with result

3. Scheduled AI Content Generation

Schedule (every Monday 8am)

HTTP Request (fetch this week's news/articles)

AI Agent (summarise into newsletter format)
    ├── Chat Model: GPT-4 or Claude
    └── Memory: Window Buffer

Send via Email (Gmail / SMTP)

Post to Slack

4. Home Automation Bridge

Webhook (from Home Assistant)

Switch (based on event type)
    ├── Motion detected → Send Telegram notification + log to Sheets
    ├── Door opened → Send push notification + trigger camera recording
    └── Temperature alert → Adjust thermostat + send email

5. Lead Processing Pipeline

Webhook (from website form)

AI Agent (enrich & score the lead)
    ├── Chat Model: Claude
    └── Tools: HTTP Request (lookup company), Calculator (score)

Switch (based on lead score)
    ├── Hot lead → Create CRM record + notify sales team in Slack
    ├── Warm lead → Add to email sequence
    └── Cold lead → Log for analytics

Best Practices

Workflow Design

PracticeWhyHow
Start simple, add complexity graduallyEasier to debugBuild core flow first, add branches/conditions after
Use the Test Workflow buttonVerify each step worksClick “Test step” on each node to see input/output
Add error handlingPrevent silent failuresConnect an Error Trigger node to notify you on failure
Name your nodesReadabilityClick the node name and give it a descriptive name
Use Set/Edit Fields nodesClean dataDon’t pass messy data between nodes — explicitly set what you need
Avoid overly long workflowsMaintainabilityBreak into sub-workflows using the Execute Workflow node

Security

PracticeWhy
Set N8N_ENCRYPTION_KEY before first runProtects all stored credentials
Enable basic auth or put behind a reverse proxyPrevents unauthenticated access
Use environment variables for secretsDon’t hardcode API keys in workflows
Restrict webhook URLsDon’t expose sensitive workflows to the public internet
Regular backups of n8n_data volumeIncludes workflows, credentials, and execution history
Keep n8n updatedSecurity patches and new features

Performance

PracticeWhy
Use PostgreSQL for productionSQLite is fine for testing but doesn’t scale
Enable execution pruningOld execution logs consume disk space
Batch API calls where possibleFewer executions = faster workflows
Use the Loop node sparinglyEach iteration is an execution step — can be slow
Set execution timeoutsPrevent runaway workflows from consuming resources

Backup Strategy

# Backup n8n data volume
docker run --rm -v n8n_data:/data -v $(pwd):/backup \
  alpine tar czf /backup/n8n-backup-$(date +%Y%m%d).tar.gz -C /data .

# Backup PostgreSQL
docker exec n8n-postgres pg_dump -U n8n n8n > n8n-db-backup-$(date +%Y%m%d).sql

Your 30-Day n8n Learning Plan

Week 1: Basics

DayTaskOutput
1Deploy n8n locally (Docker quick start)Running instance at localhost:5678
2Complete the n8n beginner courseFirst workflow built
3Build a simple workflow: Schedule trigger → HTTP Request → Set fields → Send emailWorking notification workflow
4Learn expressions — use {{$json.field}} to pass data between nodesUnderstanding of data flow
5Explore the workflow templates — import 3 templates3 working workflows from templates
6Add error handling to your workflows (Error Trigger node)Self-healing workflows
7Deploy n8n to a VPS with Docker Compose + Traefik SSLProduction instance running

Week 2: Intermediate

DayTaskOutput
8Build a webhook-triggered workflow (receive data, process, respond)API workflow
9Use the IF node for branching logicConditional workflow
10Use the Loop node to process multiple itemsBatch processing workflow
11Integrate with an external API (Slack, Gmail, Google Sheets)Real integration workflow
12Write custom JavaScript in a Code nodeCustom data transformation
13Set up PostgreSQL as the databaseProduction database config
14Add cron-scheduled workflows for recurring tasksAutomated daily reports

Week 3: AI Workflows

DayTaskOutput
15Connect an LLM (OpenAI or Anthropic) to n8nFirst AI-powered workflow
16Build a simple chatbot using AI Agent + MemoryChatbot workflow
17Add tools to your AI agent (Calculator, HTTP Request)Agent with tools
18Build a RAG workflow with vector store + embeddingsDocument Q&A workflow
19Connect Ollama for local LLM inferencePrivate AI workflow (no API costs!)
20Build an email triage agent (read, classify, route)AI automation in production
21Add structured output parsing to force JSON from LLMReliable AI output

Week 4: Production

DayTaskOutput
22Set up monitoring and alerts for failed workflowsSelf-healing system
23Configure execution pruning and data retentionClean, maintainable instance
24Build a sub-workflow using Execute Workflow nodeModular workflow architecture
25Set up backup strategy (automated daily backups)Backup script running
26Build a real production workflow for your businessOne real automation live
27Optimise workflow performance (batching, pruning)Efficient workflows
28Document your workflows and create a runbookDocumentation
29Explore the n8n community forum for advanced patternsCommunity knowledge
30Plan your next 5 workflowsAutomation roadmap

Learning Resources

Official Resources

ResourceLinkWhat You’ll Learn
n8n Docsdocs.n8n.ioComplete reference — nodes, config, deployment
n8n Learning Pathsdocs.n8n.io/learning-pathsInteractive courses with hands-on exercises
n8n Workflow Templatesn8n.io/workflows1,000+ pre-built workflows you can import
n8n Community Forumcommunity.n8n.ioQ&A, tutorials, advanced patterns
n8n YouTubeyoutube.com/@n8n-ioOfficial tutorials and deep dives
n8n GitHubgithub.com/n8n-io/n8nSource code, issues, contributing

YouTube Courses

CourseLengthBest For
”Master n8n in 2 Hours”2 hoursComplete beginner crash course
”n8n Tutorial – Zero to Hero” by Marconi4 hoursComprehensive deep dive
”Self-hosted automation for EVERYTHING!“30 minQuick overview + deployment
”Agentic RAG, Open LLMs, FREE Embeddings”45 minAI agent workflows

Key Documentation Pages

PageWhat It Covers
Build your first workflowStep-by-step workflow creation
Integrate AIAI agent and LLM integration
Use Docker ComposeProduction deployment guide
Environment variablesAll configuration options
Community Edition featuresWhat’s in the free tier

n8n Vocabulary Glossary

TermDefinition
WorkflowA series of connected nodes that automate a task
NodeA single step in a workflow (trigger, action, transform, logic, or code)
TriggerThe first node that starts a workflow (schedule, webhook, polling, manual)
ItemA single JSON object that flows through the workflow
ExecutionOne complete run of a workflow from start to finish
ExpressionDynamic value using {{ }} syntax to reference data from other nodes
ConnectionThe link between two nodes that passes items
CredentialStored authentication info for an external service (API key, OAuth, etc.)
Sub-workflowA workflow called by another workflow using the Execute Workflow node
PinFix data on a node for testing — pinned data won’t change between test runs
Fair Coden8n’s license — source is open, self-hosting is free, but commercial redistribution requires a license
Queue modeRunning multiple n8n instances with a shared database for scaling (Business/Enterprise)

Final Thoughts

n8n is the most powerful workflow automation tool available for self-hosters and technical users. It hits a unique sweet spot: visual enough for rapid prototyping, powerful enough for production systems, and flexible enough to handle anything from simple notifications to autonomous AI agents.

The combination of n8n + a local LLM (Ollama) + your self-hosted infrastructure is arguably the most cost-effective and privacy-respecting automation stack available today. Zero per-execution costs, zero API costs for AI, and full control over your data.

Start with the Docker quick start, build a few simple workflows, and work your way up to AI agents. The platform rewards curiosity — every workflow you build teaches you something new about what’s possible.


This guide was compiled from n8n official documentation, community resources, and current deployment practices as of July 2026. n8n version at time of writing: stable 2.29.8. Last updated: July 2026.