From 5a69abb830319e625b305fb2f4744aca5e4be526 Mon Sep 17 00:00:00 2001 From: Anna Geller Date: Tue, 9 Jan 2024 21:14:21 +0100 Subject: [PATCH] doc: add variables and links --- content/docs/01.getting-started.md | 2 -- content/docs/03.concepts/flow.md | 14 +++++------ content/docs/03.concepts/variables.md | 33 ++++++++++++++++++++++++++ public/docs/getting-started/saved.png | Bin 6692 -> 0 bytes 4 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 content/docs/03.concepts/variables.md delete mode 100644 public/docs/getting-started/saved.png diff --git a/content/docs/01.getting-started.md b/content/docs/01.getting-started.md index cb2688fd8d..d0ea092705 100644 --- a/content/docs/01.getting-started.md +++ b/content/docs/01.getting-started.md @@ -66,8 +66,6 @@ tasks: Click on **Save** and then on the **Execute** button to start your first execution. -![Your first flow saved](/docs/getting-started/saved.png) - ::next-link [For a more detailed introduction to Kestra, check our Tutorial](01.tutorial/index.md) diff --git a/content/docs/03.concepts/flow.md b/content/docs/03.concepts/flow.md index 0b66bc4bba..a504d99fc6 100644 --- a/content/docs/03.concepts/flow.md +++ b/content/docs/03.concepts/flow.md @@ -2,19 +2,17 @@ title: Flow --- -A flow is a container for `tasks`, their `inputs`, `outputs`, handling of `errors` and overall orchestration logic. It defines the **order** in which tasks are executed and **how** they are executed, e.g. **sequentially**, i**n parallel**, based on upstream task dependencies and their state, etc. +A flow is a container for `tasks`, their `inputs`, `outputs`, handling of `errors` and overall orchestration logic. It defines the **order** in which tasks are executed and **how** they are executed, e.g. **sequentially**, **in parallel**, based on upstream task dependencies and their state, etc. -**Flows** are used to implement your workload. They define all the tasks you want to perform and the order in which they will be run. +You can define a flow declaratively using a [YAML](https://en.wikipedia.org/wiki/YAML) file. -You define a flow using the declarative model called [YAML](https://en.wikipedia.org/wiki/YAML). +A flow must have an identifier (`id`), a `namespace`, and a list of [`tasks`](tasks.md). -A flow must have an identifier (`id`), a `namespace`, and a list of [`tasks`](./02.tasks.md). - -A flow can also have [`inputs`](./inputs.md), [error handlers](./07.errors-handling.md) under the property `errors`, and [`triggers`](./triggers/index.md). +A flow can also have [`inputs`](inputs.md), [error handlers](errors.md), and [`triggers`](triggers/index.md). ## Flow sample -Here is a sample flow definition. It uses tasks available in Kestra core for testing purposes. +Here is a sample flow definition. It uses tasks available in Kestra core for testing purposes, such as the `Return` or `Log` tasks, and demonstrates how to use `labels`, `inputs`, `variables`, `triggers` and various `descriptions`. ```yaml id: hello-world @@ -51,7 +49,7 @@ taskDefaults: ### Task defaults -You can also define `taskDefaults` in your flow. This is a list of default task properties that will be applied to each task of a certain type inside your flow. The `taskDefaults` property can be handy to avoid repeating the same values when leveraging the same task multiple times. +You can also define `taskDefaults` in your flow. This is a list of default task properties that will be applied to each task of a certain type inside your flow. The [taskDefaults](task-defaults.md) property can be handy to avoid repeating the same values when leveraging the same task multiple times. ### Variables diff --git a/content/docs/03.concepts/variables.md b/content/docs/03.concepts/variables.md new file mode 100644 index 0000000000..7f61072de1 --- /dev/null +++ b/content/docs/03.concepts/variables.md @@ -0,0 +1,33 @@ +--- +title: Variables +--- + +Variables are key-value pairs that can be used many times in your flow. 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: + +```yaml +id: hello-world +namespace: dev + +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 to process various expressions with filters and functions. More information on variable processing can be found under [Expressions](expression/01.index.md). + + diff --git a/public/docs/getting-started/saved.png b/public/docs/getting-started/saved.png deleted file mode 100644 index 259f3aea7b3ebf6fedd37c717f65839618415fb4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6692 zcma)BbyQT}zK4N97&?X$LAqPIV?de#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