Use this when workflows undo completed steps.
Rollback · Workflow Automation
Rollback in workflows runs compensating steps in reverse order when a later step fails, undoing what earlier steps did, also known as the saga pattern.
1. Rollback/compensation undoes completed steps after failure.
2. Saga pattern for distributed workflows.
3. Test compensation.
4. Some actions can't be undone — plan.
5. Log rollbacks.
failure → compensating steps in reverse
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as branch condition drift, hidden dependency, duplicate parallel mutation, approval bypass, retry storm, partial rollback and successful orchestration with failed consumer state, choosing the cases most relevant to restore/revert identity, scope, prerequisites, dependency order and proving target/service state returns to the last known-good contract.
Step 2 Common mistakes Narrow the fault
- Rollback steps that were never tested.
- Rollback that fails silently and leaves partial state.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Compensating steps undo completed work in reverse.
- This is the saga pattern.
- Test compensations.
- Compensation steps (saga) — rollback logic
- Rollback tests — proof
- Partial completion handling — state
ReferenceWhy it matters1 section · depth on demand
What it is
Workflow rollback runs compensating steps in reverse order when a later step fails (undo VLAN, remove DNS record).
ReferenceImportant terms & boundaries1 section · depth on demand
Worked example
Rollback in a workflow undoes completed steps when a later step fails. Because steps often act on different systems, workflow rollback is usually done with compensating actions: each step that changes something has a matching step that reverses it, and on failure they run in reverse order (the saga pattern).
Worked example: provisioning a VM — (1) reserve IP in IPAM, (2) create DNS record, (3) create VM, (4) register in monitoring. If step 3 fails, the workflow runs compensations for 2 and 1: delete the DNS record, release the IP. Without them, every failed run leaks an IP reservation and a DNS entry.
Design compensations to be idempotent and tolerant of partially completed steps, and record when a compensation itself fails — that needs a human.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Workflow Automation > Rollback. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax · confidence 94%