Suitable: An n8n deployment with recurring job backlogs or execution contention that would benefit from separating workflow execution from the main process.
Not suitable by default: A stable single instance, or a slow workflow whose bottleneck is inside the workflow itself.
This guide is for developers already running n8n who need to decide whether to split the main process and workers.
It also helps small teams planning to run AI workflows alongside other automations.
Operators responsible for Docker Compose and server capacity can use the checks below to plan, verify, and roll back a migration.
Assess the reason for changing modes
Queue mode gives the main instance and workers different responsibilities: the main instance handles workflow activity, while workers process queued executions. Redis provides the queue connection. That division can help when executions compete for time on one instance, but it does not remove delays caused by a slow external API, inefficient workflow logic, or a constrained database. (n8n queue-mode documentation)
Use evidence from the current deployment before changing its architecture. Review queue or execution wait times, failed execution records, and CPU, memory, and disk trends over a representative operating period. Separate recurring backlog from a short burst. Then inspect individual slow runs: a queue can distribute work, but it cannot make a third-party service respond sooner or fix a workflow that spends most of its time waiting on that service.
| What the current deployment shows | Likely next action | Why queue mode may or may not help |
|---|---|---|
| Repeated execution backlog, while the main instance remains responsive | Evaluate queue mode and test a worker | Separating execution may reduce contention between incoming workflow activity and job processing. |
| One workflow is consistently slow, but other executions are not waiting | Profile that workflow first | Queue mode does not inherently speed up its logic, network calls, or data processing. |
| CPU or memory stays constrained, or the database is already under pressure | Identify the constrained component before adding workers | More execution processes can increase demand on shared services and the host. |
| No recurring backlog and no execution failures tied to contention | Keep the single-instance design and review it later | Extra Redis, worker, and recovery procedures add complexity without a demonstrated need. |
Make the decision conditional rather than treating queue mode as a routine upgrade:
- If executions regularly wait and monitoring points to execution contention, then test queue mode in a controlled deployment.
- If only one workflow is slow, then inspect its nodes, external dependencies, and data handling before splitting services.
- If the database, Redis connection, or host is already saturated, then address that constraint before increasing worker capacity.
- If the current instance meets its operating needs, then stay with the simpler deployment and preserve a migration plan for later.
Audit the existing deployment before migration
Record how the current n8n instance is built, not just what appears in its web interface. A working queue deployment depends on compatible configuration across its components, access to the same stored data, and a safe way to restore the prior state. When documenting how sensitive workflow data is handled, consult XFP Cloud’s data handling information as a separate reference; it does not replace your own backup and recovery plan.
Use this pre-migration checklist:
- [ ] Record the exact n8n image tag and deployment method. Check how the image will be pinned so the main instance, workers, and any task-runner components use compatible versions.
- [ ] Identify the database type, connection settings, and existing database service. The queue-mode documentation recommends PostgreSQL and states that SQLite is not supported for queue mode; verify the database requirements against the current n8n database configuration documentation.
- [ ] Locate the current n8n data directory and document how credentials and workflow records are stored.
- [ ] Securely record the encryption key and confirm how it will be supplied to every relevant n8n component. Do not generate separate keys for the main instance and workers.
- [ ] Check whether workflows create, read, or pass binary files. If they do, resolve the filesystem-storage compatibility issue using a supported design before migration.
- [ ] Confirm that Redis is reachable from the main instance and workers, and document the connection settings that each service will use.
- [ ] Review how task runners are configured, if they are part of the deployment. Apply the current task-runner configuration guidance rather than copying settings from an older Compose example.
- [ ] Prepare a recoverable database copy and a separate protected copy of configuration and secrets. A copy on the same host is not an off-host backup.
Version consistency means more than giving every container the same broad version family. Pin the image used by the main instance and workers to the same chosen release, then check task-runner compatibility against the official configuration for that deployment. Review the official queue-mode environment variables before carrying settings forward; an old variable name or incomplete shared configuration can leave a worker connected to a different environment than the main instance.
Map each service to its job
Plan the service boundaries before editing Compose. The point is not simply to add containers. Each component needs a clear role, correct network access, and a recovery path.
| Component | Responsibility | Configuration to verify |
|---|---|---|
| Main n8n instance | Receives workflow activity and provides the main application interface | Queue execution mode, database access, Redis access, encryption configuration, and required public URL settings |
| Worker | Takes queued executions and runs them | Matching n8n image version, shared database and Redis settings, encryption configuration, and worker-specific options |
| Redis | Holds queue data used by the main instance and workers | Reachability, authentication if configured, persistence and recovery approach, and connection settings |
| Database | Stores n8n application data shared by the n8n components | Supported database type, connection details, backups, and capacity under the expected workload |
| Task runner, when configured | Runs supported task-runner work according to the selected n8n setup | Compatible image version, connection settings, and the current official runner configuration |
A common operational trap is to scale workers while leaving the shared database and Redis out of capacity planning. Workers can make more execution work eligible to run at once, but they also create more activity against shared services. Start with a controlled worker deployment, then assess the whole path—queue, database, host, and workflow dependencies—rather than judging the change from worker status alone.
Build a Compose framework around shared settings
The following fragment shows the relationship between the main instance and a worker. It is a framework, not a complete copy-and-run deployment: it assumes Redis and the database are already available to the Compose network. Use the current n8n Docker Compose guide and queue-mode environment variable reference to confirm names and values for the n8n version being deployed.
x-n8n-common: &n8n-common
image: ${N8N_IMAGE}
environment:
EXECUTIONS_MODE: queue
QUEUE_BULL_REDIS_HOST: ${REDIS_HOST}
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: ${POSTGRES_HOST}
DB_POSTGRESDB_DATABASE: ${POSTGRES_DATABASE}
DB_POSTGRESDB_USER: ${POSTGRES_USER}
DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
services:
n8n-main:
<<: *n8n-common
command: start
# Publish the application and webhook endpoints as required.
# Keep public URL settings consistent with the deployment.
n8n-worker:
<<: *n8n-common
command: worker
# Add worker-specific options only after checking
# the documentation for the selected n8n release.
Set N8N_IMAGE to the same pinned image for both services. Provide the Redis and PostgreSQL hostnames and credentials through the deployment’s secret-handling method; do not commit live passwords or the encryption key to a public repository. Add the services to a network where the configured hostnames resolve. Keep public-facing routing on the main application service unless the deployment’s verified routing design requires otherwise.
This fragment deliberately does not set a worker count or concurrency value. Those choices depend on the workflow mix and observed resource use. n8n documents concurrency controls separately, so review the current concurrency-control guidance before changing them. A higher setting is not a substitute for measuring database, Redis, memory, and CPU pressure.
Do not assume that every environment variable belongs on every service. Start from the official queue-mode configuration, compare it with the existing deployment, and classify each setting as shared, main-specific, worker-specific, or task-runner-specific. Keep the main instance and worker aligned where the queue design requires shared values; avoid adding variables simply because they appeared in an old example.
Start the deployment and verify execution
Bring up the supporting database and Redis using the planned configuration, then start the main instance and worker. Read logs before sending production traffic. A healthy container status only confirms that a process started; it does not prove that the worker can consume jobs or that the workflow’s data is available to every component.
Run the checks in this order:
- [ ] Confirm Redis connectivity. Check service logs and connection settings for both the main instance and worker. Resolve hostname, authentication, or network errors before testing workflows.
- [ ] Inspect the main instance. Confirm it starts with queue execution mode and connects to the intended database and Redis service.
- [ ] Inspect worker registration and logs. Look for evidence that the worker starts with the expected n8n image and shared configuration. If it stays idle, check its connection settings before changing resource limits.
- [ ] Run a repeatable test workflow. Use a controlled workflow whose expected output is easy to recognize. Confirm it is accepted, processed, and recorded correctly.
- [ ] Check the n8n interface and execution records. Compare the visible status with the worker and main-instance logs. A mismatch is a reason to pause rollout and investigate, not to declare success based on a single green status.
- [ ] Test binary-data workflows separately. If file handling is part of the deployment, validate the selected supported storage design. A text-only test does not demonstrate that binary data is safe in queue mode.
- [ ] Retain the prior deployment until the new path is verified. Avoid removing the former configuration or its recovery materials while the queue-based deployment is still under evaluation.
When a job remains queued, first check that the worker is running, that it can reach Redis and the database, and that shared settings such as the encryption key are aligned. Then inspect the relevant logs and the workflow’s data dependencies. Increasing resources before confirming these basics can make troubleshooting harder without fixing a configuration mismatch.
Observe load and prepare the rollback
Keep the initial rollout small enough to observe. Record queue depth or waiting executions, time spent waiting, execution failures, CPU and memory trends, disk use, and database and Redis health. Compare those observations with the same workload before migration. The point is to identify persistent change, not to treat one brief burst as proof that the system needs more workers.
If work is accumulating while workers are healthy and host and database capacity remain available, test an additional worker or adjust concurrency in a controlled way. If resource pressure rises, return to the previous setting and identify which component is constrained. More workers can increase parallel execution, but they can also increase demand on the shared database, Redis, and host. For serial workflows or work dominated by external waits, adding workers may not resolve the cause.
Before rollout, write down the rollback sequence:
- Preserve the database and the exact configuration and secrets needed to restore the former deployment.
- Keep the n8n encryption key protected and available to the authorized recovery process.
- Define when new workflow activity will stop during rollback and how in-flight or queued work will be checked.
- Confirm database and execution-state consistency before switching back. Do not assume that reverting container settings alone reverses every change made during operation.
- After any n8n release change, repeat the checks for configuration names, task runners, binary storage, and queue processing.
The acceptance criterion should be actual workflow records: the test job is processed, the expected result is present, and the interface and logs agree. “The containers started” is not an adequate migration test.
Common questions about n8n queue deployments
What services does a queue deployment need?
A queue deployment needs a main n8n instance, workers, Redis, and a supported shared database. The main instance handles workflow activity; workers execute queued jobs. Add task runners only when required by the chosen configuration. Keep relevant n8n components aligned on version and shared settings, and validate the design against the current official documentation before rollout.
How do the main instance and workers connect?
The main instance and workers use the same Redis queue and database, and they must share the encryption configuration needed to read stored credentials. In Compose, attach them to a network where the Redis and database hostnames resolve. A worker can appear to be running while still failing to consume jobs if its connection settings do not match.
Can queue mode use filesystem binary data storage?
Do not assume filesystem binary storage is compatible with queue mode. n8n documents a restriction for this storage approach. Identify workflows that create or pass binary files, then select a storage design supported by the current documentation. Test file workflows directly; a successful text-only execution will not expose a binary-storage problem.
When should a single instance move to queue mode?
Consider queue mode when executions repeatedly wait and monitoring indicates that separating execution from the main process could help. First rule out slow workflow logic, external service delays, and database pressure. If the current single instance remains stable and meets its operating needs, keep the simpler design rather than adding Redis, workers, and more recovery steps without evidence.
Match the deployment to measured server needs
Queue mode is a deployment change, not a guarantee of faster individual workflows. The choice to move from a shared VPS or cloud instance to an exclusive physical server should follow the measurements: recurring CPU or memory contention, limited control over disk or operating-system choices, or a need for a dedicated machine may justify comparing options. A light workload, a short-lived test, or a job dominated by external waits may not.
After the queue test and monitoring period, compare your recorded requirements with the actual configurations and supported systems listed on the XFP Cloud server options page. If predictable execution capacity and long-running self-hosted services matter more than elastic short-term use, an exclusive AMD physical server may be a better fit than a shared instance. Check the current options against the needs of the main process, workers, Redis, and database before deciding; do not infer a fixed configuration from the queue-mode design alone.
Questions
What services does an n8n queue deployment need?
A queue deployment needs an n8n main instance, one or more workers, Redis for the queue, and a supported shared database. The main instance accepts workflow activity; workers execute queued jobs. Add task runners only according to the task-runner configuration you have chosen. Keep the n8n components aligned on version and shared settings, and check the current official documentation before deployment.
How do the n8n main process and workers connect?
The main instance and workers use the same Redis queue and database, and they must share the encryption configuration required to read stored credentials. In Compose, place them on a network where they can resolve the Redis and database service names. A worker that starts successfully but has mismatched connection settings may not consume the jobs you expect.
Can queue mode use filesystem binary data storage?
Do not assume filesystem binary storage will work in queue mode. n8n documents a compatibility restriction for this storage approach. Before migration, identify whether workflows create or pass binary files, then choose a storage design supported by the current n8n documentation. Test file-producing workflows specifically; ordinary text-only executions will not reveal this storage issue.
When should a single n8n instance move to queue mode?
Consider migration when execution jobs repeatedly wait behind other work and monitoring shows that separating execution from the main process could help. First distinguish a persistent queue from a slow individual workflow, an external API delay, or a saturated database. If the single instance remains stable and jobs finish within their required window, queue mode may add operational complexity without solving a real problem.
Give Your Workers Dedicated Compute
Deploy your queue-mode services on an XFP Cloud physical server in Tokyo.
From $455 / month