Updating HistoryTimeToLive for a Deployed Process Definition

I have a question about updating the HistoryTimeToLive for an already deployed process definition, using this endpoint: PUT /process-definition/{id}/history-time-to-live.

Does this have any impact on currently running or completed process instances that are associated with the specified process definition?

Suppose we have configured the history cleanup strategy to be endTimeBased. Now we set the HistoryTimeToLive for an already deployed process definition to 0. Suppose we have some already completed process instances and some currently running process instances (all of which are associated with the process definition we just updated) Assume a few of these running process instances complete prior to the next run of the history cleanup job. So, the next time the cleanup job runs, will the history data for these completed process instances (either those that were already completed, or those that have completed in the interim) be deleted?

1 Like

In case we are talking about endTimeBased history cleanup strategy:
The process instances will be deleted, no matter if they were already finished before changing the history time to live or those finished after that.
The only requirement is that only historic instances associated with historic top-level instances which have already been ended can be cleaned-up.

(Of course, how many of finished process instance will be cleaned up depends on your configured batch window and amount of cleanable data.)

Great, thanks.

One more related question - If you manually start the cleanup process by hitting the endpoint POST /history/cleanup and set executeAtOnce to True, how long will this run? Since this is not running within a configured batch window, will it run until all data that is eligible to be deleted is deleted?

yep, correct
it will run until all “cleanable” data is deleted

Excellent. Thanks for the quick response.