Saga compensation design

Measure unresolved business states in the saga

A coordinator's success rate can hide workflows that remain partly committed. Track the business states and their age, including failed or uncertain compensation.

In this article

Define acceptable terminal states

A saga may end with the intended fulfilment completed, a fully resolved cancellation or a documented manual outcome. Define those states with the business owner and identify the evidence required from each service.

A technical state called failed is not necessarily terminal in business terms. Stock may remain reserved or an external operation may still be uncertain. Those effects need visibility until resolved.

Keep forward completion and compensated resolution separate in reporting. Both may be acceptable outcomes, but they represent different user experiences and operating costs.

Track the incomplete states by age

Measure workflows waiting on a forward step, an uncertain result, a compensation retry or human action. Report the oldest case in each consequential category.

Do not exclude dead-lettered or manually assigned sagas from unresolved counts. Moving the record to another queue does not resolve its business effect.

Use stable saga and operation identifiers to correlate service outcomes. Approximate matching by time or amount can make reconciliation unreliable when many similar operations occur.

Measure repeated and missing effects

Count duplicate forward or compensating effects separately from repeated network attempts. Retries can be expected under an idempotent contract, while an extra reversal or reservation is a correctness failure.

Include missing effects and incorrectly reported completion. A coordinator can reach a green state while one service never applied the intended change if it treats submitted commands as confirmed outcomes.

Break results down by workflow version and dependency. A schema or policy change may strand only older in-flight sagas.

Connect metrics to recovery capacity

Track automated recovery time and active operator effort. A low failure rate can still create an unmanageable backlog if each case takes hours to investigate.

Set escalation thresholds according to the consequence of the remaining effect. A held stock reservation and an irreversible shipment may need different urgency.

Acceptance should show that the workflow reaches an agreed business state or remains explicitly owned with a clear next action. A percentage of successful coordinator executions is useful context, but it cannot replace evidence about the effects left across participating services.

Primary sources

Microsoft Learn: compensating transactionsAWS Builders' Library: idempotent APIs

References checked 11 September 2026.