Second nested Loop Over Items does not restart in each iteration of the outer loop

Hi everyone,
I built a workflow where I have a main loop (Loop Over Items – URL). Inside it, there is a second loop (Loop Over Items – Blocks). The problem is that the inner loop only runs during the first iteration of the outer loop. On the following iterations, the second loop goes directly to done without processing again.

It looks like the inner loop does not restart properly for each outer iteration. I expected it to execute again for each set of items generated by the outer loop.

Is there a configuration detail I’m missing? Or do I need to restructure the way I return items before sending them to the second loop?

Any tips or examples would be very helpful. Thanks!

Hi @Felipe_Cucick

Nested loops are troublemakers, sub-loops won’t work as you expect, so you can only rely on one level of looping and in most cases you don’t actually need a second loop anyway because n8n iterates over your items by design.

However, if you still need another level of looping, the best approach is to move the second loop into a sub-workflow and call it using the Execute Workflow node, That way, each run of the outer loop starts a fresh inner loop, and everything works cleanly.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.