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 exampleUsage example的直接链接
workflow.dowhile(step1, async ({ inputData }) => true)
ParametersParameters的直接链接
step:
Step
The step instance to execute in the loop
condition:
((params: ConditionFunctionParams & { iterationCount: number }) => Promise<boolean>) | { predicate: Predicate }
A function that returns a boolean indicating whether to continue the loop. The function receives the execution parameters (excluding setState and suspend) and the iteration count. A declarative { predicate } object is also accepted.
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>
ReturnsReturns的直接链接
workflow:
Workflow
The workflow instance for method chaining