Flow file reference
A flow is one YAML file in the .truss/flows/ folder of a project. This page is the map: every key
you can write, whether it is required, and where it is explained. TRUSS rejects a key it does not
know, so a typo never silently changes what runs. truss validate checks a file without running it.
A complete example
Section titled “A complete example”version: "1" # required
flow: # optional name: nightly # default: the file name concurrency: 2 # steps at once; default 1 overlap: queue # queue | skip | parallel; default queue workdir: app # where steps start; default: the project folder kill_timeout: 10s # time to stop cleanly; default 10s
on: # optional: what starts the flow besides you schedule: - cron: "0 9 * * 1-5" # required in a schedule timezone: Europe/Berlin # default: this machine's time zone missed: skip # skip | run; default skip file: paths: [inbox/] # required in on.file ignore: ["**/*.tmp"] debounce: 5s # default 2s run: flow: build # required in on.run status: succeeded # succeeded | failed | any; default succeeded
env: # optional: variables for every step STAGE: nightly
secrets: [GITHUB_TOKEN] # optional: stored secrets for every step
notify: # optional on: [failure, recovered] # default: failure desktop: true
jobs: # either jobs ... build: steps: - id: compile # required run: make build # required timeout: 10m test: needs: [build] steps: - id: unit run: make test
# steps: # ... or a plain list of steps, never both# - id: hello# run: echo helloEvery key at a glance
Section titled “Every key at a glance”R means the key is required where it appears. Everything else is optional.
| Key | Default | Explained in | |
|---|---|---|---|
version |
R | here | |
flow |
here | ||
flow.name |
the file name | here | |
flow.concurrency |
1 |
here | |
flow.overlap |
queue |
here | |
flow.workdir |
the project folder | here | |
flow.kill_timeout |
10s |
Steps and jobs | |
on.schedule[] |
Triggers | ||
on.schedule[].cron |
R | Triggers | |
on.schedule[].timezone |
local time | Triggers | |
on.schedule[].missed |
skip |
Triggers | |
on.file.paths |
R | Triggers | |
on.file.ignore |
none | Triggers | |
on.file.debounce |
2s |
Triggers | |
on.run.flow |
R | Triggers | |
on.run.status |
succeeded |
Triggers | |
env |
none | Variables and secrets | |
secrets |
none | Variables and secrets | |
notify.on |
failure |
Notify | |
notify.desktop |
false |
Notify | |
notify.webhook.url |
R | Notify | |
notify.webhook.format |
generic |
Notify | |
notify.run |
none | Notify | |
steps |
one of the two | Steps and jobs | |
jobs |
one of the two | Steps and jobs | |
steps[].id |
R | Steps and jobs | |
steps[].run |
R | Steps and jobs | |
steps[].needs, env, secrets, dir, timeout, kill_timeout, retries, retry_delay, continue-on-error, if |
Steps and jobs | ||
jobs.<id>.steps |
R | Steps and jobs | |
jobs.<id>.needs, env, secrets, dir, if |
Steps and jobs |
A file must have at least one of steps or jobs, and not both. notify needs at least one of
desktop, webhook or run.
The truss.yaml project file has its own few keys: see Project and files.
Top level
Section titled “Top level”| Key | Required | Meaning |
|---|---|---|
version |
yes | The string "1", in quotes. A bare number 1 is rejected. |
flow |
no | The name of the flow and how it runs. Without it, the flow is named after its file. |
on |
no | What starts the flow besides you: schedule, file, run. |
env |
no | Variables for every step: Variables and secrets. |
secrets |
no | Stored secrets for every step: Variables and secrets. |
notify |
no | Who hears how a run ended: Notify. |
steps |
one of the two | A list of steps that can wait for each other. |
jobs |
one of the two | Named groups of steps that can wait for each other. |
Older files may call the flow block pipeline. TRUSS still reads it, but a file holds one or the other.
All keys are optional.
| Key | Default | Meaning |
|---|---|---|
name |
the file name without .yaml |
The name of the flow in logs, in TRUSS Desktop and for the daemon. |
concurrency |
1 |
The most steps that run at the same time. A whole number, at least 1. |
overlap |
queue |
What the daemon does when a run is requested while another run of this flow is active. |
workdir |
the project folder | The folder steps start in. Relative to the project folder, or absolute. The folder must exist. A job’s or step’s dir replaces it. |
kill_timeout |
10s |
How long a step has to stop on its own before it is killed. How a step is stopped. |
overlap values:
| Value | A second run request … |
|---|---|
queue |
waits and starts when the first run ends. |
skip |
is dropped and recorded as skipped. Good for schedules that must not pile up. |
parallel |
starts next to the first run. |
Recipes
Section titled “Recipes”A scheduled job that must never overlap itself
version: "1"flow: name: sync-photos overlap: skipon: schedule: - cron: "*/10 * * * *"steps: - id: sync run: rsync -a ~/Pictures/ /Volumes/backup/Pictures/ timeout: 9mA morning job that still runs when the laptop opens late
on: schedule: - cron: "0 9 * * 1-5" missed: runFan out, then fan in
version: "1"flow: name: release concurrency: 4steps: - { id: build, run: make build } - { id: unit, run: make test, needs: [build] } - { id: lint, run: make lint, needs: [build] } - { id: package, run: make dist, needs: [unit, lint] }Run only if a variable says so
steps: - { id: build, run: make build } - { id: deploy, run: make deploy, needs: [build], if: env.STAGE == 'prod' }