Skip to content

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.

variables panel at the bottom, with several variables, their type and initial value.

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.
  1. In the variables panel, click + New variable.
  2. Enter a name (see rules below).
  3. Choose the type of data.
  4. Optionally, assign an initial value.

variable creation row with name, type selector and initial value.

ReglaBienMal
No spacesnumeroFacturanumero factura
No accents or symbolsclienteIdclienteId#
Starts with letter o _total, _temp1total
Capital sensitivetotalTotal

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

HTTP GET properties panel with Output field highlighted.

In any parameter field, type an expression (starting with =) that references the variable:

= correo.Subject
= "Hola " + nombreCliente
= total > 1000

Remember: a field that does not begin with = is treated as literal text. To read a variable, you always need the =.

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.Subject

Here 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.

  • 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 = resultado
Necesito…How
an accountantVariable int with initial value 0; on each turn, Set Variable = contador + 1
Accumulate in a listVariable 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 textVariable string; concatenate it with = texto + "linea\n" (or concatenate parts)

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 $:

VariableContiene
$system_execution_idThe ID of this run (the same one you see in Zoan Cloud).
$system_process_nameThe name of the process that is running.
$system_process_versionThe version of the published process/package.
$system_process_idThe process identifier.
$system_environment_idThe identifier of the environment where it runs.
$system_entryThe 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 + ")"
SymptomCausaSolution
Variable no declaradaYou used a variable that does not exist in the panelDeclare it, or check that the name matches exactly
An expression returns nullTyping error in name (upper/lowercase)Total and total are different — check the exact name
The value “is not saved” between activitiesYou expected it to be saved but the activity did not have an Output field configuredMake sure you put a name in the Output field
Field saves the literal name instead of the valueYou forgot = at the beginningPrepend = to read the variable
  • Data types — what you can do with each variable type.
  • Expressions — read and transform variables.
  • Debug — inspect the values ​​of your variables when running.