Loop Over Items Bug?

Hi there,

I have a workflow where I first need to get all the data paginated, so I’d run it 2 or 3 times depending on the data and then I want to loop over all the items.
For better debugging and tracking I use “Loop Over items”

I observed weird behaviour in my workflow, so I created a minimal version with demo data to simulate the behaviour below.

What it should do:

  1. create 10 sample data, then loop over the 10 items
  2. create 10 more sample data, then loop over the other 10 items.
  3. result: looped over 20 items.

What it does:

  1. creates 10 sample data and loops over the 10 items
  2. creates 10 more sample data and then it does not loop over it, instead, they immediately jump to “done” in the “Loop Over items” node.

And the weirdest thing is that the “done node” shows 30 items done, although in total l only pushed 2x10 = 20 items to the node.

Did I oversee something here or is this a bug?

Thanks for your support.

Screenshot:

Here is the demo workflow:

Debugging infos:

  • n8nVersion: 1.68.0
  • platform: npm
  • nodeJsVersion: 20.6.1
  • database: sqlite
  • executionMode: regular
  • concurrency: -1
  • license: community

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:

added: Debugging infos:

  • n8nVersion: 1.68.0
  • platform: npm
  • nodeJsVersion: 20.6.1
  • database: sqlite
  • executionMode: regular
  • concurrency: -1
  • license: community

Hey @passana , the Loop node has to be reset for the 2nd set of the items to be iterated. See Loop Node Only Processes the First Item - How to Fix? - #10 by ihortom for details.

Also, when you are talking about pagination do you imply HTTP Request node to get the paginated data? The node has built-in pagination mechanism. Once configured correctly, no loop is needed.

Thanks @ihortom , that seems to work.

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