Why n8n worker concurrency decides whether PostgreSQL holds up
Worker concurrency and worker count multiply together, and the product sets how many workflow executions can reach PostgreSQL at the same moment. In queue mode, the main instance handles triggers and webhooks and passes each execution through Redis to a pool of workers. Those workers read and write workflow data in PostgreSQL, so every worker and every concurrency slot draws on the same database. Adding a worker or raising its concurrency adds processing capacity, but it also adds open connections, queries and writes against a database that the main instance and any webhook processors depend on too. A worker can be idle from the queue's point of view and still hold database connections, so the database side has to be sized alongside the n8n side.
Teams usually need to tune this after queue mode is in production and execution volume has grown. The usual triggers are executions waiting longer in the queue, connection counts that climb during busy periods, or a plan to add workers or webhook processors. Before changing anything, confirm the default concurrency value and any recommended minimum in the n8n documentation for the exact version you run, and do not carry values over from older guides. Then record the worker count, the concurrency value on each worker and the number of processes that connect to PostgreSQL, including the main instance and webhook processors. That total is the figure to compare with the connection limit PostgreSQL is configured to accept.
Pool exhaustion usually shows up first as executions that start slowly, fail while waiting for a database connection, or leave connection errors in the n8n logs during peak runs. Check PostgreSQL's connection limit and current usage during those peaks, then decide which lever to pull: lower concurrency on some workers, add a connection pooler such as PgBouncer, or reduce the number of processes that connect directly. Agree the change with whoever owns the database, test it under a load that matches your production workflows, and keep the results with the configuration so the next tuning round starts from evidence.
How executions move from the main instance to workers and PostgreSQL
The diagram starts at the main instance, which receives triggers and webhooks and hands each execution to Redis. A pool of workers picks executions up from Redis and reads and writes workflow data in PostgreSQL. The concurrency flag applies to each worker, so the total number of database connections grows with the number of workers. An optional connection pooler can sit between the workers and PostgreSQL to cap that count. Check the connection total against the pool size before you raise either setting.
Executions flow from intake through Redis to workers, which share PostgreSQL through an optional pooler.
Concurrency flag and worker count options and when each fits
This table compares five ways to add execution capacity to an n8n queue mode setup and what each one does to PostgreSQL connections and worker memory. Read each row by asking where the extra parallel work lands: inside one worker, across more workers, in front of the database, or in the database itself. Confirm the default and recommended concurrency values in the current queue mode documents before you quote them to your team.
| Option | What it changes | Connection and memory cost | When it fits |
|---|---|---|---|
| Raise concurrency on a few workers | Each worker runs more executions at once, so fewer workers handle the same load | Each running execution holds database work, so connections and memory per worker rise with the flag | Few workers with spare CPU and memory, and workflows that mostly wait on external calls |
| Add more workers at lower concurrency | Parallel work spreads across more processes or containers, each with its own concurrency setting | Total connections grow with worker count multiplied by the pool each worker opens, plus memory for each process | Steady growth in execution volume, where you can scale out and PostgreSQL has connection headroom |
| Add a connection pooler such as PgBouncer | Workers connect to the pooler, which reuses a smaller set of server connections to PostgreSQL | Adds one more component to run, monitor and patch, but server connections stay fixed as workers grow | Many workers or webhook processors approaching the PostgreSQL connection limit, after compatibility is confirmed for your n8n version |
| Raise the PostgreSQL connection limit | Lets the database accept more client connections without an additional component | Each PostgreSQL connection uses server memory, so the limit must match the RAM available to the database | Small deployments with a few workers, where a pooler adds more operations than it saves |
| Split workloads across dedicated worker pools | Long or heavy workflows run on their own workers, so short jobs do not wait behind them | Each pool adds its own connections and deployment, so total connections and operational work both rise | Mixed workloads where one type of execution slows down everything else on shared workers |
How worker count and concurrency multiply database connections
Total database demand is the number of processes multiplied by what each one runs. In n8n queue mode, the main instance handles triggers and webhooks and hands executions through Redis to workers, and each worker reads and writes workflow data in PostgreSQL. Every worker process runs up to its configured concurrency, and each running execution needs database work. The main instance and any webhook processors add their own connection pools on top of that. Before you change any single flag, write down every process that talks to the database, how many workers you run, and the concurrency and pool size each one uses. That list is the real demand figure, and it is rarely the number you had in mind when you added the last worker.
The problem is easy to miss because it grows one step at a time. Adding a worker feels like a small change, since the new process looks just like the old ones and its pool seems modest. Each addition, though, brings a fresh set of connections with it, and nobody re-adds the total after each change. A pool that looks small on its own can exceed the limit once several processes each claim their share. The same reasoning applies to concurrency: raising the concurrency on a worker that already runs fine multiplies the connections that worker opens, even if the process itself has spare memory and CPU.
Confirm the pool settings and server limits in your own environment before you scale. The exact pool configuration, the maximum connection count your PostgreSQL server accepts, and any connection reserved for administration or other applications sharing the same server all vary by deployment. Ask your team to read the current values from the running containers or configuration files, then compare the sum of all pools against the server limit with headroom left for maintenance and monitoring. If you connect through a pooler such as PgBouncer, confirm how it multiplexes client connections before assuming the total on the server side matches the sum on the n8n side.
Signs that the PostgreSQL connection pool is exhausted
Pool exhaustion rarely announces itself as a database error. It shows up first as slow or stuck executions, then as errors in worker logs and writes that lag behind. The cards below list the symptoms to check in order, with where to look for each.
Executions waiting or stalling in queue
When workers cannot get a database connection, they hold jobs without finishing them, so the queue grows while workers look idle. Check the executions list for runs stuck in a running or waiting state, and compare the queue backlog against the number of workers and their concurrency values. A backlog that grows while CPU stays low points at the pool, not at the workflows.
Connection errors or timeouts in worker logs
Workers log failures when they cannot acquire, or keep, a connection to PostgreSQL. Search the worker logs for timeout and connection refused messages, and note whether they cluster at the same times as bursts of executions. Errors that appear only when many workers run together are a strong sign that the combined connection demand exceeds what PostgreSQL will accept.
Rising latency without worker CPU saturation
Execution duration increases while worker CPU and memory stay moderate, because the time is spent waiting for connections rather than computing. Compare execution duration trends against worker resource graphs over the same window. If the workers are not the constraint, review the database connection settings before adding more workers.
Failed or delayed database writes
Execution results, status changes and logs are written to PostgreSQL, so a starved pool delays or drops those writes. Look for executions that finish in the workers but show incomplete or missing status in the editor or API, and for write errors in the logs. Writes that lag behind execution completion are an early warning that the pool is saturated.
Main instance responsiveness dropping
The main instance also needs database connections to serve the editor, the API and triggers. When the pool is saturated, the editor loads slowly, webhook responses time out and manual executions take longer to start. Check main instance response times and its database error messages at the same time as worker symptoms.
Many idle or waiting client connections
On the PostgreSQL side, a large number of connections that are idle or waiting on locks indicates that clients are holding connections they do not use, or that they queue behind each other. Query the connection activity view in PostgreSQL to count connections by state and by client application, and compare the total with the maximum connection setting. Confirm the current settings with your DBA before changing them.
PostgreSQL HA docsSizing n8n worker concurrency against PostgreSQL limits
This sequence turns the concurrency setting on each n8n worker into a number the PostgreSQL server can actually serve. It produces a written connection budget, a pooler decision and load test evidence that the active connection count stays under an agreed ceiling at peak.
Record the PostgreSQL version and connection ceiling
The platform team records the PostgreSQL major version in use and the server's connection limit, using a query such as
SHOW max_connections;run by a database administrator. Check the version against the PostgreSQL versioning policy, since some majors are near end of support and an upgrade may change the plan. Note how many connections are reserved for administrators and monitoring, because those are not available to n8n. Done when the version, the configured limit and the reserved count are written in the sizing record.Count main, webhook and worker processes
The team lists every n8n process that will hold database connections: the main instance, any webhook processors, and each worker, with the host or container it runs on. Queue mode sends triggers and webhooks through the main instance, and workers read and write workflow data in PostgreSQL, so each of these processes counts. Include any second environment or staging instance that shares the same database server. Done when the inventory lists every process by role and host and no process is counted twice.
Agree the target concurrency per worker
The team chooses a concurrency value for each worker process, set with the concurrency flag on the worker command, and records it beside the worker's host. Confirm the default value and the recommended range for the n8n version in use in the queue mode documentation before choosing, because those figures change between releases. Workers with heavier workflows may need a lower value than workers handling light jobs. Done when every worker has a written, signed-off concurrency value.
Calculate worst-case connection demand
Multiply each process's concurrency and database pool size to estimate the most connections it could open at once, then add the main instance, webhook processors and any other clients. Confirm with n8n's documentation how many connections a single running execution holds, because this varies by version and configuration. Compare the total with the ceiling from the first step, minus reserved connections, and keep a margin for maintenance sessions. Done when the worst-case total and the remaining headroom are written down and the total is below the ceiling.
Decide whether a connection pooler is needed
If the worst-case total leaves little headroom, or many short-lived processes will reconnect often, the team evaluates a pooler such as PgBouncer to hold a smaller set of server connections and share them. Confirm which pooling mode n8n supports and whether any session features it uses are affected before adopting one. Record the decision and the reason, including the option of lowering concurrency instead. Done when the team has either a configured pooler plan or a written decision that none is needed.
Apply settings to each worker with the shared key
The team applies the agreed concurrency and database pool settings to each worker, and runs the same n8n version on every process. Queue mode requires the main instance's encryption key on all workers and webhook processors so they can read stored credentials, so the team copies that key to each one through a secrets store and does not change it per host. Done when each worker starts cleanly, logs a successful database connection, and decrypts a test credential.
Load test while watching database and queue metrics
The team runs a load test that matches the expected peak mix of webhook and scheduled executions, while watching active connections, waiting connections, database latency and queue depth in Redis. Illustrative check: if active connections climb toward the ceiling and queued executions keep growing, the concurrency or pool size is too high for the database or too low for the load. Repeat the test after each change. Done when active connections stay below the agreed ceiling at peak and the queue drains after the load ends.
Matching concurrency to the execution profile
Many short webhook-driven executions finish quickly, so each worker takes a database connection for a brief moment and then releases it. The pool turns over fast, and the main constraint is usually the number of connection checkouts arriving at the same moment. The length of any single run matters less in this profile.
- Connection hold time: Each execution touches the database for setup, status updates and result saves in short bursts. Holds are brief but frequent.
- Tuning direction: Raise concurrency on each worker in small steps and stop when database wait times begin to climb. Adding workers usually helps only when the workers themselves are the limit.
- Pool sizing: Confirm that the total connections from all workers and the main instance stay under the PostgreSQL server limit, with headroom for administrative sessions.
- Before and after measurements: Record webhook response time, execution throughput, active connection count and wait events during a replayed peak.
Validate any change by replaying a representative webhook burst built from your own workflows, not a generic load script.
Long-running executions, such as large data syncs or workflows that wait on slow external systems, keep a worker slot and its database activity busy for minutes. Hold time dominates in this profile. A small number of long runs can occupy every available slot, and short executions then wait in the queue behind them even when the database itself has capacity.
- Connection hold time: A single run can pin a slot for its full duration, so the pool shows fewer free connections for longer periods.
- Tuning direction: Lower per-worker concurrency so that long runs cannot consume every slot on a worker. Keep total pool size in view, because each additional worker also draws from the same pool.
- Workload separation: Consider dedicated workers for long jobs so that quick executions keep moving. Confirm how your queue routes jobs to workers before relying on this pattern.
- Before and after measurements: Track queue length in Redis, the age of the oldest queued execution, and how long each long run holds its connection.
- Pooling layer: If the database is the limit, review whether a connection pooler such as PgBouncer fits your setup and test its behavior with your transaction patterns.
Validate the change with a long-running workflow from your own environment, and compare queue age before and after the adjustment.
Mixed workloads combine steady webhook traffic with scheduled batch runs. The batches create predictable bursts at fixed times, and their hold times vary by job. Tuning for the average load usually leaves the pool undersized during the busiest minute, so the peak window should set the target.
- Burst alignment: Many schedules that start at the same time, such as on the hour, create simultaneous connection demand from workers.
- Schedule staggering: Spread start times across the window so that the peak drops without changing the work each job does.
- Peak-based sizing: Measure the busiest minute during a real scheduled window and size concurrency and pool capacity against that figure.
- Exhaustion signals: Watch for connection timeouts, slow executions and PostgreSQL errors about too many clients in n8n and database logs. Confirm the exact error text in your own logs.
Before changing settings, capture one full cycle of the schedule and one webhook peak, then repeat the same captures after the change. Compare them to confirm the change helped the peak window, not only the average.
Operational risks when workers share one database
Every n8n worker, webhook processor and the main instance opens connections to the same PostgreSQL database, so one setting or one database event can affect the whole fleet. The cards below cover the risks that most often turn a reasonable concurrency setting into missed or stalled executions, and the control to put in place for each.
One setting copied across hosts
Teams often copy a worker command or container definition to new hosts without checking that the host sizes, CPU and memory limits, or the number of workers per host still match the database pool budget. A host with more workers than the others can exhaust connections that the rest of the fleet depends on. Control: calculate the total connection budget per host and per fleet, and record the concurrency value and worker count in version control with the host profile they belong to.
Changes made without a load test
Raising the concurrency flag or adding workers changes how many executions run at once, and so how many database queries run at once. The effect depends on your workflows, not on n8n's defaults, so a value that looks safe on paper can fail under real traffic. Control: run a load test with production-like workflows and a realistic webhook burst before changing the value in production, and keep the previous value ready as a rollback.
Queue mode docsEncryption key mismatch across processes
In queue mode the main instance's encryption key must be shared with every worker and webhook processor so they can read credentials from the database. Adding a worker with a different or missing key can cause credential failures that look like workflow errors, and rotating the key on one process only is a common cause of outages. Control: store the key in your secrets manager, inject it into every process from the same source, and check each new process before it receives traffic.
Queue mode docsMaintenance or failover during a full pool
When the database restarts for maintenance or fails over, every worker's open connections drop at the same moment, and a full pool can take time to recover while queued executions pile up. PostgreSQL does not detect a primary failure or switch roles by itself, so automatic failover depends on external tooling. Control: confirm how your tooling reconnects clients, plan maintenance windows that pause new executions, and test a failover with the worker fleet running.
PostgreSQL failover docsNo alerts on connection count
Pool exhaustion usually appears first as slow executions, timeouts or a growing queue, not as a clear error, so teams often learn of it from users. Without a metric for active connections against the configured limit, the first signal arrives late. Control: alert on connection count as a share of the limit and on queue depth, and review those alerts after each change to concurrency or worker count.
PostgreSQL nearing end of support
A database on an unsupported major version stops receiving fixes, and a concurrency tuning that works today may need revisiting after an upgrade changes planner or connection behavior. Upgrades also change the connection path during cutover. Control: check the supported versions list, schedule the upgrade well ahead of the end date, and repeat the load test on the new major version before moving the worker fleet.
- Supported to Nov 2026
- 14
Questions buyers ask about worker concurrency and pool sizing
Should we raise worker concurrency or add more workers first?
Neither change is safe until you know where the bottleneck sits. Each worker runs executions up to its concurrency setting, and every running execution reads and writes workflow data in PostgreSQL, so both settings multiply load on the database. Start by measuring queue depth, execution wait time, worker CPU and memory, and PostgreSQL connection counts under realistic load. If workers have spare capacity while the queue grows, per-worker concurrency is the likely constraint. If the database is busy or connections are near their limit, adding workers only moves the pressure onto PostgreSQL. Confirm the default concurrency value and the recommended minimum for your release in the n8n queue mode docs before you change anything.
Is a connection pooler like PgBouncer necessary for n8n?
Whether you need one depends on the number of connections your setup opens, so measure before deciding. Each main, worker and webhook processor holds connections to PostgreSQL, so total connections grow with the number of processes and the pool size of each. Adding workers multiplies that count. A pooler such as PgBouncer sits between n8n and PostgreSQL and caps the server-side connections, which keeps the count predictable as the fleet grows. Signs you may need one include connection errors at peak load, connection counts approaching the PostgreSQL limit, and many idle connections. A pooler adds its own configuration and monitoring, and its pooling mode must be tested against the n8n release you run. Ask any partner to show connection counts per process as part of the review.
What does tuning worker concurrency involve and what does it need from our team?
The work covers an inventory of main, worker and webhook processor instances, a baseline load test using representative workflows, a decision on concurrency per worker and worker count, a review of PostgreSQL connection limits and pool sizing, a pooler decision, monitoring and alerts for connection and queue health, and a written runbook for future changes. Your team needs to provide:
- Access to the n8n hosts, the PostgreSQL server and the monitoring stack
- A list of the workflows that matter most, including long-running ones
- A change window in staging and production
- An owner for the encryption key, which must be shared with every worker and webhook processor so they can read stored credentials
- A person who can approve database configuration changes
How long does tuning take, and what drives the duration?
The duration depends on the scope, so ask for it in writing rather than relying on a general estimate. The main drivers are the number of worker and webhook processor instances, the mix of short and long-running workflows, whether load testing and monitoring already exist, the PostgreSQL topology (a single server or a high availability setup), whether a pooler is already in place, and how many test and change cycles the environment needs. Access approvals and change windows often set the calendar more than the technical work does. n8n ships minor releases roughly weekly under semantic versioning, so a baseline measured on one release may need a quick recheck after a later update. Confirm in the written scope which environments are covered and how many retest rounds are included.
Can our own team tune n8n worker concurrency without a partner?
Yes, if the team already operates n8n queue mode and PostgreSQL and has a repeatable way to load test. The tuning itself is mostly disciplined measurement: change one variable at a time, run the same workload, and record queue depth, execution latency, worker resource use and connection counts. Teams often struggle when they change concurrency, worker count and pool size together, because the results cannot be attributed. Check that someone owns PostgreSQL configuration, that monitoring covers the database as well as the workers, and that a rollback path exists. A partner adds an outside review, a tested method and a handover document, which matters most when the team has no spare capacity for a multi-week change cycle. Decide which of these you need before you start.
What should a partner quote include for worker concurrency work?
A quote should follow from a written scope and list what is covered and what is excluded. Ask for the instances in scope, the environments (staging and production), the baseline and load test method, the PostgreSQL connection review and any pooler recommendation, the monitoring and alerts to be set up, the runbook, the retest after changes, the handover session, and any post-change support period. Also ask which assumptions the price depends on, such as access, the number of workflows tested and the number of worker instances. State whether Redis tuning, PostgreSQL major upgrades and multi-main high availability are included. Multi-main setup is limited to Enterprise self-hosted deployments, so confirm the license before it appears in the design. DeployOpen does not publish a price list, and a quote follows from the written scope.
Which settings change the ongoing cost of running n8n workers?
Recurring cost is mostly infrastructure and operations time. Concurrency and worker count drive CPU and memory use, so higher values usually mean larger hosts or more of them. Connection limits and pool size can force a larger PostgreSQL instance or a pooler that also needs care. Each worker needs the shared encryption key, so key handling adds operational work whenever workers are added or rotated. Costs that recur also include monitoring, alert tuning and keeping PostgreSQL within its support window. PostgreSQL 14 is supported until 12 November 2026, according to the PostgreSQL versioning policy, so plan that upgrade into the budget if you run it. Ask a partner to show which settings raise hardware or licensing costs and which ones only affect operations effort.
Limits to confirm in your environment before changing concurrency
Worker concurrency sits on top of several limits that live in other places: the n8n docs for your version, the database server, any managed database layer, the connection pooler and your license. Confirm each one before you change a flag, because a higher number of workers only helps if the database and the contract can carry it.
Concurrency default and minimum
Read the queue mode section of the n8n docs for the exact version you run, and note the default value of the --concurrency flag and the recommended minimum. Defaults and guidance can change between releases, so do not copy values from older blog posts or forum answers. Record the numbers next to the version string of every main, worker and webhook processor image so that a later upgrade does not silently change your baseline.
- Default concurrency
- 10
PostgreSQL max connections and reserved slots
Ask the database owner for the max_connections value and for the number of slots reserved for superusers and maintenance (superuser_reserved_connections). Subtract those reserved slots, the connections used by monitoring, backup jobs and administrators, and any other applications on the same server. The remainder is the budget that all of your workers and the main instance can share.
Managed database connection caps
If the database runs on a managed service, confirm whether the provider caps connections per instance or per plan, and whether that cap differs from the server setting you see in PostgreSQL. Some providers enforce a lower ceiling than the engine allows, so a configuration that works on a self-managed server can fail on a smaller managed tier. Ask the provider in writing for the limit that applies to your exact tier.
PgBouncer pooling mode and workload fit
If PgBouncer sits between n8n and PostgreSQL, confirm its pooling mode before you raise worker counts. Session pooling holds a server connection for the life of a client, while transaction pooling reuses it between transactions and needs the workload to avoid session-level features such as session settings, prepared statements and advisory locks. Test n8n's queue and execution writes under the chosen mode, because a mismatch shows up as intermittent errors rather than a clean failure.
PgBouncer docsMulti-main availability on your edition
Confirm whether your chosen edition supports multi-main high availability before you design the topology around it. n8n documents this setup as limited to Enterprise self-hosted deployments, so Community and n8n Cloud installations should plan on a single main instance. If you need it, ask n8n for written confirmation of the entitlement, and budget the extra main instances and their shared database settings into your connection math.
License terms for internal use
Confirm that your intended use fits the Sustainable Use License, which permits use for your own internal business purposes but not redistribution for commercial gain. Also check whether any .ee files are part of your deployment, since those need a valid Enterprise License. Have legal review the terms before you scale capacity for customers, partners or other external parties.
How DeployOpen scopes and delivers n8n worker concurrency tuning
DeployOpen treats worker concurrency as a sizing decision that spans n8n workers, the PostgreSQL connection budget and the workload itself. Each engagement starts from a written scope, measures the current setup in your environment, and delivers tuned settings with the evidence and runbook your operations team needs to keep them.
How we scope
- Inventory the n8n version, queue mode topology, worker count and the concurrency value set on each worker.
- Record the PostgreSQL version, max_connections, existing pooling and how many connections every n8n process opens.
- Agree in writing which workloads, environments and failure signals are in scope before work starts.
How we build
- Set the worker concurrency and worker count against a connection budget that leaves headroom for admin and backup tools.
- Decide with your team whether PgBouncer or another pooler sits between n8n and PostgreSQL, and configure it.
- Run load tests against your own representative workflows and check for pool waits, slow queries and queued executions.
How we hand over
- Deliver the final concurrency values, connection settings and the reasoning behind each number as written documentation.
- Document the log messages, database metrics and alert thresholds that show pool exhaustion or saturation early.
- Walk your platform and database teams through the runbook for changing worker count and concurrency safely.
How we support
- Fixed-scope engagements have agreed deliverables and timelines, so changes after go-live are scoped separately.
- Ongoing support, upgrades and retesting after n8n or PostgreSQL version changes are available as a retainer.
- Ask your DeployOpen contact to confirm which PostgreSQL and n8n versions the retest will cover before signing.

