Flows can have Input. They are parameters provided when starting a flow. They help make your flow more dynamic and reusable.

Defining inputs

We defined Inputs in the inputs section of the flow file. They must have a name and a type. You can also set a default value.

yaml
inputs:
  - name: isTutorial
    type: BOOLEAN
    default: true
TypeDescription
STRINGNo control is done on this input type (no parsing), can be any string.
INTMust be a valid integer (without any decimals).
BOOLEANMust be a valid true or false as string.

Discover more types on the input documentation.

Accessing inputs

Kestra includes a templating engine to access variables in your flow. Use the {{ variable }} syntax to access them. Find more on the variable documentation.

Inputs can be accessed in the flow using the {{ inputs.name }} syntax.

Add inputs to your flow

In our example, we will provide the URL of the CSV file we want to download in Input. But we will set a default value if the user doesn't provide it.

yaml
inputs:
  - name: url
    type: STRING
    default: "https://gist.githubusercontent.com/tchiotludo/2b7f28f4f507074e60150aedb028e074/raw/6b6348c4f912e79e3ffccaf944fd019bf51cba30/conso-elec-gaz-annuelle-par-naf-agregee-region.csv"
Click here to see the full flow
yaml
id: kestra-tutorial
namespace: io.kestra.tutorial
labels:
  env: PRD
description: |
  # Kestra Tutorial
  As you notice, we can use markdown here.
inputs:
  - name: url
    type: STRING
    default: "https://gist.githubusercontent.com/tchiotludo/2b7f28f4f507074e60150aedb028e074/raw/6b6348c4f912e79e3ffccaf944fd019bf51cba30/conso-elec-gaz-annuelle-par-naf-agregee-region.csv"
tasks:
  - id: download
    type: io.kestra.plugin.fs.http.Download
    uri: "{{ inputs.url }}"