Workflow.dountil()
.dountil() 方法会执行一个步骤直到满足某个条件。它总是在评估条件之前至少执行一次该步骤。当第一次评估条件时,iterationCount 是 1。
🌐 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.
使用示例Direct link to 使用示例
🌐 Usage example
workflow.dountil(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
相关Direct link to 相关
🌐 Related