Variable Processing¶
Automation processes recipe variables as needed during order run execution. At the start of an order run, the system follows a specific hierarchy while compiling default and defined variables.
Note
Variables that reference secrets, such as toolchain credentials, are compiled only at the time they are needed. Runtime variables are processed as they are generated.
Variable set hierarchy¶
Recipe variables can be implemented as variable sets at different levels. The system overwrites a variable's value when that same variable is defined in two or more classes or levels.
The system follows a strict hierarchy. See Variables Hierarchy for complete details.
Variable values in resumed run¶
When resuming an order run, the system reloads predefined variables. If any runtime variables share the same names as kitchen overrides, base recipe variables, or variation overrides, their values are overridden. These predefined variables take precedence over values carried over from a previous run attempt.
Warning
If you create runtime variables or ingredient outflow variables that share names with predefined kitchen, recipe, or variation variables, you risk overriding the runtime values during order run resumes.
JSON conversion¶
When the system loads variables, it converts all JSON data types to Python data types automatically.
Any variables that you define in the UI will appear as the corresponding Python type when you review results in the Runtime Variables dialog of the Order Run Details page.
| JSON type | Python type | Example |
|---|---|---|
| Object | dict | |
| Array | list | |
| Integer | int | "integer_variable": 1 |
| Float | float | "float_variable": 3.14159 |
| Boolean | bool | "boolean_variable": true |
| String | str | "string_variable": "sample value" |
Variable availability and timings¶
Variables become available at different times during recipe variation execution.
| Variable group | Execution availability | Details |
|---|---|---|
| Default and pre-defined variables | At the beginning of recipe variation execution. | Includes base variables in variables.json, variation-level overrides in variations.json, and system variables |
| Variables produced in a node | On the node's data sources and sinks, and in downstream nodes. | |
| Variables produced in a data source | In tests defined in the same data source, in subsequent nodes' data sources, all node data sinks, and in downstream nodes. | |
| Variables produced in a data source of a container node | In /docker-share files for that node, in subsequent nodes' data sources, in all node data sinks, and in downstream nodes. |
These variables can be referenced in /docker-share/config.json or any other related file that goes into the container. |
| Variables produced in a data sink | In tests defined in the same data sink, in subsequent nodes' data sinks, and in downstream nodes. | |
| Variables produced across the whole recipe | For order run notifications. |