# Delete process variables and history after process instance completed

**URL:** <https://forum.camunda.io/t/delete-process-variables-and-history-after-process-instance-completed/8330>\
**Category:** Discussion & Questions\
**Tags:** process-engine\
**Created:** [July 31, 2018, 10:13am UTC](https://forum.camunda.io/t/delete-process-variables-and-history-after-process-instance-completed/8330 "2018-07-31T10:13:41Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Yana](https://forum.camunda.io/user_avatar/forum.camunda.io/yana/32/28319_2.png) [@Yana](https://forum.camunda.io/u/Yana)\
**Post date:** [August 2, 2018, 6:48am UTC](https://forum.camunda.io/t/delete-process-variables-and-history-after-process-instance-completed/8330/6 "2018-08-02T06:48:08Z")

</div>

Hi @aminmc,

You need to configure `historyTimeToLive` in the process definition (1) and then you can either trigger the history cleanup manually (2) or configure it to run all the time/specific times (3).

Setting historyTimeToLive=0 will mean the historic process instances (and their data) will be ready for delete after they finished.

(1): [https://docs.camunda.org/manual/7.9/user-guide/process-engine/history/#history-time-to-live](https://docs.camunda.org/manual/7.9/user-guide/process-engine/history/#history-time-to-live)  
(2): [https://docs.camunda.org/manual/7.9/user-guide/process-engine/history/#manual-run](https://docs.camunda.org/manual/7.9/user-guide/process-engine/history/#manual-run)  
(3): [https://docs.camunda.org/manual/7.9/user-guide/process-engine/history/#periodic-run](https://docs.camunda.org/manual/7.9/user-guide/process-engine/history/#periodic-run)

Best regards,  
Yana

---

_[View the full topic](https://forum.camunda.io/t/delete-process-variables-and-history-after-process-instance-completed/8330)._
