It's possible to loop inside a loop?

Hello, I have created a scenario in n8n:

My problem is the Split In bach (Get Multiple Invoices), it runs only once, the first item of the main Loop, when the second run happens, it stops in that step… as you can see in the image, the “loop items” has 2 runs, and in that second run the “Get Multiple Invoices” doesn’t run anymore

I have checked the input, and it’s ok…

Any thoughts?

I have fixed it:


I had to enable the reset feature, so now it works… but at 5 or 6 runs, it starts to lag, then the browser freezes… and I can’t test it…

It doesn’t seem to be a resource issue, as I’m barely hitting the 60% CPU capacity in the droplet.

Any ideas?

Would be best to use sub workflows with the execute workflow node.
Two split in batches inside each other doesn’t work as far as I know. So setting them in seperate workflows would solve that. would also free up some resources.

1 Like

Yay, thanks for the answer, @BramKn, so having multiple workflows and using the execute function is lighter than having a big scenario?

Good to know.

I’ll try that and let you know if that solves the issue!

Much appreciated!

The RAM gets cleared when a workflow is finished. So in your case splitting the processing of the PDF’s will help.
(make sure not to return it into the main workflow though)
Also there is an option to use file storage instead of ram for files.

1 Like