Skip to main content
The Loop node is the standard answer when an extracted document yields a variable-length list (line items, attachments, contacts) and you need to act on each entry. It is a container: drop nodes inside it and they run once per item.

Build it

  1. Add a Loop node and set its Source to a template expression that resolves to an array, for example {{extract.payload.lineItems}}.
  2. Connect the node that produces the array into the Loop.
  3. 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.
  4. Inside the body, reference the current item with {{loop.payload.item}} and its index with {{loop.payload.index}} (where loop is the loop node’s name).
  5. 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.
The whole loop runs as a single sub-run. Open it from the run detail and use the item pager to step through each item’s output.
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
After the loop, from downstream nodes:
  • {{loop.payload.results}} for the full resolved array
  • {{loop.metadata.itemCount}} for the count
Per-item bindings accept the full filter chain, so you can transform an item inline, for example {{loop.payload.item.amount | round: 2}} or {{loop.payload.item.sku | upper}}. See expressions and filters.

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.
Each per-item request is retried safely if the loop resumes: see Retries and checkpoints. Send all extracted items in one request, after the loop. To send the whole array in a single request instead of one per item, put a Callback Output after the loop (or anywhere downstream):
For per-item HTTP against an OData endpoint, see the $batch path on the Business Central guide. Count items and branch on a threshold. Add a Condition edge from the Loop with the rule {{loop.metadata.itemCount}} >= 10, and an Otherwise edge to the alternative path.