RAM Per Concurrent Workflow
n8n runs workflows as jobs that execute nodes, handle credentials, and pass data between steps. RAM usage rises when workflows process larger payloads, run more parallel steps, or keep results in memory while waiting on external systems. When you host n8n, the question becomes how much memory you need per concurrently running workflow so the instance stays responsive under load.
In practice, “RAM per workflow” is not a fixed number. Two workflows with the same node count can use very different memory depending on whether they download files, buffer API responses, or transform large JSON objects. A workflow that streams a small record set can stay near a low baseline, while another workflow that aggregates thousands of items into one in-memory structure can spike memory quickly.
To size correctly, you need a baseline for your n8n process and a measurement plan for your actual workflows. I have seen teams assume a single average and then hit out-of-memory kills after adding one “harmless” node that pulls large data. The fix usually starts with identifying which nodes create the biggest in-memory objects, then measuring memory during realistic concurrency.
Common Pain Points
People often treat concurrency as the only driver, but memory depends on payload size and node behavior. A workflow that runs concurrently with others can still use little memory if each run processes small inputs. Conversely, a single workflow can consume a lot of RAM if it loads a large file or builds a large array before writing output.
Another frequent mistake is ignoring the runtime model. n8n executes workflows in a Node.js process, and Node.js memory behavior includes garbage collection and heap limits. When memory pressure rises, garbage collection cycles can increase latency, and if the heap limit is reached the process can crash. This behavior can look like “random” instability unless you correlate it with workflow runs and payload sizes.
Supporting technologies also matter. If you use a queue mode with a separate worker process, memory can shift from the main web process to worker processes. If you store workflow executions or logs in an external database, the database client buffers and the serialization of execution data can add overhead. If you run n8n behind a reverse proxy with request buffering, large webhook payloads can temporarily increase memory usage before n8n even starts the workflow.
Finally, teams sometimes benchmark with synthetic inputs that do not match production. A test that uses 10 records per run will understate memory if production uses 10,000 records. Even the same API endpoint can return larger payloads when filters change, and the memory impact shows up only after those payloads hit the workflow.
How To Measure Memory
1) Establish A Baseline
Start by measuring memory with one workflow run at a time, using representative inputs. Record the resident set size (RSS) and the Node.js heap usage if you can access it. On Linux, tools like top or htop show RSS, while ps can capture snapshots. For Node.js heap, you can use Node inspector or runtime flags, but the exact method depends on how you start n8n.
Run the workflow end-to-end and capture peak memory, not just the average. Peaks often occur during data transformation nodes or when building arrays for later steps. In one internal-style exercise, a workflow that averaged 300 MB RSS still peaked near 900 MB when it aggregated items before a single “merge” step, which would have been missed by average-only monitoring.
Capture at least 5 runs per workflow to account for variability. If your n8n version is 1.x, behavior can change between minor releases, so note the version you tested. I once saw a team upgrade from n8n 1.20 to 1.22 and observe different peak timing, which made their old sizing assumptions drift.
2) Measure Concurrency Scaling
After baseline, run controlled concurrency tests. Increase the number of simultaneous workflow executions gradually and record peak RSS for the n8n process. Use a fixed workload shape: same payload sizes, same node paths, same external system response times. If you change payload sizes during the test, the results stop being comparable.
Plot peak memory versus concurrent runs. Many setups show near-linear growth at first, then a steeper curve when garbage collection cannot keep up or when multiple runs hit the same memory-heavy node at the same time. That “knee” point is where you should stop adding concurrency without more RAM.
Keep the test duration long enough for caches and connection pools to stabilize. A short test can undercount memory if the first run triggers module loading and credential decryption, then later runs reuse objects. A side observation: if you use Redis for caching or queueing, Redis client buffers can shift memory patterns, so watch both n8n and Redis during the test.
3) Account For Heap Limits
Node.js has a default heap size limit that depends on the Node version and platform. If you set environment variables to raise the heap limit, memory behavior changes, and the OS RSS can grow accordingly. For n8n, the common approach is to set Node options when starting the process, but the exact flag and default vary by deployment method.
Do not treat heap size as the whole story. RSS includes native memory, buffers, and overhead outside the JavaScript heap. A workflow that uses large buffers for file downloads can increase RSS even if the JS heap looks stable. That is why peak RSS monitoring matters more than heap-only metrics.
If you see crashes around the same time as peak memory, correlate with logs. n8n logs often show execution errors, while Node.js may log heap out-of-memory messages. When you find the pattern, you can decide whether to reduce payload sizes, change nodes to stream data, or add RAM.
4) Convert Measurements Into A Plan
Once you have peak RSS at concurrency levels, you can plan capacity with headroom. A practical rule is to size so that peak memory stays below a safety threshold, leaving room for spikes from webhooks, background jobs, and garbage collection. Many teams use 20% to 30% headroom, but the exact number should come from your test variability.
Separate web traffic from workflow execution if your architecture supports it. If you run n8n in a single process, web requests and workflow execution share memory. If you use worker separation, the worker process can be sized for concurrency while the web process stays lighter. This separation changes the “RAM per workflow” calculation because the measured process differs.
Document the workload assumptions: which workflows run concurrently, typical payload sizes, and external API response sizes. Without those assumptions, “RAM per concurrent workflow” becomes a vague number that fails the first time someone changes a filter or adds a node.
Educational Case Examples
Scenario A: CRM Sync With Small Records
A team runs two workflows: one pulls 200 customer records from a CRM API and writes them to a database, and another enriches 200 records with a second API call. Each run processes small JSON objects and does not download files. In a baseline test, one workflow peaks at about 350 MB RSS. When they run both workflows concurrently, peak RSS rises to about 520 MB, suggesting modest per-run overhead and limited buffering.
Scenario B: Document Processing With Large Payloads
A second team runs a workflow that downloads a PDF from a storage service, extracts text, then merges results into a large JSON array before posting to an internal endpoint. With one run, peak RSS reaches about 1.2 GB. When they run three concurrent executions, peak RSS climbs above 3 GB and the process becomes unstable, with long garbage collection pauses. Their fix was not only adding RAM, but also changing the workflow to avoid building one huge array in memory and to chunk processing so each run holds less data at once.
Checklist For Sizing
| Parameter | What To Measure | Why It Changes RAM | Decision Use |
|---|---|---|---|
| Peak RSS | Max memory during a run | Captures buffers and heap pressure | Set RAM with headroom |
| Concurrency Levels | Peak at 1, 2, 3, ... runs | Shows scaling knee point | Pick safe max concurrency |
| Payload Size | Records count, file sizes | Drives in-memory objects | Validate with production-like inputs |
| Queue Mode | Single process vs worker split | Moves memory between components | Size each process separately |
Step-by-step checklist for a sizing run:
- Pick 2 to 5 workflows that represent the heaviest concurrency mix you expect.
- Record payload sizes for those workflows from logs or sample runs.
- Measure peak RSS for each workflow at concurrency 1, then repeat 5 times.
- Run concurrency tests at 2, 3, 4, and stop before instability appears.
- Choose a max concurrency where peak RSS stays below your safety threshold.
- Re-test after workflow changes that affect payload size or node behavior.
Common Mistakes To Avoid
Underestimating payload size is the most common failure mode. A workflow that downloads attachments can change memory use by an order of magnitude when a file type changes. If you size based on average payloads, a small fraction of large payloads can trigger out-of-memory events.
Another mistake is measuring only one concurrency point. A single test at “expected load” misses the scaling knee where garbage collection pauses grow and peak memory jumps. You need a curve, not a point.
Teams also forget that n8n can run background tasks and handle webhooks while workflows execute. If you test only workflow execution in isolation, you may miss memory spikes from inbound requests. In one deployment, webhook payload buffering caused a noticeable RSS bump during traffic bursts, even though workflow runs were stable.
Finally, avoid copying a “RAM per workflow” number from someone else’s setup. Node choices, queue mode, database backends, and payload sizes differ. A number that works for one set of workflows can fail for another set because the memory-heavy nodes differ.
FAQ
How do I estimate RAM per concurrent workflow in n8n?
Measure peak RSS for your workflows at concurrency 1, then repeat at higher concurrency levels using production-like payload sizes. Use the measured curve to pick a safe max concurrency with headroom, rather than relying on a fixed per-workflow number.
Does n8n memory usage scale linearly with concurrent runs?
Many setups show near-linear growth at low concurrency, then a steeper increase near a scaling knee when garbage collection and buffering overhead rise. Your curve depends on payload size and which nodes build large in-memory structures.
What nodes tend to increase RAM the most?
Nodes that download or buffer large files, aggregate many items into one structure, or transform large JSON payloads often drive peak memory. The exact nodes depend on your workflow logic, so measure with your real inputs.
Should I size based on Node.js heap or total RSS?
Use peak RSS for capacity decisions because RSS includes native buffers and overhead outside the JavaScript heap. Heap-only metrics can miss memory spikes from file downloads and buffering.
How does queue mode affect RAM planning?
If you separate worker processes from the web process, memory usage shifts to the workers that execute workflows. You should measure and size each process type separately because “per concurrent workflow” applies to the worker that runs the jobs.
Author's Insight
n8n memory planning works best when you treat “RAM per concurrent workflow” as an empirical relationship tied to your payloads and node behavior. Node.js heap limits and garbage collection can change latency and peak usage, so peak RSS during realistic runs matters more than averages. When teams fail, it is usually because payload sizes or node paths changed after the sizing test, not because concurrency alone was miscalculated. A practical next step is to keep a small load test suite that you rerun after workflow edits, especially when adding nodes that fetch files or aggregate large datasets.
Key Takeaways
- RAM per concurrent workflow is not a universal constant; payload size and node behavior dominate peak memory.
- Measure peak RSS at multiple concurrency levels using production-like inputs to find the scaling knee.
- Size with headroom and account for webhook and background activity, not only workflow execution.
- Re-test after workflow changes that affect data volume, buffering, or aggregation patterns.