Compensating Transaction¶
When atomic rollback is impossible, apply compensating actions that restore an acceptable state after partial completion.
The Diagnostic Story¶
Symptom: A multi-step process partially completes, fails, and leaves accounts, records, inventory, obligations, or expectations out of balance. The team says it was rolled back, but customers, counterparties, or downstream systems still experience effects. Refunds, credits, manual fixes, and apologies are improvised with no consistent rule. Compensation is applied twice, not at all, or in the wrong order because ownership and triggers are unclear.
Pivot: Define compensation steps, triggering conditions, ownership, reconciliation targets, an audit trail, and verification criteria — making governed counteraction the explicit response for cases where exact rollback cannot repair partial or irreversible effects.
Resolution: Recovery from partial failure becomes more predictable because compensation triggers and owners are defined before failure occurs rather than improvised during it. Affected parties receive appropriate notice and correction. The original failure and compensation path are documented and verifiable, and recurring compensation events reveal where stronger design is needed.
Reach for this when you hear…¶
[e-commerce operations] “The payment went through but fulfillment failed three steps later — we need a defined refund path, not a ticket to customer support each time.”
[distributed systems] “We cannot roll back the external API call, so we need a compensating action that puts the system into an acceptable state instead of pretending we can undo it.”
[legal transactions] “The contract was partially executed when the deal fell through — we need a clear rescission process that actually makes both parties whole, not just a signature on a cancellation form.”
Mechanisms / Implementations¶
- Saga Pattern (
saga_pattern):: This workflow protocol implements the archetype when it implements long-running distributed work as a chain of local actions with defined compensating actions when later steps fail. - Financial Reversal or Credit (
financial_reversal_or_credit):: This procedure implements the archetype when it uses refund, credit, chargeback, reversal, adjustment, or balancing entry to offset a completed financial effect that cannot simply vanish. - Contract Cure Provision (
contract_cure_provision):: This legal clause implements the archetype when it defines how a party can repair a breach or incomplete performance through notice, correction, replacement, payment, or other cure. - Service Recovery Playbook (
service_recovery_playbook):: This procedure implements the archetype when it guides apology, escalation, replacement, refund, credit, repair, and follow-up after a service failure has already affected someone. - Remediation Plan (
remediation_plan):: This plan implements the archetype when it specifies corrective work, owners, deadlines, evidence, and acceptance criteria for restoring acceptable condition after harm or noncompliance. - Corrective Action Request (
corrective_action_request):: This document implements the archetype when it creates a formal request to correct a defect, nonconformance, incident, or partial failure and to verify that the cure is complete. - Operational Reconciliation Workflow (
operational_reconciliation_workflow):: This workflow implements the archetype when it compares expected and actual states after partial completion, then applies adjustments until records, obligations, inventory, or accounts balance acceptably. - Clinical Correction Protocol (
clinical_correction_protocol):: This protocol implements the archetype when it coordinates disclosure, corrective care, monitoring, record amendment, and follow-up when a clinical action cannot be undone exactly. - Customer Make-Whole Credit (
customer_make_whole_credit):: This policy implements the archetype when it offers replacement, account credit, restitution, or extra service to restore customer acceptability after a failed or incomplete transaction. - Incident Corrective Action Register (
incident_corrective_action_register):: This artifact implements the archetype when it tracks compensating actions, residual risks, owners, due dates, evidence, and closure status across incidents.
- Clinical Correction Protocol
- Contract Cure Provision
- Corrective Action Request
- Customer Make-Whole Credit
- Financial Reversal or Credit
- Incident Corrective Action Register
- Operational Reconciliation Workflow
- Remediation Plan
- Saga Pattern
- Service Recovery Playbook
Related Abstractions¶
Abstractions this archetype builds on — directly (a source ingredient) or as a related pattern. Links follow the typed catalog namespace.
Built directly on (3)
- Irreversibility: Cannot revert state.
- State and State Transition: Captures system condition and evolution.
- Transaction: All-or-nothing operations.
Also references 10 related abstractions
- Accountability: Responsibility for actions.
- Causality: Cause-effect relationships.
- Closure: Ensures operations remain within a set.
- Constraint: Limits possibilities to guide outcomes.
- Continuity: Smooth change without jumps.
- Data Integrity: Accuracy and consistency preserved.
- Fault Tolerance: Continue operating under failure.
- Observability: Infer internal state externally.
- Procedural Fairness (Due Process): Due process.
- Resilience: Absorb shocks and adapt.
Variants¶
Narrower or domain-specific specializations that share this archetype's core structure. Recognized variants are established; candidate variants are provisional.
Saga-Based Compensation · implementation variant · recognized
Coordinate a distributed multi-step process through local commits paired with compensating actions for later failure.
Contractual Cure Compensation · domain variant · recognized
Use notice, cure periods, replacement performance, payment, amendment, or waiver to repair a breached or incomplete obligation.
Service Recovery Compensation · domain variant · recognized
Restore customer, client, patient, or participant acceptability after a service failure through apology, correction, credit, replacement, or follow-up.
Operational Reconciliation Compensation · mechanism family variant · recognized
Compare expected and actual states after partial completion, then apply balancing or corrective entries until the process is acceptable.