Do While
Overview
The Do While task is a control flow task that repeatedly executes a set of tasks until a specified condition is no longer met. It provides loop-like behavior inside a workflow, allowing workflows to handle iterations dynamically.
Note: Nesting of a
DO_WHILEtask within anotherDO_WHILEtask is not supported.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
_name | String | No | Name the do-while task. |
_type | String | Yes | Enter DO_WHILE. |
_sequenceno | Number | No | Defines the execution order of the task within a workflow. |
_inputParams | Object | No | Key-value pairs representing input parameters for the task. |
value | Number | No | Example input parameter used in the loop condition. |
_loopCondition | String | Yes | Enter a loop expression that is evaluated on each iteration. |
_loopOver | Array of Object | Yes | List of tasks that are executed repeatedly while the loop condition is true. |
Sample request
{
"_name": "do_while_task",
"_type": "DO_WHILE",
"_sequenceno": 1,
"_inputParams": {
"value": 2
},
"_loopCondition": "$.do_while_task.iteration <= $.value",
"_loopOver": [
{
"_name": "rest_connector_task_1",
"_type": "REST_CONNECTOR",
"_sequenceno": 1,
"_inputParams": {
"_url": "<URL>",
"_auth": {
"_type": "NoAuth"
}
}
},
{
"_name": "script_execution_1",
"_type": "SCRIPT_EXECUTION",
"_sequenceno": 2,
"_inputParams": {
"_userType": "workflow_userType",
"_scriptName": "iaffetch"
}
}
]
}