n8n Out of Memory (JavaScript Heap Out of Memory)
Workaround available n8n Cloud, self-hosted Updated October 21, 2026
Quick answer
n8n crashes with 'Execution stopped at this node (n8n may have run out of memory)' when a workflow loads too much data at once. Process items in batches, move heavy work into sub-workflows, and on self-hosted instances raise the Node.js heap limit.
Most likely fix: Process data in smaller batches.
Symptoms
Editor shows 'Execution stopped at this node (n8n may have run out of memory while executing it)', 'Problem running workflow', 'Connection Lost' or 503; self-hosted logs show 'Allocation failed - JavaScript heap out of memory'; the instance restarts.
Why it happens
- Large JSON datasets or binary files held in memory
- Memory-heavy Code or legacy Function nodes
- Manual executions, which keep an extra copy of data for the editor
- Many nodes or other workflows running concurrently
- Node.js heap limit lower than available RAM
How to fix it
Try these in order — the most common fix is first.
1. Process data in smaller batches
- Add a Loop Over Items (formerly Split in Batches) node before heavy steps
- Set a batch size such as 200 instead of processing thousands of items at once
2. Move heavy processing into a sub-workflow
- Create a sub-workflow that does the heavy processing
- Call it with the Execute Workflow node
- Return only a small result to the parent so memory is freed after each batch
3. Raise the Node.js heap limit (self-hosted)
- Set NODE_OPTIONS=--max-old-space-size=4096 (choose a value that fits your host RAM)
- Restart the container
- Make sure no wrapper start script overrides NODE_OPTIONS
4. Store binary data on disk, not in memory
- Set N8N_DEFAULT_BINARY_DATA_MODE=filesystem (or s3)
- In-memory binary mode was removed in n8n 2.0
5. Avoid manual runs and Code nodes for big data
- Test with a small sample, then run large jobs via the active workflow
- Replace Code nodes with built-in nodes where possible
- On n8n Cloud, upgrade to a larger plan for more memory
This guide also covers
- n8n out of memory
- n8n javascript heap out of memory
- n8n may have run out of memory
- n8n execution stopped at this node
Still not working?
If n8n keeps failing, you're not alone. See every n8n problem users report or the alternatives people switch to.
Other n8n errors
- n8n Webhook Not Registered (404 Error)
- n8n Webhook URL Shows localhost
- n8n Connection Lost Error
- n8n Executions Stuck in Queued / Starting Soon
- n8n Google OAuth redirect_uri_mismatch Error
- n8n Schedule Trigger Running at the Wrong Time
- n8n 'Cannot Read Properties of Undefined' Error
- n8n Workflows Broken After 2.0 Update
- n8n Cloud Workspace Offline (503 Error)