Set EXECUTIONS_MODE=queue on every n8n instance, add Redis as the broker and PostgreSQL as the shared database, then start workers with n8n worker. For heavy webhook traffic, add webhook processors with n8n webhook and route /webhook/* to them. In queue mode, “The main n8n instance handles timers and webhook calls, generating (but not running) a workflow execution.” Workers pick the executions up from Redis and run them (n8n queue mode, accessed 2026-11-02). The n8n facts below come from n8n’s documentation, which has moved from the old /hosting/scaling/queue-mode/ address.
The pieces and what each one runs
A queue-mode deployment has four kinds of process.
| Process | Start command | Handles |
|---|---|---|
| Main | n8n |
editor, timers, test webhooks, production webhooks unless disabled |
| Worker | n8n worker |
the workflow executions it pulls from Redis |
| Webhook processor | n8n webhook |
production calls to /webhook/* and /webhook-waiting/* |
| Redis and PostgreSQL | your own services | the job queue and the shared execution data |
From a source checkout, the commands are ./packages/cli/bin/n8n worker and ./packages/cli/bin/n8n webhook. n8n calls webhook processors “another layer of scaling in n8n.” Workers already take execution load off the main instance. Webhook processors also take the HTTP intake off it.
Environment variables for every instance
Each process needs the same mode, the same Redis and the same encryption key. “The encryption key of the main n8n instance must be shared with all worker and webhooks processor nodes.” Copy it from main before the first worker starts.
export EXECUTIONS_MODE=queue
export N8N_ENCRYPTION_KEY=MAIN_INSTANCE_ENCRYPTION_KEY
export QUEUE_BULL_REDIS_HOST=REDIS_HOST
export QUEUE_BULL_REDIS_PORT=6379
export QUEUE_BULL_REDIS_PASSWORD=REDIS_PASSWORD
export QUEUE_BULL_REDIS_DB=0
The Redis defaults are localhost, port 6379 and database 0, and n8n notes that “By default, Redis runs on localhost on port 6379 with no password.” Set a password before Redis listens on anything other than localhost. QUEUE_BULL_REDIS_USERNAME exists for Redis setups with users. QUEUE_BULL_REDIS_TIMEOUT_THRESHOLD defaults to 10000 ms.
Use PostgreSQL for the database. n8n says “Running n8n with execution mode set to queue with an SQLite database isn’t recommended.” All instances point at the same database.
On workers, QUEUE_HEALTH_CHECK_ACTIVE=true enables /healthz and /healthz/readiness, which your orchestrator can probe. N8N_GRACEFUL_SHUTDOWN_TIMEOUT defaults to 30 seconds. Raise it if your workflows run longer than that.
Routing webhooks to the processors
Put the webhook processors behind a load balancer and split traffic by path.
| Path | Send to |
|---|---|
/webhook/* |
webhook processor pool |
/webhook-waiting/* |
webhook processor pool |
/webhook-test/* |
main instance |
| everything else (editor, REST API) | main instance |
“n8n doesn’t recommend adding the main process to the load balancer pool.” Test URLs under /webhook-test/* must reach main. To stop main from handling production webhooks at all, set export N8N_DISABLE_PRODUCTION_MAIN_PROCESS=true on it.
Set N8N_WEBHOOK_URL (older name WEBHOOK_URL) to the load balancer’s public address. If the Webhook node still shows localhost or the wrong host, start with the production URL troubleshooting post.
Concurrency per worker and per instance
A worker runs 10 jobs in parallel by default. “You can define the number of jobs a worker can run in parallel by using the concurrency flag.”
n8n worker --concurrency=5
n8n recommends 5 or higher. It warns that “Setting low concurrency values with a large numbers of workers can exhaust your database’s connection pool.” Keep each worker at 5 or more and scale out by adding workers.
A second control caps production executions. “Concurrency control is disabled by default.” Turn it on with export N8N_CONCURRENCY_PRODUCTION_LIMIT=20 (n8n concurrency control, accessed 2026-11-02). Queue mode and regular mode use separate mechanisms, “but the environment variable N8N_CONCURRENCY_PRODUCTION_LIMIT controls both of them.” In queue mode, n8n “takes the limit from this variable if set to a value other than -1”, “falling back to the –concurrency flag or its default.”
The limit covers only “production executions: those started from a webhook or trigger.” Manual runs, sub-workflows, error workflows and CLI runs fall outside it. Executions waiting for a slot can’t be retried, per the same page.
What breaks in queue mode
The Simple Memory node for AI agents stops working. “If your n8n instance uses queue mode, this node doesn’t work in an active production workflow.” The reason n8n gives is that it “can’t guarantee that every call to Simple Memory will go to the same worker” (Simple Memory node). A WhatsApp agent built on it loses the conversation between messages. Move memory to an external store such as Postgres or Redis. The n8n AI agent tutorial shows where the memory node plugs in.
Binary data can’t live on local disk. “n8n doesn’t support queue mode with binary data storage in filesystem.” Configure S3 external storage before any workflow downloads WhatsApp media.
Multi-main is a separate setup, not a breakage, for self-hosted Enterprise. It needs N8N_MULTI_MAIN_SETUP_ENABLED=true, sticky sessions at the load balancer and the same n8n version on every instance.
The same logic applies to anything else that assumes one process. n8n doesn’t list other cases, so treat this as inference. A workflow that counts or caches in memory between executions will see a different worker on the next call. Keep that state in the database.
Webhook latency for WhatsApp
Meta asks webhook servers for a median latency under 250 ms, with fewer than 1% of responses above 1 second (Meta throughput page, accessed 2026-11-02). Webhook processors take HTTP intake off the main instance. n8n’s queue mode pages don’t describe how the Webhook node’s Respond setting interacts with the queue. Measure the response time Meta sees before you rely on it.
Meta retries any non-200 answer, and retries can arrive as duplicates (webhooks overview, accessed 2026-11-02). Deduplicate on the message ID as shown in the n8n idempotency post. If the workflow does heavy work per message, a queue between webhooks and workers describes the same split outside n8n.
Z-API Omni team