๐Ÿ‡ฌ๐Ÿ‡ง EN
๐Ÿ‡ฎ๐Ÿ‡น IT

๐Ÿ” Loop

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.

Category: Flow Control  ยท  Type identifier: loop

Overview

The 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.

Sequential, not parallel. Steps inside a loop run one item at a time. If you need to process all items simultaneously, use the Parallel node instead.

Configuration

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.

Output Data

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.
// Access loop results after the loop ends {{ send_emails.output.results }} {{ send_emails.output.count }} {{ send_emails.output.errors }}

Example Usage

Send a personalised email to each address in a list

  1. Add an HTTP Request node (step key: extract_emails) that fetches a list of subscriber objects, each with an email and first_name field.
  2. Add a Loop node (step key: send_loop). Set the Items Path to:
    {{ extract_emails.output.addresses }}
  3. Inside the loop, add a Send Email node. Set the To field to:
    {{ send_loop.current_item.email }}
    And personalise the subject with:
    Hello {{ send_loop.current_item.first_name }}, your update is ready
  4. After the loop, add a Set Variable node or a notification step that references {{ send_loop.output.count }} to report how many emails were sent.

Tips & Notes

Related Nodes