Skip to content

Templating

Strøm uses Tera for templating. Templates are rendered when a worker claims a step (or server-side for task actions).

Inside a step’s input templates and when conditions, you have access to:

VariableDescription
input.*Job-level input (from the API call or trigger)
<step_name>.output.*Output from a completed upstream step
secret.*Resolved workspace secrets
actions:
greet:
type: script
script: "echo Hello {{ input.name }}"
input:
name: { type: string, required: true }

When a step emits structured output (via OUTPUT: {json}), downstream steps can reference it in templates.

actions:
greet:
type: script
script: "echo Hello {{ input.name }} && echo 'OUTPUT: {\"greeting\": \"Hello {{ input.name }}\"}'"
input:
name: { type: string, required: true }
shout:
type: script
script: "echo {{ input.message }} | tr '[:lower:]' '[:upper:]'"
input:
message: { type: string, required: true }
tasks:
hello-world:
mode: distributed
input:
name: { type: string, default: "World" }
flow:
say-hello:
action: greet
input:
name: "{{ input.name }}"
shout-it:
action: shout
depends_on: [say-hello]
input:
# say-hello -> say_hello (hyphens become underscores)
message: "{{ say_hello.output.greeting }}"
  • Step names in YAML can use hyphens: say-hello
  • In template references, use underscores: {{ say_hello.output.* }}

Tera supports filters, conditionals, and more:

# Filters
script: "echo {{ name | upper }}"
script: "echo {{ name | default(value='World') }}"
# Conditionals
script: "{% if enabled %}echo Active{% else %}echo Inactive{% endif %}"

See the Tera documentation for the full feature set.

Task input defaults support Tera templates with access to secret.*. Defaults are rendered at job creation time, before the job is persisted:

tasks:
deploy:
input:
api_key:
type: string
default: "{{ secret.DEPLOY_KEY }}"

See Input & Output for full details on default values.

The | vals filter resolves secret references at template render time. See Secrets & Encryption for details.

env:
DB_PASSWORD: "{{ 'ref+awsssm:///prod/db/password' | vals }}"

Steps support a when field for conditional execution. The condition is a Tera template that evaluates to true or false when the step’s dependencies are met:

tasks:
conditional:
input:
run_checks: { type: boolean, default: false }
flow:
check:
action: validate
when: "{{ input.run_checks }}"
process:
action: process-data
depends_on: [check]
continue_on_failure: true
# Runs whether check ran or was skipped

See Conditional Flow Steps for the full feature documentation.