Skip to main content

Workflow.dountil()

The .dountil() method executes a step until a condition is met. It always runs the step at least once before evaluating the condition. The first time the condition is evaluated, iterationCount is 1.

Usage example
Direct link to Usage example

workflow.dountil(step1, async ({ inputData }) => true)

Parameters
Direct link to Parameters

step:

Step
The step instance to execute in the loop

condition:

(params : ExecuteParams & { iterationCount: number }) => Promise<boolean>
A function that returns a boolean indicating whether to continue the loop. The function receives the execution parameters and the iteration count.

options?:

StepFlowEntryOptions
Optional identity and display metadata for this graph entry. Preserved through serialization and storage; has no effect on execution.
string
string
Record<string, unknown>

Returns
Direct link to Returns

workflow:

Workflow
The workflow instance for method chaining
On this page