While
Type: while · Package: Core Activities v1.0.0
Repeats a block of activities as long as a condition is true. The condition is evaluated before each turn: if it is false from the beginning, the block is not executed even once. Use it when you don’t know in advance how many turns it will take — it depends on something that changes: “as long as there are more pages”, “as long as the queue has elements”, “until the balance reaches zero”.
How it works
Section titled “How it works”- Evaluate the condition.
- If true, execute
activitiesand return to step 1. - If false, terminate and continue the flow.
Supports Break (exit immediately) and Continue (jump to the next evaluation).
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
condition | expression | Boolean condition that is evaluated before each turn. Ex: = quedanPaginas. |
Optional parameters
Section titled “Optional parameters”Ninguno.
Subflows (lanes)
Section titled “Subflows (lanes)”activities requerido
Section titled “activities requerido”Activities that are executed in each round while the condition is true.
Example
Section titled “Example”Process a queue until empty:
Set Variable name = hayItem value = true
While condition = = hayItem └─ activities: Queue Get Item queue = "facturas" output = item If condition = = isNull(item) ├─ then: │ Set Variable name = hayItem value = false // ya no quedan: corta el bucle └─ else: Invoke Playbook path = "procesar.json" input = = { factura: item }Common errors
Section titled “Common errors”| Symptom | Causa | Solution |
|---|---|---|
| The loop never runs | The condition was already false upon entry | Check the initial value of the condition variables |
| Execution hangs | Infinite loop: condition never changes | It ensures that the body modifies the condition; adds a safety stop |