Adding the While loop
You can use the While control step to set a sequence of steps to apply within a loop. The step will apply while the condition from Execution condition template is true, but only as many times as set in Maximum number of iterations. If no condition is set, the step is performed the specified number of times. If the number of iterations is not specified, the loop will continue until the condition is no longer met or the workflow timeout is reached.
Each execution branch within the While step (including all Switch steps) must contain an integration step or a Success, Fail, or Wait step.
-
When creating a new workflow or editing an existing one, in the management console, under Create workflow / Edit workflow, select
Constructor. -
From the Control steps section on the left side of the screen, drag the
While element to the appropriate workflow location in the constructor window.You can drag and drop steps into areas marked by the dotted line in the workflow schema, such as Add a step, etc.
-
In the workflow schema window, click the added While section to select it.
-
At the right of the window, on the Settings tab.
-
In the Step name field, enter a name for the workflow step.
- In the Execution condition template field, specify a condition in jq format that returns either the
trueorfalsestring. This is a required field if the Maximum number of iterations field is not set. - In the Maximum number of iterations field, specify the maximum number of iterations the loop can complete. This is a required field if the Execution condition template value is not set.
-
-
Optionally, navigate to the Input tab and set a jq template to filter the workflow state fed into the step.
-
Optionally, navigate to the Output tab and set a jq template to filter the step outputs added into the workflow state.
-
To add a new step to an execution branch, drag the step you need from Integration steps or Control steps to the area marked by the dotted line within the branch.