Help Please - can anyone see why my loop is not moving on and updating?

Describe the problem/error/question

I am trying to move to the next item in the loop node if true but it still loops over every object and then does not move on to the next row. I am not sure where I am going wrong.

What is the error message (if any)?

Please share your 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:

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

@spencerbf , without diving into the complexity of the workflow and just checking the interconnections of the nodes (it is just a rational guess!) I believe that there is a missing link from the inner (nested) loop back to the parent (outer) loop.

The point is, the loop has to be complete, no loose ends within the loop. Any data flow has to end at the beginning of the loop eventually.

Actually, nested loops are not supported. You have to move the sub-loop functionality in the sub-workflow in order it to work properly.

1 Like

Hi @ihortom @barn4k, Thanks for taking the time to try and hel. I guess I will have to remove the nested loop. Cheers

Nested loops not allowed,

Technically speaking, having a nested loop does not necessarily “break” (prevent iterating) the parent loop. It’s just the outcome appears to be not what one might expect. I created a test workflow to check out the outcome of having the nested loop and here what I got.

Outcome

Thus, while it is still possible to utilize a nested loop the result of it is not likely what one would expect. It is a good suggestion to stay out of nested loops :slight_smile: .

1 Like

@spencerbf

“Not supported” would imply that the following wf should not be possible →

But it is.


Now, whether it’s recommended or not is an important point of consideration:

  • As seen here, 5 starting items can lead to a total of 125 iterations, in such a wf, and that could rapidly lead to a huge spike in memory usage and possibly app crash.
  • Also, as suggested above, you need to make sure that the loops are properly closed off. (Advice: Always exit a loop using the Loop node’s Done property)
2 Likes

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