While loops
A while loop keeps running its body indefinitely until something stops it — either a manual cancel or an early-stop condition tripping.
How to stop a while loop
Section titled “How to stop a while loop”Left alone, the loop keeps running. There are three ways to stop it:
- Cancel it manually.
- An early stop/break configured on the loop itself.
- An early stop configured on one of its steps.
Cancel manually
Section titled “Cancel manually”A running flow can be cancelled from the flow page — reachable whether the flow was triggered manually or from the Runs page.
Early stop / Break
Section titled “Early stop / Break”Early stop/Break lets you define a predicate expression, checked at the end of (or before) a step, that decides whether the loop should stop there.
Early stop for step
Section titled “Early stop for step”Each step in the loop can carry its own early-stop condition: the step’s result is checked against the predicate, and if it matches, the flow (and by extension the loop) stops right after that step.
Skip failure
Section titled “Skip failure”When enabled, a failed iteration doesn’t stop the loop — it just moves on to the next one.
Squash
Section titled “Squash”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 iterations rather than starting a fresh one each time, cutting out the cold-start cost between them. It’s the same mechanism dedicated workers use, just scoped to how long this loop runs rather than kept alive permanently.
Test an iteration
Section titled “Test an iteration”Click Test an iteration to run a single pass of the loop and see its result without running the whole loop.
Advanced settings
Section titled “Advanced settings”Early stop / Break
Section titled “Early stop / Break”Covered above.
Suspend/Approval/Prompt
Section titled “Suspend/Approval/Prompt”A flow can pause and wait for a resume or cancel event before continuing — most commonly used for approval steps, though nothing stops you from using it for other kinds of human-in-the-loop pauses.
A step can also just pause for a fixed duration instead of waiting on an external event.
Mocking (pinning a result) lets you iterate on a flow faster while building it: a mocked step returns its pinned value immediately, skipping the real computation entirely.
Lifetime
Section titled “Lifetime”Once the flow finishes, this step’s logs, arguments, and results are deleted from Orvanta rather than kept around.