What are Variables?
Variables are named containers used to store and manage data during the execution of a workflow. They allow you to capture information from one action—such as text from a web page or a calculation result—and use it in subsequent actions.
In Talos, there are two main categories of variables:
1. Internal Variables
These are variables that you define and manage within your process. You can create them using the Set Variable Action or by specifying an Output Variable in actions that return data (like reading a file or performing OCR).
- Scope: Local to the process where they are defined.
- Persistence: Exist only during the execution of the process.
2. Runtime Variables
Runtime variables are automatically provided by the Playback engine at the start of execution. These include system-level information and environment configuration that your process might need to adapt to different machines or environments.
Environment Variables (__env__)
One of the most powerful runtime variables is the __env__ object. This object contains all the key-value pairs defined when the Playback engine was launched.
You can define these variables using command-line arguments:
- Directly:
-Dkey=value - Via File:
--env-file .env
Accessing Environment Variables
Since __env__ is an Object, you can access its contents using square brackets or the GetValue function:
- Example:
${__env__}["API_KEY"] - Example:
${__env__}.GetValue("DATABASE_URL")
This allows you to create highly flexible processes that don't have hardcoded secrets or configuration values.
Variable Syntax
To use a variable in any property field that supports expressions, wrap the variable name in ${ }.
| Syntax | Description |
|---|---|
${VariableName} | Returns the value of an internal or runtime variable. |
${__env__}["key"] | Accesses a specific environment variable. |
For more advanced usage, including properties and functions you can call on variables, see the Writing Expressions section.