Scaling n8n with queue mode and Redis workers
A single n8n process runs every workflow in one place. That is fine until executions start queuing behind each other or one heavy workflow blocks the UI. Queue mode splits n8n into a main process and dedicated workers, coordinated by Redis. Here is when you need it and exactly how to set it up.
Do you actually need queue mode?
Most self-hosted instances do not. The default "regular" mode handles a surprising amount. Consider queue mode only when you see one of these:
- Executions visibly waiting while others run — throughput is capped by a single process.
- A long workflow (large HTTP loops, big data transforms) makes the editor sluggish for everyone.
- You want workers to restart or scale independently of the UI.
- You are past a few thousand executions a day.
If you are below that, spend your effort on a bigger single VPS and pruning instead — it is simpler and cheaper.
How queue mode is structured
Three roles replace the one process:
- main — serves the editor and REST API, receives webhooks, and pushes jobs onto the queue.
- worker — pulls jobs from Redis and actually executes workflows. Run one or many.
- Redis — the message broker holding the job queue.
All roles share the same Postgres database and the same N8N_ENCRYPTION_KEY. That last point trips people up: every worker must have the identical key or it cannot decrypt credentials.
The Compose file
services:
db:
image: postgres:16
restart: unless-stopped
environment: { POSTGRES_USER: n8n, POSTGRES_PASSWORD: ${DB_PASSWORD}, POSTGRES_DB: n8n }
volumes: [ "./pgdata:/var/lib/postgresql/data" ]
redis:
image: redis:7-alpine
restart: unless-stopped
n8n-main:
image: docker.n8n.io/n8nio/n8n:latest
restart: unless-stopped
depends_on: [ db, redis ]
ports: [ "127.0.0.1:5678:5678" ]
environment: &n8n-env
EXECUTIONS_MODE: queue
QUEUE_BULL_REDIS_HOST: redis
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: db
DB_POSTGRESDB_USER: n8n
DB_POSTGRESDB_PASSWORD: ${DB_PASSWORD}
DB_POSTGRESDB_DATABASE: n8n
N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
N8N_HOST: n8n.example.com
N8N_PROTOCOL: https
WEBHOOK_URL: https://n8n.example.com/
GENERIC_TIMEZONE: Europe/Berlin
volumes: [ "./n8n-data:/home/node/.n8n" ]
n8n-worker:
image: docker.n8n.io/n8nio/n8n:latest
restart: unless-stopped
depends_on: [ n8n-main ]
command: worker
environment:
<<: *n8n-env
N8N_CONCURRENCY: 10
volumes: [ "./n8n-data:/home/node/.n8n" ]
The YAML anchor (&n8n-env / *n8n-env) keeps the shared config in one place so main and worker never drift apart. The worker starts with command: worker.
Concurrency and RAM planning
N8N_CONCURRENCY is how many workflows one worker runs at once — default 10. Each concurrent execution holds data in memory, so this is the dial that most affects RAM. A rough rule: light workflows are fine at 10; data-heavy ones (large HTTP responses, file processing) may need concurrency lowered to 3-5 and more RAM per worker.
Scale out, not just up: two workers at concurrency 5 are more resilient than one at 10 — if a worker dies, the other keeps draining the queue.
Plan roughly 1.5-2 GB RAM for main + Redis + Postgres, then add per worker based on its concurrency and workflow weight. A busy queue-mode instance is a 4-8 GB machine, not a 1 GB one.
Adding more workers
docker compose up -d --scale n8n-worker=3
Redis distributes jobs across all workers automatically. Scale down the same way. Because workers are stateless (state is in Postgres and Redis), you can add and remove them freely.
Verifying it works
docker compose logs -f n8n-worker # "Worker started" and job pickups
docker compose exec redis redis-cli LLEN bull:jobs:wait # queue depth
Trigger several workflows at once; you should see them distributed across workers instead of running one at a time.
Queue mode needs real RAM
Main, Redis, Postgres and multiple workers add up fast. Inferno's higher-RAM NVMe plans handle a queue-mode cluster comfortably, from $3.49/mo entry and easy in-place upgrades.
What to do next
- Environment variables — every queue and concurrency setting explained.
- Best VPS for n8n — size the machine for your worker count.
- Monitoring — watch queue depth and worker health.
Author: Ivo Pärnaste — DevOps, Tallinn. Last tested: 2026-05-17 on n8n 1.62, Redis 7, Postgres 16, Ubuntu 22.04.