Skip to content

Workflows

lordraw77 edited this page Nov 26, 2026 · 2 revisions

Workflows

Automation — Steps that run when something happens, with approvals where you want a person.

Needs: workflow.manage to build, workflow.run to run, workflow.approve to approve

A workflow

A workflow with its description, a Run now button and the list of its runs.

A workflow starts from a trigger — by hand, on an interval, when an alert fires (any check or a chosen one) or by a webhook — and runs up to 20 steps, top to bottom. A step can run only if an earlier one succeeded, failed or printed some text, and can carry on after a failure.

The steps you can add

The Add a step bar groups them: Act on a host, Check something, and the Flow of the run. Nothing you type is ever run through a shell: each step builds its own exact operation from the fields.

  • Service — start, stop, restart, reload or check a systemd unit (a Windows service on a Windows agent). “Check it” succeeds when the service is running, or stopped if you choose.
  • Container — start, stop, restart or check a Docker container, on a host with the Docker capability reached through its agent.
  • Process — check that a process is running (or gone), or kill it by exact name with TERM, HUP, INT or KILL. To “restart” something use Service or Container: a bare process has no way back.
  • Proxmox guest — start, shut down, stop, reboot, take a snapshot of, or check a VM or LXC container. The step waits for the Proxmox task to finish (up to the seconds you set) and fails if the task fails.
  • Command — any command through the agent (no pipes or redirects). Mark it “only reads” if it changes nothing.
  • HTTP check — request a page of the node (scheme, port, path) and require a status and, optionally, some text in the answer.
  • Port check — require a TCP port of the node to be open (or closed).
  • Check state — read a check of the inventory and require a state, optionally waiting up to some seconds until it gets there: the way to ask "is it really healthy again?".
  • Wait — pause up to 10 minutes, for example between a restart and the check that follows.
  • Notification — send a message to a channel. Write {{step_id.output}} or {{step_id.status}} to quote an earlier step.
  • Approval — stop until a person approves.

Approval, retries and unattended steps

  • A step that changes something waits for a person before it runs (a restart, a stop, a kill, a reboot, a snapshot, a command that is not marked read-only). The run shows “waiting for approval” and anyone with workflow.approve decides.
  • Run without waiting for approval is the author's explicit choice on one step, for automatic fixes such as a restart started by an alert. The audit log records every such run (workflow.step.unattended) and what each changing step did (workflow.step.executed).
  • Try again repeats a failed step up to 5 times, 1 to 300 seconds apart: useful for a check right after a restart. A wrong setup (a command that is not allowed, a missing channel) is not retried.
  • If this step fails, carry on lets a later step react to the failure with its condition, for example “restart only if the status step failed”.

The visual editor

A workflow that restarts a container when it is down. The Add a step bar (Act, Check, Flow) adds a step; the graph shows the steps top to bottom, the amber dot connects a step to another to run it only after that outcome, and the panel on the right sets the selected step. Form and JSON show the same workflow.

⚠️ Warning — A workflow cannot change a host on its own unless you ticked Run without waiting for approval on that step. Start with the approval on, watch a few runs, and only then remove it.

A recipe: restart a service when its check fails

  1. Trigger When a check raises a problem, choosing the check of the service.
  2. Service status on the node, with “carry on if it fails”.
  3. Service restart, only if the status step failed, with “Run without waiting for approval”.
  4. Wait 5 seconds, then HTTP check (or Check state, waiting up to 60 seconds) with “Try again 3 times”.
  5. Two Notifications: one if the check succeeded, one if it failed, quoting {{verify.output}}.

💡 Tip — Ready-made recipes (restart on alert, container watchdog, snapshot then upgrade, stop a runaway process) are in the examples/workflows/ folder of the repository: paste one into the JSON tab and choose your own node and channel.


← Ansible · Home · GitOps →

Clone this wiki locally