
To run n8n in production, run it in queue mode on PostgreSQL. A main instance takes webhooks and schedules and puts each execution on a Redis queue, and workers pick the executions up, run them and write the results to Postgres. n8n's production requirements say that "n8n recommends PostgreSQL for production" and that "n8n doesn't support SQLite in queue mode". On Kubernetes, n8n's own Helm chart runs the main instance, webhook processors and workers as three separate deployments, and the workers scale on Redis queue depth using KEDA, as n8n's AWS Terraform guide sets out.
Queue mode is included in the free Community edition, so the setup itself needs no license key. Running more than one main instance does, since n8n's edition comparison leaves multi-main mode out of the Community edition and it needs an Enterprise license. n8n's AWS guide adds that "n8n recommends self-hosting for expert users" and warns that "Mistakes can lead to data loss, security issues, and downtime."
The queue mode documentation sums the design up in one line: "a main instance receives triggers and webhooks, Redis queues the executions, and you scale by adding or removing workers." Each execution follows the same order. A webhook or a schedule fires, and the main instance generates the execution without running it. Redis queues the execution, and the next available worker picks it up. The worker reads the workflow from the database by its execution ID, runs it and writes the results to Postgres. It then tells Redis the execution has finished, and Redis notifies the main instance.
Every process in the setup runs with the same switch and the same key. Set EXECUTIONS_MODE to queue on the main instance and on every worker, and point each one at Redis with QUEUE_BULL_REDIS_HOST, QUEUE_BULL_REDIS_PORT and QUEUE_BULL_REDIS_PASSWORD. Left unset, n8n looks for Redis on localhost, port 6379, with no password (queue mode variables). The encryption key of the main instance "must be shared with all worker and webhooks processor nodes", because the workers need it to read the credentials stored in the database.
Each worker runs several executions at once. Its concurrency flag "defaults to 10", and n8n recommends 5 or higher, because "Setting low concurrency values with a large numbers of workers can exhaust your database's connection pool", as the queue mode documentation puts it. Size the Postgres connection limit for the number of workers you plan to run, and test it under the load you expect.
Redis holds the queue, so the way you run Redis decides how much queued work survives a failure. The production requirements state it outright: "If Redis loses queued jobs, n8n doesn't rebuild them from PostgreSQL. It marks the affected executions as crashed instead." They tell you to "Configure Redis persistence and availability to match how much lost work you can tolerate", and n8n's own AWS module runs Redis on ElastiCache, the managed service.
n8n uses SQLite by default (database settings), and does not support it in queue mode or recommend it for multi-user production use. Move to PostgreSQL before you switch queue mode on, on "a supported PostgreSQL version", since the main instance and every worker read and write the same database.
Every execution leaves a record in that database, and n8n warns that "Depending on your executions settings and volume, your n8n database can grow in size and run out of storage" (execution data). Pruning is on by default. It deletes executions older than 336 hours (14 days) and, once more than 10,000 are stored, the oldest first; EXECUTIONS_DATA_MAX_AGE and EXECUTIONS_DATA_PRUNE_MAX_COUNT change the two limits, and EXECUTIONS_DATA_SAVE_ON_SUCCESS set to none stops n8n saving successful runs at all. Set them to what your audit requirements need.
In queue mode, n8n stores binary data "in the database by default". To keep files out of Postgres, use S3 or Azure Blob Storage, which needs a license that includes external storage (the Community edition does not), or a shared volume that every main instance, worker and webhook processor mounts at the same path, as the queue mode documentation requires.
n8n's docs list guides for AWS, Azure, Google Kubernetes Engine and OpenShift as "Starting points for a Kubernetes setup" (server setups). The basic AWS guide runs no queue mode: "The example manifests define one instance of each pod", one n8n pod and one Postgres deployment, and "the Postgres deployment needs a persistent volume" to keep its data between pod restarts. The reference for queue mode is n8n's AWS Terraform module, an Amazon EKS cluster running n8n's Helm chart with managed PostgreSQL on RDS, Redis on ElastiCache and S3 for files. Inside the cluster the chart runs three separate deployments.
The main pods handle leader election, the editor UI and the REST API. Webhook processor pods handle inbound triggers; they are optional, they scale behind a load balancer, and n8n "doesn't recommend adding the main process to the load balancer pool". Worker pods run workflow executions and scale on Redis queue depth using KEDA. More than one main, for high availability, needs an Enterprise license and is not available on n8n Cloud.
| Main | Webhook processor | Worker | |
|---|---|---|---|
| Handle | leader election, the editor UI and the REST API | inbound triggers | workflow executions |
| Scale | More than one main, for high availability, needs an Enterprise license | behind a load balancer | on Redis queue depth using KEDA |
Give the worker pods probes that test the worker. With QUEUE_HEALTH_CHECK_ACTIVE set to true (it is false by default), each worker serves /healthz, which "returns whether the worker is up", and /healthz/readiness, which "returns whether worker's DB and Redis connections are ready". Point the liveness probe at the first and the readiness probe at the second, and set CPU and memory requests and limits on every worker pod.
Scale the workers on the queue, the signal n8n's own module uses. KEDA adds worker pods as executions wait in Redis and removes them as the queue empties. The same signal reaches Prometheus. The /metrics endpoint "is disabled by default" and is switched on with N8N_METRICS; queue metrics need N8N_METRICS_INCLUDE_QUEUE_METRICS set to true, and n8n exposes them "on the main instances" (Prometheus metrics). n8n_scaling_mode_queue_jobs_waiting reports the "Current number of enqueued jobs waiting for pickup in scaling mode", beside the active, completed and failed counts.
Queue mode adds two connections to protect, from every pod to Redis and to Postgres. Redis connections run without TLS until you set QUEUE_BULL_REDIS_TLS to true. For Postgres, DB_POSTGRESDB_SSL_CA names the certificate that validates the server, and DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED, true by default, rejects a connection that fails validation. Keep the encryption key and the Redis and database passwords in Kubernetes Secrets, out of the manifests, since the key is what lets n8n read the credentials stored in the database.
The queue metrics count how many executions wait, run and fail, which container CPU and memory cannot tell you. Alert a person when the waiting count keeps climbing or the failed count moves, and give every production workflow retries and an error workflow. Our guide on how to monitor AI agents in production covers the checks around the workflows themselves.
Ovidius is an official n8n Select Partner, and every instance we build or take over runs the setup above: the main process behind your sign-in, Redis queuing each run for the next available worker, workers added as volume grows on AWS, Google Cloud or your own servers, and Postgres for workflows and execution history, with retention and pruning you set (self-hosted n8n, set up for production volume). If your instance runs on SQLite or in a single process, we first move it to Postgres and queue mode. After launch, support covers alerts on failed executions, worker scaling and n8n upgrades, and your team keeps admin access and the documentation. How long each stage takes depends on the work, so we tell you before you commit.
Queue mode is how n8n runs at scale. A main instance receives triggers and webhooks, Redis queues the executions, and workers pick them up and run them, so you scale by adding or removing workers. Every process needs EXECUTIONS_MODE set to queue, the same Redis and the same encryption key, and n8n doesn't support SQLite in queue mode.
Yes. n8n's edition comparison lists queue mode as included in the Community edition, which runs without a license key. The Community edition leaves out multi-main mode, which runs more than one main instance for high availability and needs an Enterprise license, and external storage for binary data, such as S3.
Ten by default. A worker's concurrency flag sets how many jobs it runs in parallel, and n8n's queue mode documentation says it "defaults to 10" and recommends 5 or higher. Low concurrency across a large number of workers can exhaust the Postgres connection pool, so size the database's connection limit for the workers you plan to run.
They can be lost. n8n's production requirements say that if Redis loses queued jobs, n8n does not rebuild them from PostgreSQL and marks the affected executions as crashed. Configure Redis persistence and availability for how much lost work you can tolerate; n8n's own AWS module runs Redis on ElastiCache, the managed service.
No. Queue mode needs a main instance, Redis, PostgreSQL and workers that share one encryption key, and we run those workers on AWS, Google Cloud or your own servers. Kubernetes helps when workers must follow the queue. n8n's AWS Terraform module runs its Helm chart on Amazon EKS and scales worker pods on Redis queue depth using KEDA.
By default, n8n prunes finished executions older than 336 hours, which is 14 days, and deletes the oldest once more than 10,000 are stored, according to its execution data documentation. EXECUTIONS_DATA_MAX_AGE and EXECUTIONS_DATA_PRUNE_MAX_COUNT change those limits; set them to what your audit requirements need.
Moving n8n from one instance to queue mode?
Book a discovery call. A senior partner leads the first call, and you see the ranked findings on your instance before we change anything.