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. 1. Process data in smaller batches

    1. Add a Loop Over Items (formerly Split in Batches) node before heavy steps
    2. Set a batch size such as 200 instead of processing thousands of items at once
  2. 2. Move heavy processing into a sub-workflow

    1. Create a sub-workflow that does the heavy processing
    2. Call it with the Execute Workflow node
    3. Return only a small result to the parent so memory is freed after each batch
  3. 3. Raise the Node.js heap limit (self-hosted)

    1. Set NODE_OPTIONS=--max-old-space-size=4096 (choose a value that fits your host RAM)
    2. Restart the container
    3. Make sure no wrapper start script overrides NODE_OPTIONS
  4. 4. Store binary data on disk, not in memory

    1. Set N8N_DEFAULT_BINARY_DATA_MODE=filesystem (or s3)
    2. In-memory binary mode was removed in n8n 2.0
  5. 5. Avoid manual runs and Code nodes for big data

    1. Test with a small sample, then run large jobs via the active workflow
    2. Replace Code nodes with built-in nodes where possible
    3. 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