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.
Configuration options
Section titled “Configuration options”Clicking on the For loop step on the mini-map opens the For loop step editor. There are several configuration options.
Iterator expression
Section titled “Iterator expression”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.
Skip failure
Section titled “Skip failure”If set to true, the loop will continue to the next item even if the current item failed.
Run in parallel
Section titled “Run in parallel”If set to true, all iterations will be run in parallel.
Parallelism
Section titled “Parallelism”Assign a maximum number of branches run in parallel to control huge for loops.
Squash
Section titled “Squash”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.
Test an iteration
Section titled “Test an iteration”You can get a test of the current iteration by clicking on the Test an iteration button.
Iterate on steps
Section titled “Iterate on steps”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.