# Repeat

> Run the steps that follow a set number of times.

Source: https://docs.buildcord.dev/nodes/flow-control/repeat/

`flow.repeat` runs the steps wired to **Each time** again and again, then continues from **When finished**. It can't fail.

## Settings

| Setting | What it does |
| --- | --- |
| Times | How many passes, up to 500. The default is 3. A token works, such as `{option.count}`. |

## Ways out

| Way out | Taken when |
| --- | --- |
| `Each time` | For every pass. Wire it to the steps to repeat. |
| `When finished` | After the last pass. |

## Produces

`{loop.index}`: which pass this is, starting at 1.

## Notes

- A path inside the loop that leads nowhere returns to the loop for its next pass.
- Leave early with [Stop a loop](https://docs.buildcord.dev/nodes/flow-control/stop-loop), or skip the rest of a pass with [Skip to the next pass](https://docs.buildcord.dev/nodes/flow-control/skip-to-next).

## Example

A `/roll` command: repeat `{option.dice}` times, adding `randint(1, 6)` to a total each time.

## Related

- [For each item](https://docs.buildcord.dev/nodes/flow-control/for-each)
- [For each row](https://docs.buildcord.dev/nodes/variables-and-data/for-each-row)
