n8n Cloud users: I have a flow thats a looper and its supposed to run for a long time with every request with an app that ive built , the problem is often it stops in the 1 hour range without any visible error (my idea is it cant handle large flows for that long and it crashes the proccess)
Hi @rwad_amasha Welcome!
Yeah you are correct on your idea, as long running loops with data mostly crash the whole flow as they ran out of MEMORY, the easiest fix is to not include loop in the main flow, add a sub workflow for the loop so the memory gets freed each iteration, you can also upgrade your plan to solve this.
@rwad_amasha You can also use loops of 1 also, @Anshul_Namdev discussed sub workflows which can also work, but if you use a loop node with batch size 1 that can also work.
One thing nobody mentioned yet — worth adding
an error handler to the sub-workflow so if it
does crash you actually get a message.
Go to workflow settings → Error Workflow,
point it at a simple flow that sends you
a Slack/Telegram message with the error.
Otherwise you’re back to silent failures —
the sub-workflow crashes and the parent just
sees nothing happened.