Skip to content

For loops

For loops are a special type of step that allows you to iterate over a list of items, given by an iterator expression.

Clicking on the For loop step on the mini-map opens the For loop step editor. There are several configuration options.

The JavaScript expression that will be evaluated to get the list of items to iterate over. You can also connect with a previous result that contains several items, and it will iterate over all of them.

It can be pre-filled automatically by Orvanta AI from the flow context.

If set to true, the loop will continue to the next item even if the current item failed.

If set to true, all iterations will be run in parallel.

Assign a maximum number of branches run in parallel to control huge for loops.

If set to true, all iterations will be run on the same worker. In addition, for supported languages (TypeScript and Python), a single runner per step will be used for the entire loop, eliminating cold starts between iterations. We use the same logic as for dedicated workers, but the worker is only “dedicated” to the flow steps for the duration of the loop.

You can get a test of the current iteration by clicking on the Test an iteration button.

Steps within the flow can use both the iteration index and value. For example, with iterator expression ["Paris", "Lausanne", "Lille"], for iteration index “1” the value is “Lausanne”.

When a flow has been run or tested, you can inspect the details (arguments, logs, results) of each iteration directly from the graph. The for loop detail page lists every iteration status, even if you have a thousand of them, without having to load them all.