Workflow.dowhile()
The .dowhile() method executes a step while 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 exampleDirect link to Usage example
workflow.dowhile(step1, async ({ inputData }) => true);
ParametersDirect 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.
ReturnsDirect link to Returns
workflow:
Workflow
The workflow instance for method chaining