Loop
Controlled node
Overview
Repeat a workflow branch a fixed number of times.
Loop repeats a branch a chosen number of times. Use For Each instead when you already have a list of items to process.
Inputs
| Input | Type | Description |
|---|---|---|
| run | Event | Starts the loop. |
| times | Number | The repeat count. Use a finite, non-negative whole number. |
Outputs
| Output | Type | Description |
|---|---|---|
| loop | Event | Triggers the repeated branch for each iteration. |
| index | Number | The current iteration, starting at 0. |
| finished | Event | Continues after all iterations have completed. |
For times = 3, the branch runs with indexes 0, 1 and 2. A zero, negative, missing or non-numeric count skips the repeated branch and fires finished.
Wiring the loop
Connect loop to the first action in the repeated branch. The loop waits for that branch to finish before moving to the next iteration. Connect finished to the action that should happen once afterward.
Do not connect the end of the branch back to run. Repetition is automatic; a connection back starts another loop rather than advancing the existing one.
Example
- Connect Start to run and set times to
3. - Connect loop to run on a Log node.
- Connect index to the Log node's message input.
- Connect finished to your next action.
This logs 0, 1 and 2, then continues. Loops are subject to workflow execution limits; use sensible counts and test repeated external actions carefully.