Memory issues in n8n

i am using version 2.20.12 cloud instance in n8n

how can i know which workflow is causing memory spikes ?

we found outself often that the instance is restarting due to memory issues

good morning @amitkatzzadara
Currently this option does not exist.
Normally, large payloads, use of binary data, loops and workflows with AI/LLM tend to be the most common causes of memory spikes.
Memory-related errors | n8n Docs
Configuring queue mode | n8n Docs

hello @amitkatzzadara ,

I think the easiest (if you do not have that many workflow) would be to disable all workflows and reactivate them one by one.

To find the culprit, you might check the log and find the ID of the workflow there. Could you share your n8n logs?

@amitkatzzadara to narrow it down faster on Cloud: go to Executions, filter by status “Running” - if you see any stuck executions that have been running for hours, those are likely the culprits. Also check if you have any Loop node iterating over a large dataset (100+ items) combined with an AI or HTTP node - that pattern consumes the most memory because n8n keeps all loop state in memory. Trimming execution history in Settings > Executions to the minimum (e.g. 20 saved) also helps reduce memory pressure from the stored data.

only account admin can trim history execution history in setting because i ddint find it. can you share screen where to find it ?

On n8n Cloud, go to Settings (left sidebar) > Executions. You’ll see a “Save Executions” section with a field to set the max number to keep - set it to 20 or lower. This setting is available to the workspace owner/admin, so make sure you’re logged in with the admin account.

This is what we have

I am account admin

Hi @amitkatzzadara i think this is what you need:

There you can monitor your executions.

@amitkatzzadara the execution history prune setting is at Settings (bottom-left gear icon) > Executions. You’ll see a “Save execution progress” section and a “Prune execution history” option where you can set the maximum age or maximum count of stored executions. Since you’re on Cloud, go to your instance URL > Settings > Executions and look for the “Execution Data” section - it should be visible there for account admins.

Yes, there is no “Executions” setting in n8n.

Check the Executions list and identify which ones were running during the memory outage. One of them (or multiple ones) should be the root cause.

@amitkatzzadara

There’s no way to do this monitoring through n8n cloud or perform cleanup in bulk, only one by one.
the retention settings are managed by n8n itself and vary depending on your plan
there is this official template for cleanup
Automated execution cleanup system with n8n API and custom retention rules | n8n workflow template