# Loop Group (/docs/workflows/reference/category/controlFlow/loopGroup)

> For the complete documentation index, see [llms.txt](https://docs.tandemcx.ai/llms.txt). Any page on this site can be fetched as Markdown by appending `.md` to its URL.

Wrap a block of nodes and run it once for each element of an array.

Loop Group is a container. Drop the body inside it and wire the `onIterate` exit to the first node: each pass writes the current element to the variable named in `Item Variable`, runs the body, and comes back for the next element. When the array runs out, or the list is empty, the flow takes `onFinished`. `Maximum Iterations` is a runaway guard rather than a batch size: tripping it takes `invalidInput`, with a message naming the limit and the length of the array, so a cap set below the length of the list is reported instead of quietly dropping the rest. A Loop Break node inside the group stops early and takes `break` instead, leaving the remaining elements unprocessed. Use the plain Loop node when you would rather draw the body as an explicit back edge than box it on the canvas.

**Category:** Control Flow  
**Provider:** Core  
**Latest version:** 1.0.0

## Fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| Array (`array`) | string | Yes | The list to walk. A variable holding a JSON array, or a JSONPath that resolves to one. Example: `$(order.items)` |
| Item Variable (`itemVariable`) | string · variableName | Yes | The variable name the current element is written to before each pass. Read it inside the group with the $(name) syntax. Example: `item` |
| Maximum Iterations (`maxIterations`) | number | Yes | The most passes this loop may make. A runaway guard, not a batch size: reaching it with items still unprocessed stops the loop on the invalid input exit, naming the limit and the length of the array, rather than reporting a run that dropped most of its work as finished. Example: `100` |

## Exits

- `onIterate` (required)
- `onFinished` (required)
- `break` (required)
- `invalidInput` (system)
- `fallback` (system)

System exits (auto-injected, hidden when unwired): `invalidInput`, `fallback`.
