Skip to main content

Workflow.dowhile()

.dowhile() 方法在条件满足时执行一个步骤。它总是在评估条件之前至少执行一次该步骤。第一次评估条件时,iterationCount1

🌐 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.

使用示例
Direct link to 使用示例

🌐 Usage example

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

参数
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.

返回
Direct link to 返回

🌐 Returns

workflow:

Workflow
The workflow instance for method chaining

🌐 Related