How to clean long running processes with incident?

Hello. I am new to Camunda BPMN.

My goal is to remove a process that has been hanging for a long time with incidents (as an example, delete this process after a month).

The forum already has a similar question. The only problem is that bpmn diagrams are used here to implement the idea, but this does not suit me.

Little background:
We have 5 process states in Camunda: COMPLETED,EXTERNALLY_TERMINATED, INTERNALLY_TERMINATED, ACTIVE, SUSPENDED. The first three states indicate that the process is completed and its instance is deleted (runtime table ACT_RU_EXECUTIONS is clear). The remaining two states signal that the process is still running, despite the fact that there may be incidents.

I found this information from Yana answer.

I also found solution on forum to use incident handler. But I’m not sure that I am moving in the right direction. How can i implement this solution? Maybe it makes sense to hang the listener on the process during the processing of the incident and stop it after a month if the incidents have not ended (we use retry)?

Hi @Sland,

to continue the process execution after the incident is to retry the failed service call. Have a look at the docs for further details: https://docs.camunda.org/manual/7.11/webapps/cockpit/bpmn/failed-jobs/

Hope this helps, Ingo