Compensation Event limitation workaround

Below is the screenshot camunda bpmn docs ver 7.4 Cancel and Compensation Events | docs.camunda.org



My understanding is that if I have two tasks executing in parallel and one of the task has a compensation trigger event attached to it for the other task then task has to be completed before we can trigger a compensation on that task.
E.g workflow
image

In the example above , how will i make sure task b is completed before the compensation throw event is executed in task a

You could add a conditional event between the error catch and the compensation throw.
The condition could be that task B has completed this would mean that even if task B is complete before or after the error event triggers it will always be compensated.

2 Likes

Thanks for the solution provided.