Helpers
Kestra provides a set of helper functions designed to make local flow development easier — especially when working with large or modular flows.
Helpers are only available during local flow development.
Before deploying your flows to a Kestra server, you must expand them first.
CI/CD pipelines automatically handle this expansion process.
Helpers cannot be used directly from the Kestra UI.
Expanding flows before upload
Use the flow validate command to validate and expand your flow locally.
This command will output the expanded version of your flow, resolving any helper references.
./kestra flow validate path-to-your-flow.yaml
[[> file.txt]]: Include external files
When working on large flows, inlining long scripts or SQL statements can make maintenance difficult.
The include helper lets you reference external files inside your flow YAML, keeping it clean and modular.
Example
Without helper
id: include
namespace: company.team
tasks:
- id: t1
type: io.kestra.plugin.core.debug.Return
format: |
Lorem Ipsum is simply dummy text of the printing
.....
500 lines later
With helper
id: include
namespace: company.team
tasks:
- id: t1
type: io.kestra.plugin.core.debug.Return
format: "[[> lorem.txt]]"
Then, create a local file named lorem.txt containing your text.
Supported path formats
| Format | Description |
|---|---|
[[> lorem.txt]] | Relative path from the flow file (both in the same directory). |
[[> /path/to/lorem.txt]] | Absolute path. |
[[> path/to/lorem.txt]] | Relative path from the flow directory (e.g., flow.yaml in parent folder). |
When including a file, ensure you use the correct YAML scalar type — literal (quoted or unquoted) for single-line values or folded for multiline content.
Includes are resolved recursively, meaning included files can themselves contain additional includes.
Be careful: if your included file needs to display [[ ... ]] literally, escape it as \[[ ... ]].
Local flow validation
To validate your flow locally (especially if it uses helpers), use the --local flag.
This ensures validation runs with the same plugins as your local environment.
./kestra flow validate --local path-to-your-flow.yaml
Flows using helper functions must be validated locally since the expansion process cannot run on the Kestra webserver.
Expand includes
To explicitly expand your flow (resolving includes and helpers) without validation, use:
./kestra flow expand path-to-your-flow.yaml
This command outputs a version of your flow ready for upload to the Kestra server.
Was this page helpful?