Skip to content

While loops

While loops execute a sequence of code indefinitely until the user cancels or a step set to early stop stops it.

The loop will continue to run until canceled. There are 3 ways to stop a while loop:

  • Cancel manually.
  • Early stop/Break for loop.
  • Early stop for step.

You can cancel a flow manually from the flow page; it can be accessed when the flow is triggered manually or from the Runs page.

The early stop/Break feature allows you to define a predicate expression that determines whether the flow — or here, the loop — should stop early at the end of or before a step.

For each step of the flow, an early stop can be defined. The result of the step will be compared to a previously defined predicate expression, and if the condition is met, the flow will stop after that step.

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 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. The same logic as for dedicated workers is used, 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.

See above.

Flows can be suspended until resumed or canceled event(s) are received. This feature is most useful for implementing approval steps but can be used for other purposes as well.

Executions within a flow can be suspended for a given time.

Step mocking / Pin result allows faster iteration while building flows. When a step is mocked, it will immediately return the mocked value without performing any computation.

The logs, arguments, and results of this flow step will be completely deleted from Orvanta once the flow is complete.