Build it
- Add a Loop node and set its Source to a template expression that resolves to an array, for example
{{extract.payload.lineItems}}. - Connect the node that produces the array into the Loop.
- Drag the nodes that should run per item inside the Loop. These are the loop body; they run once for every item, in array order.
- Inside the body, reference the current item with
{{loop.payload.item}}and its index with{{loop.payload.index}}(whereloopis the loop node’s name). - If something must run after the loop, connect those downstream nodes from the Loop, not from a node inside it. A downstream connection is optional: the Loop can end a branch on its own.
If an item fails. By default (Stop the loop), the first failing item stops the loop immediately and the step fails, so the remaining items do not run. Set If an item fails to Continue with remaining items to run every item regardless, leaving a
null slot and an entry in {{loop.payload.errors}} for each one that failed. See If an item fails for the full behavior.What can go inside
A loop body may contain Transform, Validation, Store, Variable, HTTP, Callback, Business Central and QuickBooks nodes (in any operation). Extract, Review, Filter, Split, Classify, Reconcile, Merge, Download, Prompt, Email, Wait, Call Workflow, Forward, If, Switch, and nested Loops belong before or after the loop, not inside it. A single loop may iterate over at most 500 items. See the Loop node reference for the full rules, including retries and per-item idempotency for HTTP and connector body nodes.Referencing items
Inside the body, per item:{{loop.payload.item}}for the current item{{loop.payload.index}}for its 0-based position{{loop.metadata.itemCount}}for the total count
{{loop.payload.results}}for the full resolved array{{loop.metadata.itemCount}}for the count
Recipes
Send one request per item, inside the loop. HTTP, Callback, and Business Central and QuickBooks nodes can run inside a loop body: drag one in and it runs once per item, sending a request per item in a write operation. Reference the current item with the qualified token, not the bare{{$item}}:
Inside a
$each row template, the bare {{$item}} and {{$index}} still refer to the $each row, not the loop item; every other field in the body needs the qualified {{loop.payload.item}}. See Referencing items.{{loop.metadata.itemCount}} >= 10, and an Otherwise edge to the alternative path.
Related
- Loop node reference for configuration, limits, and errors.
- Expressions and filters for filter syntax (
length,first,sum, and so on). - Conditional routing for branching on item counts and other rules.