Skip to main content

Inputs

Workflow inputs allow you to parameterize workflows with typed values. Define inputs at the workflow level and provide them when triggering the workflow manually or through schedules.

Input types​

Workflows support three input types, each with type-safe default values:

TypeDescriptionDefault value type
stringText valuesString
boolBoolean true/false valuesBoolean
intInteger numeric valuesInteger

Defining inputs​

Define inputs as a map where keys are input names and values are input objects.

Example with all types:

inputs:
model_type:
type: string
required: true
description: Type of ML model to train

debug_mode:
type: bool
default: false
description: Enable debug logging

epochs:
type: int
default: 100
description: Number of training epochs

Input properties​

Common properties​

These properties are available for all input types.

type (required)​

The data type of the input.

Type: "string" | "bool" | "int"

Example:

type: string

required (optional)​

Whether this input must have a value.

Type: bool

Default: false

Behavior:

  • If you provide a default, the input always has a value (satisfied by the default)
  • If you don't provide a default, you must provide the input when triggering the workflow

Example:

required: true

description (optional)​

Human-readable description of the input.

Type: string

Example:

description: Model architecture (xgboost, random-forest, etc.)

String-specific properties​

String inputs support an additional secret property.

secret (optional)​

Whether this input contains sensitive data that should be masked in logs and the UI.

Type: bool

Default: false

Availability: Only available for type: string

Example:

inputs:
api_key:
type: string
secret: true

Type-specific defaults​

Default values must match the input type.

String defaults:

environment:
type: string
default: "production"

Boolean defaults:

dry_run:
type: bool
default: false

Integer defaults:

max_retries:
type: int
default: 3

Using inputs​

Reference inputs in expressions using ${{ .inputs.<name> }}. For more details, see Expressions.

In environment variables​

inputs:
model_type:
type: string
required: true

env:
MODEL_TYPE: "${{ .inputs.model_type }}"

In shell commands​

steps:
- name: Train model
run: python train.py --model ${{ .inputs.model_type }}

In Drive paths​

upload:
path: models/
destination: "drive://bucket/${{ .inputs.model_type }}/models/"

Providing input values​

Schedule triggers​

Schedules provide input values through the inputs field:

inputs:
dataset:
type: string
required: true

trigger:
schedule:
- cron: "0 0 * * *"
inputs:
dataset: full-training-set
- cron: "0 12 * * *"
inputs:
dataset: validation-set

Manual triggers​

When you manually start a workflow, provide input values through the trigger mechanism (UI, API, or CLI).

Type coercion in expressions​

When you use inputs in expressions, they automatically convert to strings. This allows inputs of different types to work anywhere string values are expected.

Input typeExpression result
stringUsed as-is
bool"true" or "false"
intDecimal string (for example, "100")

Example:

inputs:
debug_mode:
type: bool
default: false

env:
DEBUG: ${{ .inputs.debug_mode }} # Result: "false"

steps:
- run: |
if [ "$DEBUG" = "true" ]; then
echo "Debug mode enabled"
fi

For more details on type coercion, see Expressions.


Feedback