How to delete more than 100 days old running instances details from DB

Hi,

If I am using history level as none and then only running instances data will be stored in DB.
For example: my running instances are not completed, I want to delete the the instances and its related data from DB which are staying more than 100 days old then please let me know how can I do this. Thanks in advance.

Thanks,
Venkaiah.

Hi @venky1982,
have you seen the History Time To Live section in our documentation? This might answer your question. :slight_smile:

Let me know if it does!
Thomas

Write something that implements the following in your favourite language…

Hi GotnOGuts,

Thank you, could you please provide rest service details to get running instance details and its creation time and also deleting running instance details rest sevrice also please. Thank you.

Thanks,
Venkaiah.

Hi,

Could you please let me know in BPMN process can we define anywhere liek even it is running istance after some time it should auto deleted like that. I kept below but seems it is not deleting the Instance details.

Thanks,
Venkaiah.

Hey there :wave:
Have you applied the HTT on a process level or is this attached to a task?
According to you timer definition the history will be deleted after 5 days. If you do not want to wait that long you could enter PT15S for 15 seconds.

Looks like my suggesgted process was slightly over-simplified. You’d have to get a list of running instances, then grab their definitions, then grab the “Start” Id from the definition, and then finally determine the create time of the task with that ID for each process. That would tell you when the process instance started. When you know which process instance IDs have been running for over 100days, you pass the instance ID to the delete command.

I’m not saying that this is a good set of choices… just that this meets the requirements stated. Personally, I wouldn’t recommend doing this.

Another alternative would be to modify your process and adding an interrupting event-based sub-process that would fire after 100 days and issue a terminate in the process.

Overall REST Guide:

Get all Executions:

Delete an Instance