// guides · n8n error index

n8n out of memory? 9 crash tests, and the setting to raise

Fix n8n JavaScript heap out of memory, Node ran out of memory and possible out-of-memory issue: which process died and what to change. 9 real runs.

Updated 2026-10-29 · about 10 minutes

Still stuck after these steps? Paste your exact n8n error and we'll reproduce it and email you the fix, free →

Steps

  1. How we tested, and what is real

    On 29 October 2026 we ran 9 real webhook executions on a self-hosted n8n 2.43.7 (SQLite, internal JavaScript task runner, Node 24) with the memory caps set low on purpose: NODE_OPTIONS=--max-old-space-size=512 for the main process and N8N_RUNNERS_MAX_OLD_SPACE_SIZE=256 for the task runner, then 2048 and 1024 for the fix runs. A local server sent a 134 MB JSON array (600,000 objects) and a 300 MB binary file. Every error text, status code and log line below is what n8n really printed.

  2. First, find out which process ran out of memory

    n8n runs Code nodes in a separate task runner with its own memory cap. When the runner died, the log line started with [runner:js]: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory, and n8n itself stayed up. When the main process died, the same FATAL ERROR came with [n8n start] in the stack and the whole instance went down: editor, webhooks and every other workflow. The process that died tells you which setting to raise (step 6).

  3. "Node ran out of memory" on a Code node

    Our Code node building 3 million items failed with Node ran out of memory and the hint This usually happens when there are too many items to process., naming N8N_RUNNERS_MAX_OLD_SPACE_SIZE. The webhook caller got HTTP 500 {"message":"Error in workflow"} after 0.8 s, and the server log added Webhook execution failed before a response was sent. The runner restarted by itself. A Code node returning 400,000 small items (200 characters each) under the same 256 MB cap worked, so it is the total data held at once that matters, not only the item count.

  4. "Workflow did not finish, possible out-of-memory issue"

    An HTTP Request node fetching the 134 MB JSON with the default JSON response under a 512 MB main heap killed the whole n8n process. The caller got no answer at all (connection dropped, curl showed HTTP 000), and n8n stayed down until we started it again: without a Docker restart policy or systemd nothing brings it back. After the restart the log said This could be due to a crash of an active workflow or a restart of n8n, and the execution was marked crashed with Workflow did not finish, possible out-of-memory issue on the HTTP Request node.

  5. Big downloads: use Response Format Text or File, not JSON

    Parsed JSON costs several times its size on disk. The same 134 MB file fetched with Response Format: Text worked under the 512 MB heap (one long string, not 600,000 objects). A 300 MB file fetched with Response Format: File worked in 0.9 s, because binary data is not kept as JavaScript objects. For big payloads, download as File, then read it in parts (Extract from File, Split Out) inside a sub-workflow that returns only a small result.

  6. Raise the right setting, and know it is not always enough

    Main process (whole instance down, possible out-of-memory issue): set NODE_OPTIONS=--max-old-space-size=2048 (MB). With that, the 134 MB JSON fetch worked (HTTP 200, 3.4 s). Code node ([runner:js], Node ran out of memory): set N8N_RUNNERS_MAX_OLD_SPACE_SIZE=1024; raising only NODE_OPTIONS does nothing for the runner. In docker-compose, both go under environment:. Keep the container memory limit above the heap you set, or the system kills the container first (we did not test that part). Even at 1024 MB our 3-million-item Code node still failed: more memory was not the fix there.

  7. The real fix: process less at once

    Split the work with Loop Over Items into batches, and put the heavy part in a sub-workflow (Execute Workflow) that returns only a few fields, so each batch is freed when it ends. Use pagination on the HTTP Request node instead of one huge call, and remove big fields you do not need with Edit Fields as early as you can.

All test results

9 real executions; some rows group a run with its log. Left: what we ran. Right: what n8n 2.43.7 did (all real).

TestResult
Code node builds 3,000,000 items, runner cap 256 MBNode error Node ran out of memory; caller HTTP 500 {"message":"Error in workflow"} in 0.8 s; n8n stays up
Same, runner log[runner:js] FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory; runner restarts by itself
Same, runner cap raised to 1024 MBStill fails (HTTP 500): needs batching
Same, only NODE_OPTIONS raisedNo change: the runner has its own cap
Code node returns 400,000 small items, runner cap 256 MBWorks (HTTP 200, 4 s)
HTTP Request, 134 MB JSON, Response Format JSON, main heap 512 MBWhole n8n process dies; caller gets no response (HTTP 000); editor and all workflows down
After restarting n8nExecution status crashed: Workflow did not finish, possible out-of-memory issue on the HTTP Request node
Same fetch, Response Format Text, 512 MBWorks
300 MB file, Response Format File, 512 MBWorks in 0.9 s
134 MB JSON fetch, main heap 2048 MBWorks (HTTP 200, 3.4 s)

Checklist

Good to know

What we did not test

Docker memory limits and the system OOM killer (exit code 137), queue mode workers, Postgres, n8n Cloud plan limits, the Python Code node, and the Loop Over Items plus sub-workflow fix end to end.

FAQ

What does "JavaScript heap out of memory" mean in n8n?

A Node.js process hit its memory cap. If the log line starts with [runner:js] it was the Code node task runner; otherwise it was the main n8n process, which takes the whole instance down.

How do I fix "Node ran out of memory" in n8n?

Process fewer items at once with Loop Over Items or a sub-workflow, and raise N8N_RUNNERS_MAX_OLD_SPACE_SIZE. In our test more memory alone did not fix a 3-million-item Code node.

What does "Workflow did not finish, possible out-of-memory issue" mean?

n8n crashed during the execution, usually from the main process running out of memory, and marked the run crashed after restarting. Raise NODE_OPTIONS=--max-old-space-size and avoid loading huge JSON at once.

Does NODE_OPTIONS max-old-space-size help the Code node?

No. The Code node runs in the task runner, which has its own cap set by N8N_RUNNERS_MAX_OLD_SPACE_SIZE.

How do I download a large file in n8n without running out of memory?

Set the HTTP Request Response Format to File. A 300 MB file worked under a 512 MB heap in our test, while a 134 MB JSON response crashed n8n.

Related guides

New guides

Still stuck on your n8n error?

Paste the exact error and say what the workflow should do. We reproduce it on a real n8n install and email you the fix or a working workflow, usually within 24h. Free while we're in beta.

We'll only email you about your error and TaskToAgent.