Skip to the content
Forge

Flow file

A flow file is YAML. For how flows work, see flows. Unknown keys are refused.

The file

Key Meaning
version Required, 1.
name The flow's name.
params Values given when the flow runs, each with a name, a type and a default; the steps use them as ${params.NAME}.
env Environment for every step, under the stage's and the step's own.
secrets Secrets for every inline step, as in the run spec.
stages The stages, in order.
gating How steps wait: needs (default) starts a step with needs as soon as those steps ended; stages starts each stage once the one before has ended.
fail_fast When a step fails, cancel the running steps and skip the waiting ones.
timeout_seconds The flow run's limit, up to 7 days.
concurrency group and policy, as in the run spec: one run of the flow's group at a time.
outputs The flow run's outputs, by name, filled in from its steps' as ${steps.STEP.outputs.NAME}.

A stage

Key Meaning
name The stage's name.
env Environment for its steps.
secrets Secrets for its inline steps.
steps Its steps, which run at the same time.

A step

A step is an inline run spec (all of its fields), or one of the kinds below, plus:

Key Meaning
name The step's name, unique in the flow.
if Its condition, such as git.branch == 'main' or failure(). Default: success().
needs Steps it waits for and whose artifacts it gets.
retry Its retry policy, as in a run file.
allow_failure true, or { exit_codes: [1, 2] }: the flow goes on when it fails.
changes Path globs: the step runs only when a changed file matches (always, when the changes aren't known).
matrix Values to run the step once for each combination of, as ${matrix.NAME}.
parallel Run N copies, as ${matrix.index} of ${matrix.total}, to split tests. A step has matrix or parallel.
max_parallel How many of a matrix step's copies run at once. Default: all.
fail_fast Cancel a matrix step's other copies when one fails.

Kinds of step

Key Meaning
template, version, params Run the project's template of that name, at a version (default the latest), with parameters.
approval Run nothing: wait for the environment's reviewers, then succeed.
flow, params Start another flow: a saved flow's name, or { from: STEP, path: FILE } for a flow file an earlier step wrote.

A step that starts a flow from a file can say what that flow may use: allowed_secrets, allowed_registries, allowed_environments, allowed_repositories and allowed_id_token_audiences.