> ## Documentation Index
> Fetch the complete documentation index at: https://altostrat.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Loop / Iterator Node

> Reference for the Loop / Iterator node, including when to use it, how it processes arrays, and practices for reliable per-item execution.

Loop / Iterator is a flow-control node used for per-item processing. It runs a nested workflow for each element in an input array, then returns control to the main workflow path.

## When To Use Loop / Iterator

* You need to perform the same action for each item in a list.
* You need per-item branching logic before continuing the main flow.
* You need to aggregate results from repeated operations.

## Configuration Checklist

1. Map an input path that resolves to an array.
2. Define nested steps that run for each item.
3. Reference item-scoped variables inside nested nodes.
4. Validate behavior with small and large sample arrays.

## Inputs

* Node metadata (`uiId`, `componentId`) for iterator runtime.
* Input array path sourced from trigger or upstream action output.
* Nested sub-workflow steps that execute for each item.

## Outputs

* Executes nested nodes once for each array item.
* Produces per-item outputs inside iterator scope.
* Returns loop completion and resulting context to downstream nodes.

## Failure Modes

* Input path is missing or does not resolve to an array.
* Per-item node failures interrupt or fail loop execution.
* Very large arrays causing long execution time or timeout risk.
* Missing item field references in nested iterator logic.

## Best Practices

* Pre-filter arrays before iteration when possible.
* Keep nested workflows small and single-purpose.
* Capture and log per-item failures for easier troubleshooting.
* Avoid heavy nested loops; prefer pre-filtering arrays first.
