Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.docpipe.ai/llms.txt

Use this file to discover all available pages before exploring further.

The Loop node takes an array from upstream and exposes each item to downstream nodes. It’s the standard answer when an extracted document yields a variable-length list (line items, attachments, contacts) and you need to act on each one.
This is the v1 release of the Loop node. It resolves the source array and exposes the items in its payload so downstream nodes can iterate using template filters ({{loop.payload.results | first}}, {{loop.payload.results[0]}}). Per-item child-workflow fan-out (running the downstream subgraph N times, once per item) is on the roadmap as a follow-up.

Configuration

FieldDescription
Source arrayA template expression that resolves to an array, for example {{extract.payload.lineItems}}
Sequential executionReserved for the fan-out version. Has no effect today.
Failure modeReserved for the fan-out version. Has no effect today.

Output

The node’s payload contains:
{
  "results": [ /* the resolved array */ ],
  "itemCount": 3
}
Reference these downstream:
  • {{loop.payload.results}} for the full array
  • {{loop.payload.results | length}} for the count
  • {{loop.payload.results[0]}} for the first item
  • {{loop.payload.results[-1]}} for the last item
  • {{loop.payload.results | sum}}, {{loop.payload.results | join: ', '}}, etc.

Recipes

Send a callback for each line item (single-batch): Use a Callback Output node with body:
{
  "lines": "{{loop.payload.results}}"
}
The receiver gets the full array in one request. For per-item HTTP calls, see the OData $batch path on the Business Central guide or wait for the per-item fan-out release. Count items and route on threshold: Add a Condition edge from the Loop to the next node with the rule {{payload.itemCount}} >= 10, and an Otherwise edge to the alternative path.