While Loop
while component: Conditional loop node. It executes the target node or rule chain repeatedly as long as the specified condition is met.
# Configuration
| Field | Type | Description | Default |
|---|---|---|---|
| condition | string | The loop condition expression using el expression language. E.g., msg.count==nil || msg.count < 5. | |
| do | string | The Node ID or Sub-Rule Chain ID to execute in each iteration. |
# Relation Type
- Success: After the loop finishes, the message is passed along the
Successchain. - Failure: If an error occurs during expression evaluation or iteration, the message is passed along the
Failurechain.
# Execution Result
Returns the result of the last iteration. The result of the previous iteration is used as input for the next iteration.
# Iteration Context Variables
During iteration, the component sets the following metadata variables:
_loopIndex: Current iteration index (starting from 0).
# Breaking the Loop
If the message metadata contains _break with value true during iteration, the loop terminates immediately.
# Configuration Example
{
"id": "s1",
"type": "while",
"name": "While Loop",
"configuration": {
"condition": "msg.count==nil || msg.count < 5",
"do": "s2"
}
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
Edit this page on GitHub (opens new window)
Last Updated: 2026/01/28, 09:25:09