Expression
Expressions to dynamically render various flow and task properties.
Kestra's expressions use Pebble Templating along with flow's execution context to render various flow and task properties.
To dynamically set values for your tasks and flows, you can add an expression by using {{ expression_name }}
syntax. Dynamic expressions can be used on each task property that is documented as dynamic.
Kestra uses an integrated templating engine to dynamically render variables, inputs and outputs within the execution context.
Flows, tasks, executions, triggers, and schedules have default expressions. For example, {{ flow.id }}
allows accessing the identifier of a flow within an execution.
Flow inputs can be accessed using {{ inputs.myinput }}
, and task's output attributes are available as {{ outputs.task_id.output_attribute }}
expressions.
Most expressions are stored in the execution context. The execution context encompasses flow and execution, environment variables, global variables, plugin defaults, flow inputs, and task outputs. Expressions of a FILE-type are stored in Kestra's internal storage and fetched from there at execution time.
Expression Types
There are many ways to use expressions in Kestra. This page will guide you through different types of expressions.
Expression Usage
This page summarizes the main syntax of filters, functions, and control structures available in Pebble templating.
Filter
Filters can be used in expressions to perform some transformations on variables such as formatting a date, converting a string to uppercase, or joining a list of strings.
Function
Functions can be called to generate content. Functions are called by their name followed by parentheses () and may have arguments.
Operator
Operators are used to perform logical operations within templated expressions such as comparing values and performing arithmetic operations.
Tag
Tags are used to control the flow of the template. They are enclosed in {% %}.
Test
Tests are used to perform logical operations within templated expressions such as checking if a variable is defined or if a variable is empty.
Deprecated handlebars
Handlebars are deprecated and superseded by Pebble. These functions will be removed soon and are disabled by default.
Was this page helpful?