Skip to content

For loops

A for loop step iterates over a list of items, computed by an iterator expression, and runs its inner steps once per item.

Clicking the For loop step on the mini-map opens its editor, with the following options.

The JavaScript expression that produces the list to iterate over. You can also connect it to a previous step whose result is already a list, and the loop will run over each of its elements.

Orvanta AI can pre-fill this expression from the surrounding flow context.

When enabled, a failed iteration doesn’t stop the loop — it just moves on to the next item.

When enabled, every iteration runs at the same time instead of one after another.

Caps how many iterations run at once, so a very large loop doesn’t try to run all of them simultaneously.

When enabled, every iteration runs on the same worker. For languages that support it (TypeScript and Python), the loop also reuses a single runner process across all iterations instead of starting a fresh one each time, which removes the cold-start cost between them — the same mechanism behind dedicated workers, just scoped to the lifetime of this loop rather than kept running permanently.

Click Test an iteration to run a single pass of the loop body and see its result without running the whole thing.

Steps inside the loop have access to both the current index and the current value. For example, with iterator expression ["Berlin", "Vienna", "Madrid"], iteration index 1 gives the value "Vienna".

Once a flow has run (or been tested), you can inspect each iteration’s arguments, logs, and result directly from the graph. The for-loop detail view lists every iteration’s status — even across a thousand iterations — without needing to load them all at once.