Workflows

Chaining multiple playbooks into automated multi-step pipelines with conditional branching.

What is a workflow?

A workflow is a directed sequence of playbook executions. Steps run in order; each step can branch on success or failure, letting you build pipelines like: provision servers → deploy app → run smoke tests → notify on failure.

Creating a workflow

Go to Workflows → New workflow. Give the workflow a name, then add steps using the visual builder.

Step configuration

  • PlaybookWhich playbook this step runs
  • InventoryTarget inventory for this step (can differ per step)
  • Run optionsExtra vars, vault, tags — same as the manual run dialog
  • On successWhich step to run next on success (or 'end')
  • On failureWhich step to run next on failure, or 'stop' to abort the workflow

Conditional branching

Each step has two exit paths: on_success and on_failure. Both can point to any other step or to the special values end (finish normally) or stop (abort and mark the workflow as failed).

text
[provision]
  ↓ success         ↓ failure
[deploy]         [notify-failure] → end
  ↓ success         ↓ failure
[smoke-tests]    [rollback] → [notify-failure] → end
  ↓ success
[notify-success] → end

Variable propagation

Variables output by one step can be passed to the next. Use Ansible’s set_fact module to register a variable in a playbook, then reference it as an extra var in the next step using the {{ var_name }} syntax in the extra vars field.

yaml
# In step 1 playbook
- name: Register deployed version
  set_fact:
    deployed_version: "{{ git_sha }}"

# In step 2 extra vars (set in the workflow builder)
# version: "{{ deployed_version }}"  ← resolved from step 1 output

Running a workflow

Click Run on a workflow. Execution proceeds step by step. The workflow execution view shows all steps with their status in real time — you can expand any step to see the full playbook output.

Workflow execution status

StatusMeaning
runningWorkflow is currently executing a step
successAll steps completed successfully
failedA step failed and the on_failure path led to stop
cancelledManually cancelled during execution

Scheduling and triggering workflows

Workflows can be scheduled with cron expressions (same as individual playbooks) and can be triggered by webhooks. This makes them suitable as the execution target for CI/CD pipelines.

Note
If a workflow is triggered while a previous execution of the same workflow is still running, the new trigger is queued and starts after the current one completes.