Events

Compensation Boundary Event

Attaches a compensation handler to an activity: if compensation is later triggered, the linked handler undoes this activity's completed work. Double circle with rewind arrows.

The Compensation Boundary Event is unlike other boundaries: it does not react while the activity runs — it registers the undo recipe for after the activity has completed. The dotted association links it to a dedicated compensation activity (marked with the rewind icon) that performs the undo when a Compensation Throw/End fires.

When to use and avoid

When to use

  • On every activity whose effects may need business undo later (bookings, charges, postings).

  • In sagas and transactions, to declare each step's inverse operation.

  • When the undo differs per activity — each gets its own handler.

When NOT to use

  • For handling failures during the activity — that is an Error Boundary.

  • When the work has no meaningful inverse — compensation can't manufacture one.

  • On activities that never complete before the potential rollback point — nothing to undo.

Business example

Declaring how to undo a hotel booking

Diagrama BPMN: Declaring how to undo a hotel booking
Declaring how to undo a hotel booking

Open this example in the HEFLO process editor and explore the diagram from the inside.

Open in the HEFLO editor →

Step by step

  1. Book hotel completes normally; its Compensation Boundary (highlighted) + associated handler Cancel hotel booking declare the undo.
  2. Later, payment is declined and compensation is thrown.
  3. The engine invokes the handler — the booking is cancelled even though the task had finished long before.

Differences

Compensation Boundary vs other boundaries

Other boundaries watch a running activity. The compensation boundary is dormant during execution and only matters after completion, when compensation is triggered. It also uses an association (dotted) to its handler, not a sequence flow.

FAQ

What marks the handler activity?

It is set as isForCompensation and rendered with the rewind marker; it can't be reached by normal sequence flow — only by compensation.

Does the handler see the original activity's data?

Yes — engines give it the completed activity's context so it can undo precisely (e.g. the booking id).

Related elements