How to trigger compensation in a call activity, based on event in parent process

We have a recursive BPMN process. That is, one path through the flow can result in a Call activity to another instance of the process (at arbitrary depth). One of the first steps in the process is to send an email.

While the subprocess is executing, the parent process needs to be able to cancel that subprocess (basically take back control). If that happens, the subprocess needs to send a “this was canceled” email. That feels like compensation.

Our initial model placed an interrupting Message Boundary event on the Call activity. The problem is that when the boundary event message is received, the subprocess is immediately stopped.

We expect there is a good pattern for modeling such use cases, but haven’t been able to find one that seems elegant and natural, through searches on this forum, studying the BPMN docs, or the Real-Live BPMN book.

I’ve included example BPMN models, omitting recursion for clarity.

CancelSubprocess2.bpmn (8.2 KB) SubProcessWithCompensation.bpmn (6.3 KB)

Any suggestions for this? Thanks so much!

I’m guessing this is either a common situation, and the answer is obvious to most; or that it’s somehow unique to how we’re modeling, and we should be taking a different approach. Would love some thoughts / guidance if there’s any to share?

See answer from @Niall on similar thread in Process Engine category