Loop Node

Iterate over a list and run downstream nodes for each item.

The Loop node iterates over an array and executes connected downstream nodes once per item.

Configuration

FieldDescription
Loop OverThe array to iterate — usually {{lastOutput.items}}
ConditionOptional expression to control when the loop continues

How it works

Start → Fetch List → Loop → Process Item → (next step)

For each item in the array:

  1. The loop sets loopItem to the current item and loopIndex to the position.
  2. Downstream nodes execute with access to these values.
  3. After all items are processed, the loop output contains the collected results.

Accessing loop data

Inside nodes connected after the loop:

ReferenceValue
{{loopItem}}The current item in the iteration
{{loopItem.name}}A field on the current item
{{loopIndex}}Zero-based index of the current item

Example prompt in an AI node inside a loop

Write a one-line social post for this product:

Name: {{loopItem.name}}
Description: {{loopItem.description}}

Example — process a list of contacts

Start (Manual)
  → HTTP Request (fetch contacts from API)
  → Loop (loop over {{lastOutput.contacts}})
    → AI Agent ("write a personalized greeting for {{loopItem.name}}")
    → Action (Gmail → Send Email to {{loopItem.email}})

Condition field

Use the condition to limit iterations:

loopIndex < 10

This processes only the first 10 items even if the array is longer.

Tips

  • Make sure Loop Over points to an actual array. Check Execution Data on the upstream node.
  • Keep per-item processing lightweight — large lists with AI nodes can be slow and costly.
  • Use a Transform → Filter node before the loop to narrow the list.
  • For very large datasets, consider batching with a Function node.