Skip to main content

Loops and iteration

A loop repeats a section of the flow once for each item in a list. To add one, click + on an edge and select Loop. This scaffolds a matched pair—a Loop node where the section begins and a Loop End node where it converges—already connected. The nodes you place between them form the loop body, which runs once per item.

For field-level detail, see the Reference.

Configuring the loop

Configure the Loop node with:

  • Source—the list to iterate over, taken from an upstream variable that produces an array, such as an HTTP response or a search result.
  • Mode—whether iterations run one after another (serial) or at the same time (parallel). Serial iterations can see the results of the previous iteration; parallel iterations run independently and finish faster.
  • Failure Policy—what happens when an item's body fails. Fail fast stops the loop on the first failure; best effort records the failure and continues with the remaining items.

Using the current item

Inside the loop body, the Loop node's output is the current item. Reference its fields through the variable picker to act on each item in turn—for example, looping over a list of content IDs and running a content action on each.

Watching a loop run

While a loop runs, the Loop card shows an iteration counter in place of a status badge, and once the run finishes you can step through individual iterations with the arrows beside it—each step replays that iteration's statuses across the body.

After the loop

When every item has been processed, the flow continues from the Loop End node. Its output summarizes the run with the number of iterations and how many succeeded and failed, so a later step can branch on whether everything completed cleanly.

Collecting results

By default, a later step only sees the loop's run stats—not what each iteration produced. To carry those forward, configure the Loop End node's Collect Results From field with a body node's output (its whole payload, or one of its fields). The Loop End then gathers that value from every completed iteration, in order, into a results array on its own output—skipping any that didn't finish—so a single downstream step (for example, an AI action) can consume the whole set at once, instead of only the count of successes and failures.

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.