Variables
Variables are key-value pairs that help reuse some values across tasks.
You can also store variables on a namespace level so that they can be reused across multiple flows in a given namespace.
How to configure variables
Here is how you can configure variables in your flow:
id: hello-world
namespace: example
variables:
myvar: hello
numeric_variable: 42
tasks:
- id: log
type: io.kestra.core.tasks.debugs.Return
format: "{{ vars.myvar }} world {{ vars.numeric_variable }}"
You can see the syntax for using variables is {{ vars.variable_name }}
.
How are variables rendered
You can use variables in any task property that is documented as dynamic.
Dynamic variables will be rendered thanks to the Pebble templating engine. Pebble templating engine allows you to process various expressions with filters and functions. More information on variable processing can be found under Expressions.
Since 0.14, Variables are no longer rendered recursively. You can read more about this change and how to change this behaviour here.