Variables
A variable is a named container where you store data for later use. They are the mechanism with which information travels between activities: one activity saves its result in a variable, and another activity reads it from there.
Without variables, each activity would be isolated. With variables, you can read an email, extract its subject, transform it, and write it into Excel — chaining the data from one step to the next.

The Variables Panel
Section titled “The Variables Panel”Variables are managed in the bottom panel of the Designer. Each variable has:
- Name — how it is referenced in expressions.
- Type — what kind of data it contains (text, number, table…). See Data Types.
- Initial value (optional) — what value it starts with before any activity modifies it.
Declare a variable
Section titled “Declare a variable”- In the variables panel, click + New variable.
- Enter a name (see rules below).
- Choose the type of data.
- Optionally, assign an initial value.

Rules for names
Section titled “Rules for names”| Regla | Bien | Mal |
|---|---|---|
| No spaces | numeroFactura | numero factura |
| No accents or symbols | clienteId | clienteId# |
Starts with letter o _ | total, _temp | 1total |
| Capital sensitive | total ≠ Total | — |
Capture the result of an activity
Section titled “Capture the result of an activity”Most activities that produce data have an Output field in the properties panel. There you write the name of the variable where you want to save the result. If the variable does not exist, it is created with the correct type.
Example: an HTTP GET activity with Output = respuesta saves its result in respuesta. In the following activities you can read:
= respuesta.StatusCode // 200= respuesta.Ok // true= respuesta.Body // cuerpo de la respuesta
Use a variable
Section titled “Use a variable”In any parameter field, type an expression (starting with =) that references the variable:
= correo.Subject= "Hola " + nombreCliente= total > 1000Remember: a field that does not begin with = is treated as literal text. To read a variable, you always need the =.
Iteration variables (For Each)
Section titled “Iteration variables (For Each)”Some activities create variables automatically. The most common is For Each: it loops through a collection and, on each return, puts the current element into a variable you name (the iterator).
For Each collection = correos iterator = correo └─ body: Log message = = "Procesando: " + correo.SubjectHere correo exists only within the loop, and changes on each loop. You don’t need to declare it in the panel: For Each creates it.
Alcance (scope)
Section titled “Alcance (scope)”- The variables you declare belong to the playbook where you created them.
- If you invoke another playbook with Invoke Playbook, they do not automatically share variables. Instead:
- You pass it data like inputs.
- You receive data as outputs.
This keeps each playbook isolated and reusable: a sub-playbook can’t accidentally “dirty” the caller’s variables.
main: Invoke Playbook playbook = procesar-factura inputs = { factura: = facturaActual } output = resultadoPatrones comunes
Section titled “Patrones comunes”| Necesito… | How |
|---|---|
| an accountant | Variable int with initial value 0; on each turn, Set Variable = contador + 1 |
| Accumulate in a list | Variable List; use List Add or = listAdd(items, valor) |
| A flag (yes/no) | Variable boolean with initial value false; you put it in true when something happens |
| Build a text | Variable string; concatenate it with = texto + "linea\n" (or concatenate parts) |
Variables del sistema
Section titled “Variables del sistema”In addition to your variables, each run exposes a set of read-only system variables with information about the current process. You do not declare them —they are already available— and you read them in any expression prefixing $:
| Variable | Contiene |
|---|---|
$system_execution_id | The ID of this run (the same one you see in Zoan Cloud). |
$system_process_name | The name of the process that is running. |
$system_process_version | The version of the published process/package. |
$system_process_id | The process identifier. |
$system_environment_id | The identifier of the environment where it runs. |
$system_entry | The entry playbook (the one that starts the execution). |
For example, to record in a log which process and execution generated a data:
Log message = = "Procesado por " + $system_process_name + " v" + $system_process_version + " (exec " + $system_execution_id + ")"Common errors
Section titled “Common errors”| Symptom | Causa | Solution |
|---|---|---|
Variable no declarada | You used a variable that does not exist in the panel | Declare it, or check that the name matches exactly |
| An expression returns null | Typing error in name (upper/lowercase) | Total and total are different — check the exact name |
| The value “is not saved” between activities | You expected it to be saved but the activity did not have an Output field configured | Make sure you put a name in the Output field |
| Field saves the literal name instead of the value | You forgot = at the beginning | Prepend = to read the variable |
Next steps
Section titled “Next steps”- Data types — what you can do with each variable type.
- Expressions — read and transform variables.
- Debug — inspect the values of your variables when running.