Compensation Flow

Compensation Flow

Intro

In BPMN, a compensation flow defines activities performed to roll back a transaction and compensate prior work. It matters because complex processes need safe recovery paths when exceptions occur.

Key points:

  • Provides controlled rollback for transactional sub‑processes.
  • Reduces risk by reversing effects of completed activities.
  • Common use cases: order cancellations (BPM), refund handling (Apps), data corrections, resource release (Tech).
  • Pitfall: forgetting to model idempotent compensation, causing duplicate reversals.

Examples:

  • Canceling a shipment triggers inventory restock and customer notification.
  • Reversing a billing entry when a payment fails downstream.
  • Revoking access rights after a failed onboarding process.

In practice:

Design compensation activities explicitly and test them under exception scenarios to ensure consistent outcomes.

Related terms: bpmn; sub-process; transaction

FAQs:

Q: How is a compensation flow triggered in BPMN?
A: From a compensate end or intermediate event.

Q: Does compensation undo all work?
A: It undoes specified activities; design what must be reversed.

‍