Contents
- The Short Answer
- First, Confirm It Is Memory
- Cause 1: Too Many Items in One Execution
- Cause 2: Files Held in Memory
- Cause 3: A Memory-Heavy Code Node
- Cause 4: One Long Workflow Holding Everything
- Cause 5: Manual Runs and Overlapping Executions
- Cause 6: The Instance Is Simply Too Small
- How to Stop It Coming Back
- Sources
- FAQ
The Short Answer
"Execution stopped at this node (n8n may have run out of memory while executing it)" means the workflow execution needed more memory than your n8n instance had available, and the process handling it went down at that point. The n8n memory documentation gives the underlying reason: n8n does not restrict the amount of data each node can fetch and process.
You have two options, and the docs name both: increase the amount of memory available to n8n, or reduce the memory consumption. In practice:
- Process less per execution. The docs' own example: instead of fetching 10,000 rows with each execution, process 200.
- Move the heavy work into a sub-workflow that returns only a small result to the parent.
- Self-hosted with files: set
N8N_DEFAULT_BINARY_DATA_MODE=filesystemso binary data is written to disk instead of held in memory. - Add memory. A bigger server if you self-host, a larger plan on n8n Cloud.
Which of these applies depends on what filled the memory. There are six candidates.
First, Confirm It Is Memory
The message says "may have" because n8n is inferring. The execution stopped without a normal error, and running out of memory is the usual reason for that. Before you redesign anything, look for the other signs the n8n docs list:
| Where | What you see | What it suggests |
|---|---|---|
| Execution view | Execution stopped at this node (n8n may have run out of memory while executing it) | n8n's own warning for this situation |
| Editor | Problem running workflow, or Connection Lost | The instance became unavailable |
| Browser or proxy | 503 Service Temporarily Unavailable | The instance became unavailable |
| Server logs (self-hosted) | Allocation failed - JavaScript heap out of memory | The Node.js process hit its heap limit |
The docs add that on n8n Cloud, or when using n8n's Docker image, n8n restarts automatically after such an issue, while with npm you might need to restart it manually. So a sudden restart of the container around the time of the failure is another clue. On Docker you can check directly:
# Live memory use per container
docker stats
# n8n's log output around the failure
docker logs --tail 200 n8n
If the log shows the heap message, or memory use climbs to the container's limit just before the failure, you have confirmed it. If memory was nowhere near the limit, the stop had another cause, such as the container being restarted by a deploy or a health check, and the changes below will not help.
One more thing to hold on to: the node in the message is where the execution was when the process died. It is often the heaviest node, but the memory in use at that moment includes the data produced by every node that ran before it in the same execution.
Cause 1: Too Many Items in One Execution
First on the docs' list of typical causes is the amount of JSON data. A node that fetches every row of a table, every contact in a CRM or every page of an API puts the whole result in memory, and each later node adds its own output on top.
How to confirm it: open a recent successful execution of the same workflow and look at item counts. Thousands of items, or items with very large fields such as full documents or long transcripts, point here. If the failure appeared as the data grew over months, that fits too.
The fix: split the data processed into smaller chunks. How depends on where the data comes from:
- Ask the source for less. Add a filter, a date range or a limit to the node that fetches the data, so you only pull records that need work. Run more often with less each time.
- Drop fields early. If you need three fields out of forty, put an Edit Fields node directly after the fetch and keep only those. Every later node then carries a fraction of the data.
- Page deliberately. Process one page per execution and remember where you got to, not all pages in one run.
A Loop Over Items node on its own does not reduce what is already loaded. It controls how many items move through the following nodes at a time. If the node before the loop has already fetched a million rows, they are in memory. Pair the loop with the sub-workflow pattern in Cause 4 to get a real saving.
Cause 2: Files Held in Memory
Second on the list is the size of binary data: images, PDFs, audio, video, spreadsheets. The n8n docs on handling binary data state the default plainly: when handling binary data, n8n keeps the data in memory by default, and this can cause crashes when working with large files.
How to confirm it: the workflow downloads, converts or uploads files, and the failure happens on larger files or when several are processed in one run.
The fix on self-hosted n8n is one environment variable, which makes n8n save binary data to disk instead of using memory:
N8N_DEFAULT_BINARY_DATA_MODE=filesystem
In Docker Compose that goes under the n8n service's environment: list. Restart n8n afterwards. One condition from the docs for larger setups: in queue mode, n8n uses database by default, and if you choose filesystem there, every main instance, worker and webhook processor that handles binary data must be able to reach the same shared volume at the same path.
Storing files on disk does not help if the workflow then turns the file into text. Converting a file to a Base64 string inside a Code node, for example, puts the whole thing back into memory as JSON, and larger than it started. Pass files between nodes as binary data where the nodes support it.
On n8n Cloud you cannot change this setting. Process files one at a time, keep them small, and see the plan limits under Cause 6.
Cause 3: A Memory-Heavy Code Node
The docs single out one node type: the Code node, and the older Function node, can increase memory consumption significantly. Their advice under reducing consumption is short: avoid using the Code node where possible.
How to confirm it: the node named in the error is a Code node, or a Code node sits just before it and handles the full item list.
The fix: use built-in nodes for the routine work. Filtering, renaming and removing fields, sorting, removing duplicates, aggregating, and splitting lists all have dedicated nodes. Keep the Code node for logic that has no built-in equivalent, and when you do use it, give it less to hold:
- Trim the items before the Code node, not inside it.
- Return only the fields the next node needs.
- Avoid building large intermediate copies of the whole input.
Cause 4: One Long Workflow Holding Everything
The number of nodes in a workflow is on the docs' list as well. A long single workflow keeps each node's output for the life of the execution, so the total only grows as it runs.
How to confirm it: the workflow has many nodes, each passes a large item list to the next, and the failure tends to happen late in the run, not at the first heavy step.
The fix is the one the docs spend the most words on: split the workflow up into sub-workflows and ensure each sub-workflow returns a limited amount of data to its parent. The structure is:
- In the parent workflow, add a Loop Over Items node to split the items into smaller batches.
- Inside the loop, add an Execute Workflow node that starts the sub-workflow with one batch.
- In the sub-workflow, do the heavy lifting for that batch.
- End the sub-workflow with a node that outputs only a small result, such as a count or a list of IDs.
The docs explain why this works, since adding nodes to save memory seems backwards: the sub-workflow only holds the data for the current batch in memory, after which the memory is free again. Step 4 is the part people skip. If the sub-workflow hands its full output back, the parent accumulates everything again and you have gained nothing.
A community thread on this error shows the pattern applied to an AI workflow. An execution making multiple model and API calls kept dying when it reached the AI Agent node. Processing the data in batches, with the work split across separate steps, got it running again.
Cause 5: Manual Runs and Overlapping Executions
Two items on the docs' list are about circumstances, not the workflow's design.
Manual executions. The docs say manual executions increase memory consumption because n8n makes a copy of the data for the frontend. A workflow that survives in production can fail when you run it from the editor with the same data. The Cloud documentation adds that interacting with the editor while a heavy execution is running also uses memory and could push the instance over its limit.
How to confirm it: it fails when you select Execute workflow in the editor and succeeds when triggered by its schedule or webhook.
The fix: the docs' advice is to avoid manual executions when processing larger amounts of data. Test with a small sample. Add a temporary Limit node after the fetch, or pin a handful of items on it, and remove that before publishing.
Other workflows running at the same time. Memory is shared by the whole instance. An execution that fits when it runs alone can fail when it overlaps with others.
How to confirm it: in the executions list, check what else was running at the time of the failure.
The fix: stagger the schedules of your heavy workflows so they do not start at the same minute. On self-hosted n8n you can also cap how many production executions run at once. The concurrency documentation notes that in regular mode there is no limit by default:
N8N_CONCURRENCY_PRODUCTION_LIMIT=5
Executions over the limit wait in a queue and run in order as capacity frees up. The limit applies to production executions started by a webhook or trigger node, not to manual runs or sub-workflow executions.
Cause 6: The Instance Is Simply Too Small
Sometimes the workflow is reasonable and the instance is not big enough for it.
On n8n Cloud, memory is fixed by plan. The Cloud data management page lists the current figures:
| Plan | Memory |
|---|---|
| Trial | 640MiB RAM |
| Starter | 640MiB RAM |
| Pro-1 (10k executions) | 640MiB RAM |
| Pro-2 (50k executions) | 1280MiB RAM |
| Enterprise | 4096MiB RAM |
The same page notes that n8n itself consumes memory to run, on average around 180MiB for the software alone. On a 640MiB plan that leaves well under 500MiB for everything your executions hold at once. Plans change, so check the page for the current numbers. The docs' answer on Cloud is direct: you need to upgrade to a larger plan, or reduce what the workflow uses.
On self-hosted n8n there are two separate ceilings, and it matters which one you hit.
The first is the machine or container. If the server has 1 GB of RAM, or the container has a memory limit set, that is the cap. Increasing it means provisioning more memory, which the docs point out may cost more with your hosting provider.
The second is the Node.js heap. If the server log shows JavaScript heap out of memory, the n8n docs say it is often useful to allocate additional memory to the old memory section of the V8 JavaScript engine, with the V8 option --max-old-space-size=SIZE, set either through the CLI or through the NODE_OPTIONS environment variable. The size is in megabytes:
NODE_OPTIONS=--max-old-space-size=4096
This raises the limit Node.js allows itself. It does not create memory. Setting it to 4096 on a machine with 2 GB of RAM just moves the failure from Node.js to the operating system. Raise it only to a value the machine can actually provide, and leave room for everything else running there.
For what a properly sized self-hosted instance costs each month against Cloud, see our guide to the true cost of self-hosting n8n.
How to Stop It Coming Back
Design for the data you will have in a year. Most of these failures appear in workflows that worked for months. A fetch with no limit is fine at 500 records and fatal at 50,000. Put a filter or a limit on every node that reads a list.
Stop saving what you do not need. This is about the database, not memory, but the two problems arrive together on busy instances. Once a high-volume workflow is past testing, the Cloud docs suggest you stop saving its successful executions: in the workflow's settings, change Save successful production executions to Do not save. Self-hosted instances can set EXECUTIONS_DATA_SAVE_ON_SUCCESS=none globally, as shown in the execution data documentation.
Keep heavy jobs apart. Give each large scheduled workflow its own time slot.
Set an error workflow. The n8n docs on error handling mention running out of memory as one of the usual reasons an execution fails, and an error workflow is how you find out. Create a workflow that starts with the Error Trigger node and select it under Error workflow in the settings of each production workflow. See error handling.
Watch memory, not just failures. If you self-host, look at container memory during your heaviest scheduled run every so often. A run that peaks at 90 percent is next month's outage. Our guide to AI agent observability and monitoring covers what to track.
AI workflows are especially prone to this error, because documents, transcripts and model responses are large and agents make many calls per execution. Building them so they stay within memory is covered in the n8n AI Agents course. For background, see what an n8n execution is and our n8n platform review.
Sources
Checked against n8n's documentation and community forum on 17 November 2026.
- n8n docs: Fix memory issues - the error text, typical causes, chunking, sub-workflows,
--max-old-space-size. - n8n docs: Handle binary data -
N8N_DEFAULT_BINARY_DATA_MODEand the queue mode condition. - n8n docs: Manage your data on n8n Cloud - memory per plan, baseline memory use, execution saving.
- n8n docs: Control concurrency -
N8N_CONCURRENCY_PRODUCTION_LIMIT. - n8n docs: Manage execution data - execution saving variables.
- n8n docs: Handle errors gracefully - error workflows.
- n8n community: Execution stopped at this node - an AI workflow fixed by batching.
FAQ
- What does "Execution stopped at this node" mean in n8n?
- The full message is Execution stopped at this node (n8n may have run out of memory while executing it). The execution needed more memory than the instance had, and the process stopped at that node. n8n does not limit how much data a node can fetch, so large datasets, big files or long workflows can exhaust the available memory.
- Is the node named in the error the one causing the problem?
- Not necessarily. It is where the execution was when memory ran out. Data from every earlier node in the same execution is also held in memory, so the cause may be an earlier node that fetched too much.
- How much memory does n8n Cloud give me?
- According to the n8n Cloud documentation at the time of writing: 640MiB RAM on Trial, Starter and Pro-1, 1280MiB on Pro-2, and 4096MiB on Enterprise. n8n itself uses around 180MiB of that on average. Check the docs for current figures, as plans change.
- Does increasing max-old-space-size fix n8n out of memory errors?
- Only in one case: when the server log shows JavaScript heap out of memory and the machine has more RAM than Node.js is using. Set NODE_OPTIONS=--max-old-space-size to a value in megabytes that the machine can actually provide. It raises a limit and does not add memory.
- How do I stop large files crashing self-hosted n8n?
- Set the environment variable N8N_DEFAULT_BINARY_DATA_MODE to filesystem. By default n8n keeps binary data in memory. In filesystem mode it writes it to disk. In queue mode, all instances handling binary data must share the same volume at the same path.
- Why does my workflow fail in the editor but run fine on its schedule?
- Manual executions use more memory, because n8n makes a copy of the data for the editor. Test large workflows with a small sample of the data, and let the full volume run only as a production execution.
- Will a Loop Over Items node reduce memory use?
- Not on its own. It controls how many items pass through the next nodes at a time, but data fetched before the loop is already in memory. The saving comes from running each batch in a sub-workflow through the Execute Workflow node and returning only a small result to the parent.
If this resonated
Module 02 is the long version of this post.
Eval set, refusal pattern, kill switch. Build it in a weekend.
