Reliability & Delivery · Distributed Consistency

Compensating Transaction

Record enough business context to execute compensating actions for completed steps. Compensation restores a valid state rather than attempting an impossible distributed rollback.

compensationrollbackeventual-consistency
The problem
How can completed work be undone when a distributed operation fails after some steps have already succeeded?
GateSift summary based on Microsoft Azure Architecture Center guidance. The wording, visualization, Azure mapping and analyzer context are original GateSift material.
Original GateSift visualization

How Compensating Transaction works

Completed business steps are reversed or neutralized through explicit compensating actions.

Partially completed work
Compensate
Valid restored state
1

Persist which steps completed and the business information needed to undo or offset them.

2

Run compensating actions in a safe order when the overall operation cannot complete.

3

Record compensation outcomes and escalate any compensation that also fails.

GateSift explanation

What this pattern helps you decide

Record enough business context to execute compensating actions for completed steps. Compensation restores a valid state rather than attempting an impossible distributed rollback.

Which failure mode or capacity limit is this pattern intended to contain?
Which thresholds, deadlines, state or compensation data must remain durable?
How will operators know the pattern activated and whether recovery succeeded?
Common Azure implementations

Where you may see it

  • Logic App catch scopes that invoke compensating actions
  • Durable Functions orchestration compensation
  • Service Bus commands that reverse earlier business operations
GateSift relevance

How the analyzers can surface it

  • Multi-step workflows with side effects but no compensation path
  • Catch scopes that only log and terminate after partial writes
  • BizTalk orchestrations with compensation blocks or long-running transactions

Pattern detection is contextual. GateSift should present these as architectural signals, not claim a pattern is implemented solely because one policy statement or adapter exists.

Source guidance and attribution

This page links to Microsoft Azure Architecture Center for the source architecture guidance. GateSift summaries, diagrams, Azure examples and analyzer signals are original. No endorsement by Microsoft is implied.

Back to pattern library