Skip to content

Commit

Permalink
docs: conditional inputs and outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-geller committed Dec 12, 2024
1 parent e8a98d9 commit 2594f28
Showing 1 changed file with 56 additions and 8 deletions.
64 changes: 56 additions & 8 deletions ui/src/assets/documentations/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,56 @@ Here is an example flow. It uses a `Log` task available in Kestra core for testi

```yaml
id: getting_started
namespace: dev

description: Let's `write` some **markdown** - [first flow](https://t.ly/Vemr0) 🚀
namespace: company.team
description: Let's `write` some **markdown**

labels:
owner: rick.astley
project: never-gonna-give-you-up
team: data
owner: kestrel
project: falco
environment: dev
country: US

inputs:
- id: user
type: STRING
required: false
defaults: Rick Astley
description: This is an optional input. If not set at runtime, it will use the default value "Rick Astley".
defaults: Kestrel
description: This is an optional input — if not set at runtime, it will use the default value Kestrel

- id: run_task
type: BOOLEAN
defaults: true

- id: pokemon
type: MULTISELECT
displayName: Choose your favorite Pokemon
description: You can pick more than one!
values:
- Pikachu
- Charizard
- Bulbasaur
- Psyduck
- Squirtle
- Mewtwo
- Snorlax
dependsOn:
inputs:
- run_task
condition: "{{ inputs.run_task }}"

- id: bird
type: SELECT
displayName: Choose your favorite Falco bird
values:
- Kestrel
- Merlin
- Peregrine Falcon
- American Kestrel
dependsOn:
inputs:
- user
condition: "{{ inputs.user == 'Kestrel' }}"

variables:
first: 1
Expand All @@ -103,6 +137,20 @@ tasks:
The variables we used are {{ vars.first }} and {{ render(vars.second) }}.
The input is {{ inputs.user }} and the task was started at {{ taskrun.startDate }} from flow {{ flow.id }}.
- id: run_if_true
type: io.kestra.plugin.core.debug.Return
format: Hello World!
runIf: "{{ inputs.run_task }}"

- id: fallback
type: io.kestra.plugin.core.debug.Return
format: fallback output

outputs:
- id: flow_output
type: STRING
value: "{{ tasks.run_if_true.state != 'SKIPPED' ? outputs.run_if_true.value : outputs.fallback.value }}"

pluginDefaults:
- type: io.kestra.plugin.core.log.Log
values:
Expand All @@ -111,7 +159,7 @@ pluginDefaults:
triggers:
- id: monthly
type: io.kestra.plugin.core.trigger.Schedule
cron: "0 9 1 * *" # every first day of the month at 9am
cron: "0 9 1 * *" # 1st of each month at 9am
```
You can add documentation to flows, tasks, inputs or triggers using the `description` property in which you can use the [Markdown](https://en.wikipedia.org/wiki/Markdown) syntax. All markdown descriptions will be rendered in the UI.
Expand Down

0 comments on commit 2594f28

Please sign in to comment.