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

# For Each

> Loop over an array and execute steps for each item

`control.foreach`, Loop over an array and execute steps for each item

## Configuration

Configuration fields sit at the step level (not inside `with:`).

<ParamField path="items" type="string" required>
  Expression resolving to array
</ParamField>

<ParamField path="as" type="string" required>
  Variable name for current item
</ParamField>

<ParamField path="indexAs" type="string">
  Variable name for current index
</ParamField>

## Output

<ResponseField path="items" type="array<unknown>" required>
  Results from each iteration
</ResponseField>

<ResponseField path="count" type="number" required>
  Number of completed iterations
</ResponseField>

<ResponseField path="totalIterations" type="number" required>
  Total iterations
</ResponseField>
