mirror of
https://github.com/Dokploy/templates.git
synced 2026-07-16 03:15:23 +02:00
n8n running in queue mode (EXECUTIONS_MODE=queue): main instance for the editor/webhooks, a scalable pool of workers (deploy.replicas driven by the N8N_WORKER_REPLICAS env var), Redis (Bull) as the queue broker and PostgreSQL as the database. Pinned to the current stable n8nio/n8n:2.30.4. Closes #455 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1.5 KiB
1.5 KiB
n8n Queue Mode
This template runs n8n in queue mode:
- n8n (main): serves the editor UI and receives webhooks/triggers, then publishes executions to the queue.
- n8n-worker (x2 by default): pulls executions from the Redis (Bull) queue and runs them.
- redis: the message broker for the queue (password protected).
- postgres: stores workflows, credentials and execution data.
All n8n containers share the same N8N_ENCRYPTION_KEY (generated automatically), which is required for workers to decrypt credentials.
Scaling workers
Worker replicas are controlled by the N8N_WORKER_REPLICAS environment variable (default 2):
- Open the compose service in Dokploy and go to the Environment tab.
- Change
N8N_WORKER_REPLICASto the number of workers you want. - Redeploy. Docker Compose will scale the
n8n-workerservice to the requested number of replicas.
Each worker runs up to 10 concurrent executions by default. You can tune this by adding N8N_CONCURRENCY_PRODUCTION_LIMIT to the worker environment.
Optional: dedicated webhook processors
For very high webhook volumes, n8n supports dedicated webhook processor instances (command: webhook). To use them, add another service to the compose file with the same environment as n8n-worker but with command: webhook, and route the /webhook/ path of your domain to it. See the n8n queue mode docs for details.