About loop node

hi guys! do you have any example on how to use loop node?

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:

@reve , there are lots of examples. Check the posts with the tag “loop-over-items”.

Do you have any use cases in mind or just want to see some examples of it being used?

I would suggest looking though the n8n templates and see how they’re being used there, they might be little more polished than what’s posted on the forum for support

What’s the goal with the workflow?

The loop node isn’t doing anything since you only have one item going into it.

Nodes in n8n loop over every item on their own without the loop node, so it seems like you wouldn’t need a loop node here at all

Can you share the pinned data from the webhook so I can try to get this working for you?

1 Like

i want to get the operator id and language code whenever it loops and upload it in aws s3 folder with each operator id name.

here’s the pinned data from webhook:

[
  {
    "type": "maintenance",
    "detail": [
      {
        "operatorid": 0,
        "moduleCode": "DPM",
        "moduleName": "Deposit Mobile",
        "startDate": "2023-11-28 12:50:00.000",
        "endDate": "2023-11-28 13:13:00.000"
      },
      {
        "operatorid": 0,
        "moduleCode": "DPW",
        "moduleName": "Deposit Web",
        "startDate": "2023-11-28 12:50:00.000",
        "endDate": "2023-11-28 13:13:00.000"
      },
      {
        "operatorid": 0,
        "moduleCode": "WPM",
        "moduleName": "Withdrawal Mobile",
        "startDate": "2023-11-28 12:50:00.000",
        "endDate": "2023-11-28 13:13:00.000"
      },
      {
        "operatorid": 0,
        "moduleCode": "WPW",
        "moduleName": "Withdrawal Web",
        "startDate": "2023-11-28 12:50:00.000",
        "endDate": "2023-11-28 13:13:00.000"
      }
    ]
  }
]

Here is the edited workflow.

hi, thank you! but its not looping :((

Why you need the loop node? You should not use it if it’s not necessary

1 Like

n8n nodes runs once for each item by default. So n8ns default behavior is to loop.

If you have multiple items going into a node and you didn’t change the settings to make it run only once it will run for each one of those items.

You only need the loop over items node in rare cases, Like, if the beginning of the loop relies on the previous items creation at the end of the last loop.

1 Like