Iterates over an array, executing the contained steps once for each item. The current item and its position are available as variables inside the loop body.
loopThe Loop node lets you process a list of things โ customers, orders, file paths, email addresses โ without duplicating steps. You point it at an array from a previous step, and Flusso automatically runs the body of the loop once per item. When all items are processed, execution continues past the loop with a collected set of results.
Inside the loop, three special variables become available on every iteration:
| Variable | Description |
|---|---|
{{ loop_step.current_item }} |
The current array element. If the array contains objects, you can drill in with dot notation: {{ loop_step.current_item.email }}. |
{{ loop_step.current_index }} |
The zero-based position of the current item (0 for the first item, 1 for the second, and so on). |
{{ loop_step.total }} |
The total number of items in the array. Useful for calculating progress or setting conditions. |
Replace loop_step with the actual step key you have given your Loop node.
| Field | Status | Description |
|---|---|---|
| Items Path | Required | A variable reference that resolves to the array you want to iterate over, e.g. {{ fetch_orders.output.items }}. |
| Max Iterations | Optional | A safety cap on the number of iterations. Defaults to 100. If the array is longer, the loop stops after this many items and logs a warning. Increase this value if you genuinely need to process more items. |
After all iterations complete, the Loop node makes these variables available to subsequent steps:
| Variable | Type | Description |
|---|---|---|
results |
array | An array of the output from the last step of each iteration, in order. Each entry corresponds to one processed item. |
count |
integer | The number of iterations that actually completed. |
errors |
array | An array of any per-iteration errors. If an iteration fails and the workflow is configured to continue on error, the failure is recorded here. |
extract_emails) that
fetches a list of subscriber objects, each with an email and
first_name field.
send_loop). Set the Items Path
to:
{{ send_loop.output.count }} to report how many emails were sent.
0 using a Set Variable node
before the loop.