Kestra provides some helper functions that can help during flow development.

Expand the flow to be uploaded to the server

There is a convenient command on the Kestra executable that allows validation of the current flow and will output the expanded version of your flow without any helper:

bash
./kestra flow validate path-to-your-flow.yaml

[[> file.txt]]: Include another file

Working on a large flow can become complex when many tasks are defined, especially when you have some big text inside the flow definition (example, SQL statement, ...).

Let's take an example:

yaml
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

You can replace the flow definition with this one:

yaml
id: include
namespace: company.team

tasks:
- id: t1
  type: io.kestra.plugin.core.debug.Return
  format: "[[> lorem.txt]]"

And have a local file lorem.txt with the large content in it.

The path can be:

  • [[> lorem.txt]]: a relative path from the flow (flow.yaml and lorem.txt are in the same directory),
  • [[> /path/to/lorem.txt]]: an absolute path,
  • [[> path/to/lorem.txt]]: a relative path from the flow (flow.yaml with a subdirectory path/to/).

When including a file, you must use the right YAML scalar type: literal (with or without quotes) for single-line scalars or folded for multiple-lines ones.

Validate the flow to be uploaded to the server

There is a convenient command on the Kestra executable that allows validation of the current flow:

bash
./kestra flow validate --local path-to-your-flow.yaml

Expand the flow to be uploaded to the server

There is a convenient command on the Kestra executable that allows expanding of the current flow. It will resolve includes if any:

bash
./kestra flow expand path-to-your-flow.yaml

Was this page helpful?