n8n Queue Mode: Scaling with Redis and Workers
Scale n8n queue mode with Redis and worker processes: architecture, concurrency, webhook processors, binary data storage and how to size workers.
Executive Summary: A single n8n process handles the editor, triggers, webhooks and every execution. That works until one heavy workflow slows everything else. Queue mode splits the work: the main instance receives triggers, Redis holds a queue of executions and a pool of workers runs them. This article explains how n8n queue mode works, how to size workers and concurrency, when to add webhook processors and the operational details that decide whether scaling actually helps.
Every self-hosted n8n instance reaches a point where one process is not enough. The signs are familiar. The editor feels sluggish during busy hours. A large file workflow delays unrelated webhooks. Scheduled jobs start late because something else is holding the event loop.
Adding CPU to the server helps for a while. However, the real limit is architectural: one Node.js process doing everything. n8n queue mode removes that limit by separating the work that receives events from the work that runs them.
This article builds on the single-server setup in self-hosting n8n with Docker and PostgreSQL. Everything there still applies; queue mode adds Redis and more n8n processes on top.
How n8n Queue Mode Works
In regular mode, the process that receives a webhook also executes the workflow. In n8n queue mode, those responsibilities split across three roles, as the queue mode documentation describes:
- The main instance handles timers, triggers and the editor. When an event arrives, it creates an execution but does not run it.
- Redis holds the queue. The main instance pushes the execution ID, and the next free worker picks it up.
- Workers load the workflow from PostgreSQL, run it, write results back and report completion through Redis.
The key detail is that only IDs pass through Redis. The workflow definition and execution data live in PostgreSQL, which every process shares. That is why queue mode requires PostgreSQL and does not support SQLite.
What changes for webhooks
Webhook requests still arrive at the main instance, or at dedicated webhook processors. The execution then moves to a worker. This adds a small amount of latency, because the job has to pass through the queue first. For most workflows, the trade is worth it, since the receiving process stays free to accept the next request.
The Configuration
Every process in the cluster needs the same core settings. Missing one is the most common cause of a cluster that starts but does not work.
| Variable | Set on | Purpose |
|---|---|---|
EXECUTIONS_MODE=queue |
Main, workers, webhook processors | Turns on queue mode |
QUEUE_BULL_REDIS_HOST and _PORT |
All | Points to Redis |
QUEUE_BULL_REDIS_PASSWORD |
All | Authenticates to Redis |
N8N_ENCRYPTION_KEY |
All | Decrypts shared credentials |
DB_POSTGRESDB_* |
All | Connects to the shared database |
QUEUE_HEALTH_CHECK_ACTIVE=true |
Workers | Exposes health and readiness endpoints |
The encryption key deserves emphasis. Workers decrypt credentials stored by the main instance, so every process must use the same key. A worker with a different key starts normally, then fails on the first workflow that uses a credential.
In Docker Compose, a worker is the same n8n image started with the worker command:
n8n-worker:
image: n8nio/n8n:${N8N_VERSION}
command: worker --concurrency=10
restart: unless-stopped
environment:
EXECUTIONS_MODE: queue
QUEUE_BULL_REDIS_HOST: redis
QUEUE_BULL_REDIS_PASSWORD: ${REDIS_PASSWORD}
QUEUE_HEALTH_CHECK_ACTIVE: "true"
N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_DATABASE: n8n
DB_POSTGRESDB_USER: ${POSTGRES_USER}
DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
N8N_RUNNERS_MODE: external
N8N_RUNNERS_BROKER_LISTEN_ADDRESS: 0.0.0.0
N8N_RUNNERS_AUTH_TOKEN: ${RUNNERS_TOKEN}
depends_on:
- redis
- postgres
Note the task runner settings. In queue mode, each worker needs its own runners sidecar, because Code nodes run where the execution runs. Forgetting the sidecar on workers is an easy mistake when you copy the main instance’s configuration.
Sizing Workers and Concurrency
Each worker runs several executions at once. The default concurrency is 10, and you can change it with the --concurrency flag. Total capacity is roughly workers multiplied by concurrency.
The right concurrency depends on what your workflows do, not on a formula:
- I/O-heavy workflows, such as API calls and database queries, spend most of their time waiting. Higher concurrency works well, because the process is idle during waits.
- CPU-heavy workflows, such as large transformations and Code node loops, compete for the same core. Lower concurrency and more workers work better.
- Memory-heavy workflows, such as large files and big JSON payloads, risk running a worker out of memory. Keep concurrency low and give these workers more memory.
Avoid very low values, though. n8n recommends a concurrency of 5 or higher, because many workers with low concurrency can exhaust the database connection pool. In practice, start with the default, measure memory and queue depth under real load, then adjust. That approach mirrors general guidance in my article on autoscaling backend systems: measure the bottleneck before you add capacity.
Separating workloads
When one class of workflow behaves very differently, consider giving it separate infrastructure. For example, my DevOps alerting workflows are small and latency sensitive. A deploy notification or an error alert should never wait behind a long content job. In a larger cluster, the clean answer is a separate n8n instance for heavy batch work, so alerts always find a free worker.
Webhook Processors
For webhook-heavy setups, n8n can run dedicated webhook processors. These are n8n processes started with the webhook command. They accept incoming webhook requests and push executions to the queue, leaving the main instance free for the editor and triggers.
Your load balancer routes /webhook/ paths to the webhook processors and everything else to the main instance. You can then set N8N_DISABLE_PRODUCTION_MAIN_PROCESS=true on the main instance, so it no longer handles production webhooks itself.
Webhook processors make sense when webhook volume is high or spiky. For a few thousand webhooks a day, the main instance usually copes, and the added routing is not worth the complexity.
Binary Data in Queue Mode
Binary data needs special attention. In regular mode, n8n can keep files on the local filesystem. In n8n queue mode, a file written by one process may be needed by another on a different machine, so local storage breaks.
By default, queue mode stores binary data in the database. That works, but large files inflate the database and its backups. On licensed plans, external storage such as S3 moves files out of the database entirely. If your workflows handle many large files, plan for this before you scale, not after the database doubles in size.
Operating the Cluster
A cluster has more moving parts, so it needs more deliberate operations. A few habits keep it predictable.
- Health checks. Use the worker
/healthz/readinessendpoint, which checks database and Redis connections, not just whether the process is alive. - Graceful shutdown. Workers wait for running jobs before exiting, up to
N8N_GRACEFUL_SHUTDOWN_TIMEOUT, which defaults to 30 seconds. Raise it if your workflows run longer, or deploys will cut jobs off. - Redis persistence. If Redis restarts without persistence, queued jobs that were not yet picked up are lost. Enable Redis persistence or use a managed Redis.
- Metrics. Watch queue depth over time. A growing queue means workers cannot keep up, and it is the clearest signal to add capacity.
- Upgrades. Upgrade every process to the same version together. Mixed versions in one cluster cause subtle failures.
Redis plays a narrow role here, closer to a job queue than an event log. If you are curious how this compares with heavier brokers, my comparison of Kafka and RabbitMQ covers the trade-offs between queues and streams.
A Migration Path from a Single Instance
Moving an existing instance to n8n queue mode does not require a rebuild. If you already run PostgreSQL with an explicit encryption key, most of the work is adding services. A careful path looks like this.
- Add Redis with a password and persistence, on the same private network as n8n.
- Start one worker with the shared settings and its own runners sidecar, while the main instance still runs in regular mode. The worker stays idle, which lets you confirm it connects cleanly.
- Switch the main instance to
EXECUTIONS_MODE=queueduring a quiet window, then watch the first executions land on the worker. - Add workers one at a time, checking memory and database connections after each.
- Add webhook processors only if webhook volume justifies them.
Rolling back is just as simple. Set the main instance back to regular mode and stop the workers. Because all state lives in PostgreSQL, no data moves in either direction.
Before the switch, also review long-running workflows. Waits longer than about a minute are stored in the database and resumed later, so they survive the change. Still, any execution running at the moment you restart the main instance will be interrupted, which is why a quiet window matters.
When You Do Not Need Queue Mode
Queue mode is not a badge of maturity. A single well-configured instance handles a surprising amount of work, especially when most workflows are short API calls. Signs you need queue mode include sustained high execution volume, heavy workflows that block others and a need for zero-downtime deploys.
If none of those apply, invest in pruning, monitoring and error alerting first. Those improve reliability at any scale, while queue mode adds Redis, more processes and more ways for configuration to drift.
Frequently Asked Questions
What is the default worker concurrency in n8n queue mode?
Each worker runs up to 10 executions at once by default. You can change this with the --concurrency flag when starting the worker.
Does n8n queue mode work with SQLite?
No. Queue mode needs a database every process can share, and n8n does not support SQLite for distributed setups. Use PostgreSQL.
Do manual executions run on workers?
Only if you ask. The OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS setting is off by default, so manual runs from the editor execute on the main instance. In that case, the main instance also needs a task runner sidecar. The documentation recommends turning offloading on for production.
Scale the Bottleneck, Not the Diagram
n8n queue mode is a clean, well-documented way to scale self-hosted n8n. Share the encryption key, give every worker its runners, size concurrency to your workload and plan binary storage early. Above all, measure first. The goal is a faster, steadier instance, not a more impressive architecture diagram.
Last updated on 29 November 2026