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, task 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

Expression Types

There are many ways to use expressions in Kestra. This page will guide you through different types of expressions.

Expression Usage

Expression Usage

This page summarizes the main syntax of filters, functions, and control structures available in Pebble templating.

Filter

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.

JSON Filters

JSON Filters

JSON filters are used to manipulate JSON objects, often API responses.

Numeric Filters

Numeric Filters

Numeric filters are used to format numbers or convert strings to numbers.

Object Filters (Maps, Arrays and More)

Object Filters (Maps, Arrays and More)

Object filters help you manipulate maps and arrays.

String Filters

String Filters

String filters are used to manipulate strings i.e. textual data.

Temporal Filters

Temporal Filters

Temporals filters are used to format dates and timestamps.

YAML Filters

YAML Filters

YAML filters are used to turn YAML strings into objects.

Function

Function

Functions can be called to generate content. Functions are called by their name followed by parentheses () and may have arguments.

Operator

Operator

Operators are used to perform logical operations within templated expressions such as comparing values and performing arithmetic operations.

Tag

Tag

Tags are used to control the flow of the template. They are enclosed in {% %}.

Test

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

Deprecated handlebars

Handlebars are deprecated and superseded by Pebble. These functions will be removed soon and are disabled by default.