Workflows
A workflow is a small automation you write in YAML, in a style you know from GitHub Actions. It chains steps: call an HTTP API, judge what the response means, open a task for an agent when it matters. StratoNext keeps the definition, starts runs, records every step, and shows you what happened. The steps themselves execute on a runner, a machine you host inside your own network.
apiVersion: workflows.stratonext.com/v1kind: Workflowname: api-uptime-probedescription: Probe an endpoint and open an incident task when it is down.
on: manual: inputs: url: { type: string, required: true }
nodes: probe: uses: stratonext.http.request@v1 continue_on_error: true with: { url: "${{ inputs.url }}", timeout: 5s }
classify: needs: [probe] uses: stratonext.decide@v1 with: state: { status: "${{ nodes.probe.outputs.status }}" } decide: - when: ${{ state.status != 200 }} choice: down - choice: ok
incident: needs: [classify] if: ${{ nodes.classify.outputs.choice == 'down' }} uses: stratonext.task.create@v1 with: name: "API down: ${{ inputs.url }}" description: "Status ${{ nodes.probe.outputs.status }}. Check the load balancer and the latest deploy." project: prj_payments assignee: agt_oncallWhat a workflow is made of
Section titled “What a workflow is made of”- A trigger. Each workflow starts in exactly one way: manually (from the UI, the CLI or the API, with typed inputs), on a schedule, from a webhook call, or on a pull request event. A workflow that must start in more than one way is two workflows. Any workflow can also be started by another one, with the Run workflow node.
- Nodes. Each node is one step: call an HTTP API, run a script, make a decision, ask a person
for approval, create, read or cancel a task, or start another workflow. Nodes that depend on nothing run first;
needsorders the rest;ifskips a node when its condition is false. The node reference lists every node type. - Expressions.
${{ … }}reads inputs, variables and the outputs of earlier nodes.
Writing a workflow has the full reference.
Lifecycle
Section titled “Lifecycle”- Create a workflow in a workspace by pasting its YAML: Workflows → New workflow draws
the graph as you type and lists the problems still to fix. When the file is valid, the
workflow is published as version 1 and can run right away. Otherwise it is saved as a
Draft until you fix it and publish. Workflows belong to the workspace, not to a project:
each task node says which project its task is for. From the CLI,
stratonext workflow createtakes a file or a URL (see below). - Edit and try. Changes in the editor are a draft: saving never creates a version or changes what runs. The editor’s Run button runs the draft as it stands, as often as you like, and those runs show as Draft in the run list.
- Publish the draft to make it the next numbered version. Publishing checks the whole file, with line and column for every problem. Schedules, webhooks and pull request triggers only ever start the published version, and runs in progress keep the version they started with. You can only publish a workflow whose nodes do things you are allowed to do in the workspace, such as creating tasks.
- Run. A run starts from the workflow’s trigger, or with Run now on the workflow page for a manual workflow, using the current version. The run is queued for a runner of the workspace, executes step by step, and ends as Succeeded, Failed, Cancelled or Timed out.
- Restore an earlier version from the Versions tab to make it the current version again; the next publish numbers on from the highest version. Load into draft copies an old version’s YAML into the editor without changing what runs. Versions are never changed or deleted.
- Pause a workflow to refuse new runs without losing anything; resume it later. Delete cancels its runs in progress, removes its schedules and keeps its history for 90 days, after which the workflow and its runs are removed for good. The audit trail keeps its record.
A workflow’s status is therefore one of Draft (never published), Active or Paused.
Triggers
Section titled “Triggers”A workflow declares exactly one trigger under on.
Manual
Section titled “Manual”on: manual: inputs: service: { type: string, required: true } dry_run: { type: boolean, required: false, default: true }Started with Run in the UI, stratonext workflow run from the CLI, or the API. Starting a run
asks for the declared inputs and checks their types; read them as ${{ inputs.<name> }}. Only a
manual workflow has inputs.
Schedule
Section titled “Schedule”on: schedule: - cron: "0 8 * * 1" # every Monday at 08:00 UTC - cron: "rate(6 hours)"One or more entries, each a five-field cron expression or a rate(…) such as
rate(30 minutes). Times are in UTC. A schedule runs at most every 5 minutes, pauses with the
workflow, and is replaced when you publish a new version.
Webhook
Section titled “Webhook”on: webhook: {}Lets a workspace webhook start the workflow. The call’s JSON
body is available as ${{ trigger.payload }}, for example ${{ trigger.payload.service }}.
Pull request
Section titled “Pull request”on: pull_request: types: [opened, failed] repositories: [your-org/payments-api] branches: [main] # optional: only pull requests into these branchesStarts a run when a GitHub pull request event happens in one of the listed repositories. Each repository must be linked to a project of the workspace through your GitHub connection.
| Event | When |
|---|---|
opened |
A pull request was opened. |
merged |
A pull request was merged. |
failed |
A CI check on the pull request’s latest commit failed or timed out. |
The event is available as ${{ trigger.payload }}, with event, repository, number, url,
title, author, base, head and head_sha, plus merged_by for a merge and checks for a
failed check.
From the command line
Section titled “From the command line”Every stratonext workflow command that takes a file also takes an https:// URL, including a
GitHub file link, so a repository can stay the source of truth for a definition:
stratonext workflow validate ./probe.yaml --workspace-id wks_…stratonext workflow create https://github.com/your-org/ops/blob/main/workflows/probe.yaml --workspace-id wks_…stratonext workflow publish wfl_… ./probe.yaml # the next version, from a file or a URLstratonext workflow run wfl_… --draft # run the saved draft without publishing itstratonext workflow restore wfl_… --version 2 # make version 2 current againstratonext workflow show wfl_… # the YAML runs use; --draft for the draftcreate publishes version 1 when the file is valid, and otherwise saves a draft. Publishing,
restoring and running a draft are done by people: an agent can save a draft and ask a person to
publish it.
Where steps execute
Section titled “Where steps execute”Every step runs on a runner you host: the StratoNext runner image on Docker or Kubernetes, registered to the workspace and polling StratoNext for work. Each run gets a container of its own there, so runs never see each other’s files. Nothing in a workflow executes on StratoNext’s side, and StratoNext never connects into your network. That is what lets a workflow call an internal URL, and what keeps your API tokens on your machines.
A run goes to one runner and stays with it, except while it waits for a person to decide an approval: the runner then lets go of it and takes other runs, and the run continues on the first available runner once the approval is decided. The run does not start at all unless a runner of the workspace has every label the workflow asks for, so a run never stalls half-way on a step nobody can take. If no such runner is online, the run waits in the queue. See Runners for registering one, labels, secrets and what happens when a runner goes away.
Following a run
Section titled “Following a run”The run page shows:
- the graph of the workflow with each node’s state, taken branches highlighted and skipped ones dashed;
- the steps in the order they started, with duration and attempts;
- for each step: its resolved inputs, its outputs, the error if it failed, the runner it ran on and the log the runner streamed, with secret values masked;
- for a decision: the answers and the rule that matched;
- which runner holds the run, or, while it is queued, the labels it waits for;
- Waiting for approval as the run’s status while every open step waits for a person to decide an approval. The run counts as in progress, can be cancelled, and still ends at the run duration limit.
Cancel a run from the same page. The runner stops at the step it is on.
Limits
Section titled “Limits”| Nodes per workflow | 50 |
| Workflows per workspace | 100 |
| Runs of one workflow in progress at once | 10 |
| Run duration, queue time included | 24 hours |
| Wait for a runner before a run fails | 1 hour |
| Outputs of one node | 256 KB |
| Log kept per step | last 256 KB |