Skip to content

Writing a workflow

A workflow is one YAML file. Its shape is deliberately close to a GitHub Actions workflow: a trigger, a map of nodes, needs between them, if conditions and ${{ }} expressions. Problems are reported with their line and column when you validate or publish, never at run time.

apiVersion: workflows.stratonext.com/v1
kind: Workflow
name: nightly-cost-review # kebab-case, unique in the workspace
description: One sentence on what it does.
on:
manual:
inputs:
service: { type: string, required: true }
budget: { type: number, required: false, default: 500 }
defaults: # inherited by every node
timeout: 5m
retry: { max_attempts: 2, backoff: exponential, interval: 5s }
runs-on: [linux, prod-vpc] # labels a runner must have; see Runners
container: python:3.12-slim # optional: the image runs execute in
vars: # static, non-secret values: ${{ vars.region }}
region: eu-west-1
nodes:
fetch: …
Key Meaning
apiVersion, kind Required. workflows.stratonext.com/v1 and Workflow.
name, description Identity and documentation. The name is a kebab-case slug, unique per workspace.
on The trigger: exactly one of manual (may declare typed inputs), schedule, webhook or pull_request. See Triggers.
defaults timeout and retry every node starts from.
runs-on Labels a runner needs for every node; a node can add its own. hosted runs on a hosted runner.
container Optional. The image runs execute in; without it, the runner’s own image. See Run in a container.
vars Static, non-secret values, read as ${{ vars.x }}.
nodes A map of node id to node. Ids are snake_case and unique. Order in the file does not matter; needs defines the graph.

Every run gets a container of its own, and every step of the run executes inside it: scripts, HTTP requests and decisions. The container is removed when the run ends. Without container, runs use the runner’s own image: Ubuntu with bash, sh, python3, uv, the AWS CLI, git and curl. Name another image when your steps need other tools:

container:
image: registry.example.com/ops/tools:2026.11 # any image, public or private
pull: if-not-present # or always
registry_auth: # runner secrets, never values
username: REGISTRY_USER
password: REGISTRY_TOKEN
resources: { cpus: 2, memory: 4g }
cache: true # keep /cache between runs (default)

container: python:3.12-slim on its own is enough for a public image.

  • Any image works, including images without a shell or Python: the runner brings its own step executor. A script step still needs its shell (bash, sh, python, pwsh) in the image.
  • Steps share the container, not files. Each script step starts in an empty scratch directory of its own, which is removed when the step ends. Pass what a later step needs through outputs (${{ nodes.<id>.outputs.stdout }}, or json when a script prints JSON), or do the work in one step: clone and build together. A relative working_directory is created inside the step’s scratch directory; an absolute one is any directory of the image.
  • Nothing carries over between runs except /cache, which belongs to the workflow. Package managers (pip, uv, npm, Go, Cargo) keep their caches there. Clear cache on the workflow’s page empties it for the runs that start afterwards.
  • Secrets stay on the runner. (On a hosted runner, they are the workspace’s stored secrets.) A step receives only the secrets it names, for as long as it runs. registry_auth names two runner secrets used to pull a private image.
  • HTTP requests leave from the container. localhost is the container itself, not the runner’s machine.

See A container per run for how runners do this.

A manual workflow can declare inputs under on.manual.inputs. Each has a type (string, number or boolean), whether it is required, an optional default and an optional description. Starting a run prompts for them and checks the types. An input with a default is never required. Workflows started by a schedule, a webhook or a pull request have no inputs; a webhook or pull request run reads ${{ trigger.payload }} instead.

nodes:
assess:
name: Is this worth a human's time? # shown on the graph; defaults to the id
description: Judge the vendor status against what our customers use.
needs: [fetch_status, fetch_incidents]
if: ${{ nodes.fetch_status.outputs.status == 200 }}
uses: stratonext.decide@v1
runs-on: [prod-vpc]
timeout: 2m
retry: { max_attempts: 3, backoff: fixed, interval: 10s }
continue_on_error: false
with: …
Key Meaning
uses The node type and its major version, <type>@v<major>.
with The node type’s inputs. Any string may contain ${{ }}.
needs The nodes that must settle first. A node with no needs runs first; several needs is a join.
if A condition evaluated when the node becomes ready. False means the node is skipped.
timeout How long one attempt may take: 30s, 5m, 2h. Waiting for a runner does not count.
retry max_attempts (including the first), backoff (fixed or exponential) and interval.
continue_on_error true lets the nodes after this one run even if it failed for good.
runs-on Extra labels a runner needs for this node.
name, description For people: shown on the graph and in the step details.

The graph must be acyclic, every needs target must exist, and an expression may only read the outputs of a node it depends on, directly or through other nodes. At most 50 nodes.

Skipping follows GitHub Actions. A node whose upstream failed or was skipped is skipped too, unless its if uses a status function: if: ${{ failure() }} runs a node when something before it failed, if: ${{ always() }} runs it regardless. A node marked continue_on_error counts as succeeded for the nodes after it.

A node’s uses picks what it does: send an HTTP request, run a script, decide, request an approval, create, read or cancel a task, or read an asset. The node reference lists every node type with its inputs and outputs.

${{ … }} is a small expression language, in the style of GitHub Actions.

  • Contexts: inputs, vars, trigger.payload (the webhook body or the pull request event), run (id, workflow_id, version, started_at), nodes.<id>.outputs.* and nodes.<id>.status. Inside a decision rule, also state, thresholds and answers.
  • Operators: == != < <= > >= && || !, parentheses, property and index access.
  • Literals: strings in single or double quotes, numbers, true, false, null.
  • Functions: contains(a, b), startsWith(s, p), endsWith(s, p), format(fmt, …), join(list, sep), toJSON(v), fromJSON(s), length(v), and the status functions success(), failure() and always() for if.
  • Time: now() is the current time in ISO 8601 UTC, and now('-2h') moves it, so “updated more than two hours ago” is state.updated_at < now('-2h'). timestamp(t) turns a time into seconds since 1970 for numeric comparison; timestamp() is now.

A string that is exactly one expression keeps the value’s type, so state: ${{ nodes.fetch.outputs.json }} passes an object. Inside a longer string the value is inserted as text.

The editor validates as you type, and the CLI validates a file without saving anything:

Terminal window
stratonext workflow validate ./nightly-cost-review.yaml

Publish from the UI or with the CLI. Every publish is a new numbered version; runs pin the version they started on, so publishing never changes a run in progress. Before publishing, run the draft from the editor (or stratonext workflow run <id> --draft) to try your changes. To go back, restore an earlier version from the Versions tab or with stratonext workflow restore.