A compensation action is an action that is included in a workflow to ‘undo’ a transaction that has been completed earlier in the workflow.
Compensation actions may have to be included in workflows because the success of the entire workflow may rely on all included workflows successfully completing. If some of these included workflows are successful but some aren’t, then the compensating actions have to be executed to ensure that the overall system is left in a consistent state.
Compensation actions are required when dependent services, offered by different suppliers, are composed to create an integrated service. For example, say a meeting organiser has to book a room for a meeting then organise catering for the people attending the meeting. It may not be possible to do this concurrently as the numbers attending the meeting may not be known. If the room is booked but, subsequently, it transpires that no catering is available that day, then the booking must be cancelled by a compensating action.
If you found this answer helpful, please upvote and share with other students in your network.