# Historic instance deletion

**URL:** <https://forum.flowable.org/t/historic-instance-deletion/1117>\
**Category:** Flowable Engine\
**Created:** [October 27, 2017, 8:52am UTC](https://forum.flowable.org/t/historic-instance-deletion/1117 "2017-10-27T08:52:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dvs\_Prajapati](https://avatars.discourse-cdn.com/v4/letter/d/d26b3c/32.png) [@Dvs\_Prajapati](https://forum.flowable.org/u/Dvs_Prajapati)\
**Post date:** [October 27, 2017, 8:52am UTC](https://forum.flowable.org/t/historic-instance-deletion/1117/1 "2017-10-27T08:52:26Z")

</div>

Hi,

Do we have any provision or any functionality, In which we can set time, so after that time the completed instance will be deleted automatically ? Currently we delete the instances manually.

Thanks,  
Divyesh

---

<div class="post-metadata">

**Author:** ![Chris.Jennings](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Chris.Jennings](https://forum.flowable.org/u/Chris.Jennings)\
**Post date:** [November 14, 2019, 4:24pm UTC](https://forum.flowable.org/t/historic-instance-deletion/1117/2 "2019-11-14T16:24:31Z")

</div>

I am interested in how to make this process happen as well.  
Thanks!

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [November 20, 2019, 9:01am UTC](https://forum.flowable.org/t/historic-instance-deletion/1117/3 "2019-11-20T09:01:07Z")

</div>

There’s upcoming support for this, where the queries can now trigger a delete, see this unit test for example: [https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/test/java/org/flowable/engine/test/bpmn/HistoricDataDeleteTest.java#L45](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/test/java/org/flowable/engine/test/bpmn/HistoricDataDeleteTest.java#L45)

There are also settings to enable automatic cleanup, as you describe above, see [https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cfg/ProcessEngineConfigurationImpl.java#L756](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cfg/ProcessEngineConfigurationImpl.java#L756)

---

<div class="post-metadata">

**Author:** ![anthony](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@anthony](https://forum.flowable.org/u/anthony)\
**Post date:** [November 25, 2019, 3:25pm UTC](https://forum.flowable.org/t/historic-instance-deletion/1117/4 "2019-11-25T15:25:20Z")

</div>

For the automatic cleanup, is that something that can be set by an external config, or does that require a code change?

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [December 4, 2019, 5:40pm UTC](https://forum.flowable.org/t/historic-instance-deletion/1117/5 "2019-12-04T17:40:08Z")

</div>

That’s set on the engine configuration. That’s the enableHistoryCleaning and historyCleaningTimeCycleConfig properties from the second link.
