Templating
Strøm uses Tera for templating. Templates are rendered when a worker claims a step (or server-side for task actions).
Available context
Section titled “Available context”Inside a step’s input templates and when conditions, you have access to:
| Variable | Description |
|---|---|
input.* | Job-level input (from the API call or trigger) |
<step_name>.output.* | Output from a completed upstream step |
secret.* | Resolved workspace secrets |
Basic usage
Section titled “Basic usage”actions: greet: type: script script: "echo Hello {{ input.name }}" input: name: { type: string, required: true }Passing data between steps
Section titled “Passing data between steps”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 name rules
Section titled “Step name rules”- Step names in YAML can use hyphens:
say-hello - In template references, use underscores:
{{ say_hello.output.* }}
Tera features
Section titled “Tera features”Tera supports filters, conditionals, and more:
# Filtersscript: "echo {{ name | upper }}"script: "echo {{ name | default(value='World') }}"
# Conditionalsscript: "{% if enabled %}echo Active{% else %}echo Inactive{% endif %}"See the Tera documentation for the full feature set.
Input defaults with templates
Section titled “Input defaults with templates”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.
Secret references in templates
Section titled “Secret references in templates”The | vals filter resolves secret references at template render time. See Secrets & Encryption for details.
env: DB_PASSWORD: "{{ 'ref+awsssm:///prod/db/password' | vals }}"Conditional step execution
Section titled “Conditional step execution”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 skippedSee Conditional Flow Steps for the full feature documentation.