Skip to main content
Version: v5.0

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_WHILE task within another DO_WHILE task is not supported.

Parameters

ParameterTypeRequiredDescription
_nameStringNoName the do-while task.
_typeStringYesEnter DO_WHILE.
_sequencenoNumberNoDefines the execution order of the task within a workflow.
_inputParamsObjectNoKey-value pairs representing input parameters for the task.
valueNumberNoExample input parameter used in the loop condition.
_loopConditionStringYesEnter a loop expression that is evaluated on each iteration.
_loopOverArray of ObjectYesList 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"
}
}
]
}