History cleanup clarification (batches, TTL, scheduling)

Hi all.

Have question about history cleanup in Camunda. So, for my point we can delete historical data from ACT_HI_* tables if we configure TTL (using process definition xml/bpmn files, using REST API, using Java API). If i config process engine, set TTL, cleanup strategy defined as default. Correct me if i wrong: only thing that i need to do (if want to delete historical data) - set TTL somehow. It’s all.

Okay, another point about cleanup.

By default, no cleanup window is configured. In that case, history cleanup is not performed automatically.

What does this mean? Isn’t the deletion of historical data executed by job engine internally? Why i must care about scheduling?

I would be glad if you clarify these details.

2 Likes

Too late response, but maybe it will help some other people who open this thread.
Regarding the cleanup window, as far as I understand, if you set TTL for process definitions, history batches, jobs, etc. it’s not enough. To make Camunda really delete that data you need to run the cleanup job. You can do it manually from Cockpit (it’s EE feature), or you can do it via REST call (for example, in our project we created a timer in our Node.js application that perform REST call to Camunda every day Clean up history (POST) | docs.camunda.org to start the cleanup job, or you can configure a cleanup window so Camunda will run cleanup job automatically at that time, for example, you can put this in your application.yml file:

camunda.bpm:
  generic-properties:
    properties:
      history-cleanup-batch-window-start-time: "20:00"
      history-cleanup-batch-window-end-time: "23:59"