n8n is the workflow automation tool developers reach for when Zapier gets expensive and Make feels like a black box. It is fair-code, self-hostable, connects to 400-plus services, and since the LangChain-powered AI nodes landed it doubles as an AI agent builder. The Community Edition is free to self-host under the Sustainable Use License, with no execution limits, and the current release is 2.25.7 (June 10, 2026). A single Docker container gets you running in minutes. The work, as always, is production: queue mode for scale, surviving upgrades without breaking webhooks, and backing up the right things. This guide covers the install, an AI agent workflow, and the problems people actually hit, plus how n8n stacks up against Make and Zapier.
Key takeaways
- Quick start is one container:
docker runthe image, map port5678, mount a volume, and set an encryption key. - For anything real, use Docker Compose with Postgres instead of the default SQLite, and add Redis when you move to queue mode.
- Pin your version. Do not run
:latestin production; n8n upgrades can break webhook workflows. Pin a tag and upgrade deliberately after testing. - Scale vertically first, then queue mode. Switch to
EXECUTIONS_MODE=queuewith Redis and worker containers when you approach ~80% CPU. - Back up the database and the encryption key. Without
N8N_ENCRYPTION_KEY, your stored credentials are unrecoverable. - The AI Agent node is a cluster node: attach sub-nodes for the chat model, memory, and tools. It works with OpenAI, Anthropic, or a local model via Ollama.
- n8n wins on cost at scale because self-hosting is flat-rate, while Zapier and Make bill per task or operation.
Install n8n with Docker (quick start)
The fastest way to try n8n is a single container. Set an encryption key up front so the credentials you create are portable, and mount a volume so nothing is lost on restart.
# Create a persistent volume and run n8n
docker volume create n8n_data
docker run -d --name n8n -p 5678:5678 \
-e N8N_ENCRYPTION_KEY="replace-with-a-long-random-string" \
-e GENERIC_TIMEZONE="America/Toronto" \
-v n8n_data:/home/node/.n8n \
docker.n8n.io/n8nio/n8n:2.25.7
# Open the editor
# http://localhost:5678
Note the pinned tag :2.25.7 rather than :latest. That single choice prevents a surprise upgrade from breaking live workflows, which is the most common self-hosting regret.
Production install with Docker Compose
For real use, run n8n against Postgres rather than the bundled SQLite, which struggles under concurrent executions. This Compose file wires n8n to Postgres; add Redis and workers when you reach the scaling section.
# docker-compose.yml
services:
postgres:
image: postgres:16
restart: always
environment:
POSTGRES_USER: n8n
POSTGRES_PASSWORD: change-me
POSTGRES_DB: n8n
volumes: ["pg_data:/var/lib/postgresql/data"]
n8n:
image: docker.n8n.io/n8nio/n8n:2.25.7
restart: always
ports: ["5678:5678"]
environment:
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_USER: n8n
DB_POSTGRESDB_PASSWORD: change-me
N8N_ENCRYPTION_KEY: replace-with-a-long-random-string
WEBHOOK_URL: https://n8n.example.com/
volumes: ["n8n_data:/home/node/.n8n"]
depends_on: ["postgres"]
volumes: { pg_data: {}, n8n_data: {} }
Build an AI agent workflow
n8n's AI features are built on LangChain. The AI Agent node is a root, or cluster, node: on its own it does nothing, but you attach sub-nodes to give it a brain and hands. Connect a Chat Model sub-node (OpenAI, Anthropic, or a local model), an optional Memory sub-node to carry context across turns, and one or more Tool sub-nodes the agent can call. Trigger the workflow from a webhook, a schedule, or a chat trigger, and the agent reasons over its tools to complete the task. For a fully private, no-API-cost setup, point the Chat Model at a local model served by Ollama, and if you outgrow single-agent workflows, compare the dedicated frameworks in my CrewAI guide.
1. Webhooks break after an upgrade
What you see: a workflow that worked yesterday stops firing after you pulled a new image, or webhook URLs return 404.
What it is: running :latest means an automatic, untested version jump. n8n moves fast, and breaking changes occasionally land that affect webhook registration or node behavior.
The fix: pin a specific version tag in your Compose file and upgrade on purpose. Read the release notes, bump the tag in staging, confirm your critical workflows still fire, then promote. Keep the previous tag handy so a rollback is one edit away.
2. Executions pile up and the instance is slow
What you see: workflows queue behind each other, the editor feels sluggish, and a busy webhook drops events under load.
What it is: by default n8n runs in "main" mode, executing everything in one process. That is fine for light use but does not parallelize.
The fix: switch to queue mode. Set EXECUTIONS_MODE=queue, add a Redis service as the message broker, and run one or more dedicated worker containers that pull jobs from the queue. The main instance handles the UI and webhooks while workers execute in parallel. A common trigger to make the move is sustained CPU around 80%. Scale by adding workers, and reach for an external broker like RabbitMQ only if you need more resilience than Redis provides.
3. You lost your workflows or credentials
What you see: after a container rebuild, workflows are gone, or restored credentials fail to decrypt.
What it is: two separate mistakes. Either the data volume was not persisted, or the N8N_ENCRYPTION_KEY changed, which makes every stored credential undecryptable.
The fix: persist the /home/node/.n8n volume, use Postgres and back up the database on a schedule, and store the N8N_ENCRYPTION_KEY somewhere safe and never let it change between deployments. Treat the key like a production secret, because losing it means re-entering every credential by hand.
4. Webhooks do not work behind a reverse proxy
What you see: webhooks work locally but external services cannot reach them, or the URLs n8n generates point at localhost.
What it is: n8n needs to know its public URL to register webhooks correctly.
The fix: set WEBHOOK_URL (and N8N_HOST) to your public HTTPS domain, terminate TLS at a reverse proxy such as Caddy or Nginx, and forward to port 5678. After changing these, re-save the affected workflows so the webhook URLs regenerate.
5. Self-hosting is not actually free
What you see: you moved off Zapier to save money, then spent weekends on Docker, SSL, backups, monitoring, and queue tuning.
What it is: the license is free; the operations are not. Hosting, patching, monitoring uptime, and tuning queue mode are real engineering time.
The fix: be honest about the trade. Self-hosting pays off when your task volume is high enough that per-task billing would dwarf the ops cost, or when data residency matters. For low volume, a managed plan can be cheaper once you price your own time. Right-size the decision rather than defaulting to self-host on principle.
6. The database fills up with execution data
What you see: over weeks of running, the database grows steadily, backups get slower, and disk usage creeps toward full on a busy instance.
What it is: by default n8n stores the full execution history, including the data that passed through every node. High-frequency workflows accumulate this fast, and nothing prunes it automatically unless you ask.
The fix: turn on execution pruning so old runs are cleared on a schedule. Set EXECUTIONS_DATA_PRUNE=true and a retention window with EXECUTIONS_DATA_MAX_AGE (in hours), and optionally cap the row count. For noisy workflows you do not need to audit, set them to save only on error rather than on success, which keeps the table lean.
# Environment for the n8n service
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=336 # keep 14 days of execution history (hours)
EXECUTIONS_DATA_PRUNE_MAX_COUNT=10000
Secure a self-hosted n8n instance
An n8n instance holds credentials to everything it automates, so treat it like production infrastructure, not a hobby container. A few essentials cover most of the risk:
- Use the built-in user management, not a single shared login. The legacy basic-auth approach is deprecated; create an owner account and invite users with roles instead.
- Always terminate TLS at a reverse proxy (Caddy or Nginx) and serve n8n only over HTTPS. Set
N8N_SECURE_COOKIE=trueso the session cookie is not sent over plain HTTP. - Limit what is public. Only the webhook endpoints need to be reachable from the internet; keep the editor behind a VPN, IP allowlist, or proxy auth if you can.
- Keep current. Track releases and apply security updates deliberately, on your pinned-version cadence.
Back up the right things
A working backup of n8n is three parts, and missing any one of them makes a restore fail. Back up the database (a scheduled pg_dump if you are on Postgres), the /home/node/.n8n volume, and most importantly the N8N_ENCRYPTION_KEY, stored separately in your secrets manager. The encryption key is the part people forget: without it, a restored database cannot decrypt any of your stored credentials, so you would have to re-enter every API key and connection by hand. Test a restore into a throwaway instance occasionally, because a backup you have never restored is a hope, not a plan.
n8n vs Make vs Zapier (2026)
All three automate workflows, but they bill and scale very differently, and only n8n is self-hostable.
| Tool | Hosting | Cost model | AI agents | Best for |
|---|---|---|---|---|
| n8n | Self-hosted or cloud | Flat (self-host) or per-execution | Native LangChain AI Agent nodes | High volume, data control, AI workflows, 400+ integrations |
| Make | Managed cloud only | Per-operation | Some AI modules | Visual builders who want zero ops |
| Zapier | Managed cloud only | Per-task (expensive at scale) | AI actions and agents | Simple, broad app coverage, non-technical users |
The pattern: Make and Zapier scale your bill linearly with usage, while self-hosted n8n scales vertically. More tasks mean a bigger server, not a bigger invoice. For data-heavy or high-frequency automation, that difference compounds fast.
Frequently asked questions
Is n8n free?
The n8n Community Edition is free to self-host under the Sustainable Use License, with no execution limits. Paid plans cover n8n Cloud (managed hosting) and the Enterprise edition (SSO, advanced permissions, scaling features). For most self-hosters the Community Edition is enough.
n8n vs Zapier: which is cheaper?
At low volume, Zapier's managed convenience can be cheaper once you price your own time. At high volume, self-hosted n8n is dramatically cheaper because it is flat-rate, while Zapier bills per task. The crossover comes when per-task fees exceed the cost of running and maintaining a server.
How do I scale n8n?
Scale vertically first by giving the instance more CPU and RAM. When you approach roughly 80% CPU, switch to queue mode: set EXECUTIONS_MODE=queue, add Redis as the broker, and run dedicated worker containers that execute jobs in parallel. Add workers to scale out further.
Why did my webhooks stop working after an upgrade?
You were likely running the :latest tag and an automatic version jump introduced a breaking change. Pin a specific version, read release notes before upgrading, test in staging, and keep the previous tag ready for rollback.
Can n8n run local LLMs?
Yes. Attach a Chat Model sub-node pointed at a local model served by Ollama to the AI Agent node. This gives you fully private, no-per-token-cost AI workflows. See the Ollama setup guide for running the model locally.
Resources
- n8n Self-Hosting Docs – official Docker and Compose guidance
- n8n on GitHub – source, releases, and the Sustainable Use License
- n8n Advanced AI docs – the AI Agent node and LangChain sub-nodes
- Ollama setup guide and CrewAI guide – pair n8n with local models and dedicated agent frameworks
Last updated: June 13, 2026.
Josh writes about AI agents, automation, and GEO, and runs nowservingto.com, a daily-fresh directory of Toronto's newest restaurants.
