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.
Atomic failure. If any item fails, the loop stops immediately and the step fails, so the remaining items do not run. A loop’s Store writes are held until every item succeeds and are committed only then, so a failed loop persists nothing to the Store.
What can go inside
A loop body may only contain Transform, Validation, Store, and Variable nodes. Extract, Review, Route, Classify, HTTP, the output nodes (including Callback Output), Reconcile, Merge, 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.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 extracted items to a callback. Output and HTTP nodes can’t run inside a loop, so there is no per-item callback from the loop body. Put a Callback Output after the loop (or anywhere downstream) and send the full array in one request:{{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.