Do some action on history deletion from Cockpit or history clean-up

Hi guys! I am trying to figure out if I can create some listener when the process instance is deleted from history. When I delete history with rest call it’s not a problem, because I can do what I want in the same place by performing other rest calls. But I also need a way to do some actions, somehow, when finished process instances are deleted from Cockpit or by history clean-up job. I know that Camunda give me a way to implement History backend by myself, but it sounds like overhead and I think in my case the result, that I want to get, doesn’t worst it. I also tried to implement my custom listener onHistoryEven by using @EventListener annotation, but it seems that I can’t determine from HistoryEvent object that process instance deletion is performed. I also thought that I can don’t call history clean-up directly, but instead create some process with Service Task that will perform the necessary action and then run history clean-up from Java code, but in this case, I lose the possibility to delete history from Cockpit. So, my question is “Am I moving in the right direction, or maybe it can be done in another way?”