n8n concurrency, API quotas and queue pressure
Model a burst of executions against API quotas and worker limits and keep concurrent approvals consistent.
By Invicly Tech, , in n8n, AI Automation and Voice Agents. About 8 minutes to read.
In short
A burst of webhooks can start many executions at once and overrun an API quota or a database. n8n lets you cap production executions, and in queue mode each worker runs a set number of jobs in parallel. You also watch queue depth and age, and protect approvals from two runs changing the same record.
Think of it like this: It is like a shop with a few tills: more tills help, but if the supplier only ships ten boxes a minute, extra tills just make a longer wait.
Explained simply
Imagine two hundred people book appointments in the same minute. Each booking starts a workflow run. If all run at once, they may ask the calendar service for more than it allows, and it will start refusing. Then everything fails together.
Concurrency means how many things run at the same time. A concurrency limit puts a ceiling on it. Extra runs wait in line and start when others finish. They are slower, but they succeed.
In n8n you can set a limit for production executions. In queue mode, workers share the load, and each worker has its own number of jobs it runs in parallel. The right number comes from the weakest link, not from how big your server is. If an API allows ten calls a second, that is your ceiling.
Watch two numbers: how many jobs are waiting, and how long the oldest has waited. Finally, think about two people approving the same booking at once. Without a guard, both may write. A version check makes the second one stop.
Press Play on a diagram to walk through it one step at a time.
- 1Incoming burst
Many webhooks arrive together
- 2n8n concurrency limit
Caps running production executions; the rest wait
- 3Worker concurrency
Jobs a worker runs in parallel in queue mode
- 4Downstream API quota
Requests per minute the other service allows
- 5Database or calendar
Must stay consistent under parallel writes
- Server CPU only
- Average run time
- Total runs per day
- Queue depth
- Age of the oldest waiting job
- 429 rate from each API
- Failed runs per hour
In depth
The limit in regular mode
By default n8n does not limit concurrent production runs. You can turn it on with the N8N_CONCURRENCY_PRODUCTION_LIMIT setting. It applies to runs started by webhooks or triggers. Manual runs, sub-workflow runs and error workflows are not limited. Runs over the limit wait in a first-in, first-out queue, and queued runs cannot be retried until they start. When n8n restarts, it resumes queued runs up to the limit. Always check the current docs for details, because behaviour may change between versions.
- Off by default
- Applies to webhook and trigger runs
- Waiting runs start in order
- The editor shows active runs against the limit
Queue mode and worker concurrency
In queue mode the main instance puts jobs in Redis and workers pick them up. Each worker runs a number of jobs in parallel, which you can set when starting the worker. The docs list a default and recommend not going too low. Total capacity is roughly workers times concurrency. Adding a worker adds capacity, but it also adds pressure on the database and on any API your workflows call. Scale and limit together.
- 1Burst of webhooks
200 in one minute
- 2Main queues jobs
Stored in Redis
- 3Workers pull jobs
N workers, M jobs each
- 4API calls
Capped by quota
- 5Backlog drains
Watch queue age
Respecting API quotas
Do the sums. If a calendar API allows 600 requests a minute and each run makes 3 calls, you can start at most 200 runs a minute. A limit of 10 concurrent runs that each take 2 seconds starts around 300 runs a minute, so you are over quota and need a lower limit or a pause. Handle 429 responses with a wait and a retry. Where the API supports batching, batch. Also consider several credentials only if the provider's terms allow it.
- Quota divided by calls per run gives runs per minute
- Use Wait nodes or batching to slow down
- Honour Retry-After
- Leave headroom for other users of the same quota
Keeping concurrent approvals consistent
Two reviewers may click Approve on the same proposal. Without protection, both runs write to the calendar. Use a version number or a status check in the update, so only one succeeds and the other learns the proposal changed. This is called optimistic locking. A unique constraint on the booking's event ID gives a second layer of safety at the database.
Learn it in 4 short steps
About 45m each. Track them with a timer in your plan.
- 1Set production concurrency limits~45m
- 2Respect downstream API quotas~45m
- 3Watch queue depth and age~45m
- 4Lock or version concurrent approvals~45m
Key points
- In regular mode, concurrency control is off by default. The N8N_CONCURRENCY_PRODUCTION_LIMIT setting turns it on and queues the extra runs.
- The limit applies to production runs started by webhooks or triggers, not to manual runs.
- Set limits from the lowest quota in the chain, not from what the server can handle.
- Watch queue depth (how many waiting) and age (how long the oldest has waited). Age is the better alarm.
- Concurrent approvals need a lock or a version check so the second writer does not overwrite the first.
Key terms
Tap a card to flip it. 0/5 known
Examples
UPDATE booking_requests
SET status = 'approved', version = version + 1
WHERE id = $1
AND version = $2
AND status = 'proposed';
-- 0 rows updated means someone else got there first.Approve a request only if nobody else changed it first.
Model a burst against a quota
Scenario: 300 requests arrive in one minute. Each run makes 2 calls to an API limited to 240 calls a minute. Steps: compute calls needed (600), compare to quota (240), find the runs that fit (120 per minute). The backlog drains in 2.5 minutes if nothing else arrives. Evidence: your queue age peaks near that. Decision: set the limit so you stay under quota.
runs = 300; calls_per_run = 2; quota = 240
needed = runs * calls_per_run # 600
runs_per_min = quota / calls_per_run # 120
minutes_to_drain = runs / runs_per_min # 2.5Version-checked approval
Scenario: reviewers A and B both approve proposal 42. Steps: each update includes the version they saw. The first update changes status and bumps the version. The second matches zero rows and is told to reload. Evidence: one calendar write only. Use a test table and fake rows.
UPDATE proposals
SET status = 'approved', version = version + 1
WHERE id = 42 AND version = 3 AND status = 'proposed';
-- rows affected: 1 for the first approver, 0 for the secondQuick reference
- Regular mode: N8N_CONCURRENCY_PRODUCTION_LIMIT; off by default.
- Limit applies to webhook and trigger runs, not manual runs.
- Queue mode: capacity is about workers times per-worker concurrency.
- Set limits from the lowest API quota in the chain.
- Alert on queue age, not only CPU.
- Guard approvals with a version check or unique constraint.
Common mistakes
- Raising concurrency to clear a backlog and then hitting the API rate limit, which makes things worse.
- Alerting on CPU only, and missing that jobs have been waiting for twenty minutes.
- Two reviewers approving the same proposal and both writing to the calendar.
Quick quiz
Pick an answer to see if you're right and why.
Practice exercises
Try each one yourself first. Use the hint if you get stuck, then compare with the solution.
- Exercise 1easy
An API allows 300 calls a minute and each run uses 3. How many runs a minute fit?
- Exercise 2medium
Two workers each run 10 jobs at once and each job takes 6 seconds. Roughly how many jobs per minute can they finish?
- Exercise 3hard
Design the guard for concurrent approvals including the SQL, the user message for the loser and the database constraint.
Check yourself
Answer in your head, reveal, then be honest with yourself.
Feel confident about this topic?
Frequently asked questions
- Should I just add more workers?
- Only if the database and the APIs can take it. Otherwise you move the bottleneck and trigger rate limits.
- Do manual test runs count toward the limit?
- In regular mode, the production limit covers webhook and trigger runs, not manual runs.
- What is queue age?
- How long the oldest waiting job has been waiting. It shows the delay people feel.