Blocks & Flow EditorCommon
counter loop
Repeat a flow path while a counter comparison evaluates to true
The counter loop block repeats the connected flow path while a counter variable satisfies a comparison against a termination value. When the comparison is false, the flow exits from the false output.
Configuration
| Field | Description |
|---|---|
| Name | Optional display label. Defaults to the counter expression if empty. |
| Key | Counter variable name (msg, flow, or global scope). Auto-generated if blank. Must be null, undefined, or empty on first entry. |
| Initial | Starting value for the counter (number or property reference). Typically 0. |
| Stop | Operator and termination value. Loop continues while counter <operator> termination is true. |
| Operator | Comparison: <, <=, >, >=, or ==. |
| Termination | Value to compare against (number or property reference). |
| Increment | Amount added to the counter each iteration (default 1). |
| Set counter variable to … when exiting | Reset counter to null, undefined, or empty string on exit — useful for nested loops. |
Outputs
| Port | Label | Description |
|---|---|---|
| Lower | true | Fires while the comparison is true — connect loop body here |
| Upper | false | Fires when the comparison is false — loop finished |
Notes
- Example: Initial
0, Stop< 10, Increment1runs the body 10 times (0 through 9) - Wire the loop body back to the counter-loop input to increment and re-evaluate
- Avoid modifying the counter or termination values inside the loop in ways that prevent exit
- First entry requires the counter variable to be unset so Initial is applied