URGENT : Probelm with Loop in N8N hosted version. Not able to loop through items

I am trying to loop over a few files to process. The issue ia m facing is that th eloop over is not working as a loop and only loops just once.

As you can see – before the loop, there is 17 items but after the looop, it gets stuck on item 1.

Attaching screenshots of loop over items as well

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hello. Based on your screenshots, it seems to me that

  1. It looped twice but failing on the second loop. Notice that the first code node (debug code before) ran twice but the next node errored. That’s why the looping is stopped. Any error in any node would stop the execution. You can use Retry On Fail setting or On Error settings to handle errors in nodes, so execution continues even if there’s an error.
  2. It likely failed the second time because you have the reset option set in the Loop Over Items node. The reset option would pass the data from the the last node in the loop (in this case the Execute Command ) instead of the original input list. Setting that back to the default false
  3. I also recommend disabling Always Output Data from the Loop Over Items node here. That’s why the done branch on the Loop node has 2 items. The done branch only should output once when the looping is done in order to be useful.

Hey @Mutasem –> that actually works!
Thank you so much, I was stuck here for 2 hours or more

Hi @Mutasem –> I have a quick question. So after the loop runs for 17 items (in my case], how do i get out of the loops? Would it automatically identify that the loop is finished, it should now go ot hte done chain? On the done chain, i can set the next steps?

when loop ends you will see done side of line give output.

so if you have nodes connected there they will start running.