While loops
While loops execute a sequence of code indefinitely until the user cancels or a step set to early stop stops it.
How to stop a while loop
Section titled “How to stop a while loop”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.
Cancel manually
Section titled “Cancel manually”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.
Early stop / Break
Section titled “Early stop / Break”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.
Early stop for step
Section titled “Early stop for 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.
Skip failure
Section titled “Skip failure”If set to true, the loop will continue to the next item even if the current item failed.
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. 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.
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.
Advanced settings
Section titled “Advanced settings”Early stop / Break
Section titled “Early stop / Break”See above.
Suspend/Approval/Prompt
Section titled “Suspend/Approval/Prompt”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.
Lifetime
Section titled “Lifetime”The logs, arguments, and results of this flow step will be completely deleted from Orvanta once the flow is complete.