Skip to content

Create a loop

For each and Loop are Flow steps that repeat nested steps. For each walks every item in an array (with optional concurrency). Loop repeats a fixed number of times, or while / do-while a condition stays true. Screenshots on this page use a sample contact list so you can see Source, Iteration output, and nested Slack steps filled in.

  • You have an array (contacts, tickets, hosts) and the same steps should run for each item → For each.
  • You need a fixed count, a condition-driven repeat, or pagination-style “continue until done” → Loop.
  • Prefer Handle API pagination when the main job is paging a vendor API with Loop and variables.
  • Prefer Branch with a Condition for a one-time branch, not a repeating block.

Before you begin, open the flow in the designer with permission to edit it. Have the array (or a previous step that returns one) ready before you configure For each.

For each runs the nested path once per item in Source. Nested steps can read the current item under the ForEach Iterator data source.

  1. Add For each. Open Add a step, choose Flow, then For each. Rename the step for the list you iterate (for example contacts).

    For each block on the canvas with a nested Slack send-message step

  2. Set Source. Open the Input tab. In Source, pick an array from an earlier step, or provide a sample array while you design.

  3. Set Iteration output. Define the object collected on each pass (for example a name property). Studio gathers those objects into an array you can use after the loop.

    For each Input with Source array of contacts and Iteration output mapping name

  4. Add nested steps. Inside the For each block, add the steps that should run per item (for example send a message).

  5. Pick iteration data. In a nested step field, open the data picker → Flow → your For each step → ForEach Iterator. Use Iteration data (current item), Iteration index, and Iterations count.

    Data picker showing ForEach Iterator with Iteration data, index, and count

Settings controls how many iterations run at once and whether large inputs are allowed.

  1. Open Settings. Select the For each step, then open the Settings tab.

  2. Set Maximum concurrency. Default is 1 (sequential). Raise it when iterations are independent and you want parallel runs. The value is a fixed number (not a formula).

  3. Enable large dataset when needed. Turn on Enable large dataset if the source is large (UI guidance: above about 250KB) or you need more than about 40 concurrent iterations. Leave it off for small lists.

Loop repeats nested steps under one of three Input modes (tabs): For x iterations, While condition, or Do while condition. Use Settings → Maximum iterations (default 100, max 10000) as a safety cap.

Runs a fixed number of times. Number of iterations can be a literal or a formula from earlier steps.

  1. Add Loop. Open Add a step, choose Flow, then Loop. Rename the step.

  2. Open For x iterations. On the Input tab, select For x iterations (one of the three Input mode tabs).

  3. Set Number of iterations. Enter the count, or pick a number from an earlier step (for example the length of an array).

    Number of iterations set from a variable

  4. Add nested steps. Inside the Loop block, add the steps for each pass. From nested steps, pick Loop Iterator → Iteration index (and Number of iterations when available).

A flow named Notify contacts builds a short contact array, then uses For each so each contact gets a Slack message that includes that contact’s name.

  1. Provide Source as an array of objects with name and email (or pick it from a previous list step).
  2. Map Iteration output so each pass contributes at least the contact name.
  3. Inside For each, add the Slack (or other) step and insert Iteration data → name into the message text.
  4. Leave Maximum concurrency at 1 while you test; raise it only when messages can safely send in parallel.
  5. Run once and check the run log for each iteration’s Iteration data and collected Iteration output.
  • For each is the usual choice for “do this for every item.” Use Loop when you need a count or a condition-driven exit.
  • Maximum concurrency and Enable large dataset apply only to For each.
  • Maximum iterations on Loop is a hard stop even if the while / do-while rule is still true.
  • If you see an input-array-too-large error on For each, turn on Enable large dataset in Settings.

Related: Handle API pagination, Branch with a Condition, Scripts, errors, and run control.