Can I delete the data in the act_hi_detail table

I want to keep the data in the act_hi_varinst table and only clear the data in the act_hi_detail table. What should I do? Is it okay to use SQL to delete all data in the act_hi_detail table?

Hello my friend!
Welcome to community!

The tables that contain the _ hi _ prefix are history tables, used for queries regarding the history of the instances that were executed.

There is a process used precisely to keep the history tables clean, called “history cleanup”, and “history level”, I suggest you research the documentation on this subject and the existing history levels (FULL, AUDIT, ACTIVITY, NONE).

I personally don’t like running cleanups directly through the database, so I don’t recommend this…

but there are APIs that perform the scheduling of this cleaning…
take a look on the link below my friend:

https://docs.camunda.org/rest/camunda-bpm-platform/7.20/#tag/History-Cleanup

I hope this helps!

NOTE: Remember to mark the answer that solves your problem or answers your question as “Solution”, so that the topic can be closed appropriately, and other people can easily find the answer when they search.

William Robert Alves

I need to retain historical data (act_hi_procinst, act_hi_taskinst, act_hi_varinst……), but I don’t want the act_hi_detail table. I haven’t found an API that provides this.

I believe you will not have any problems deleting the data from act_hi_detail as there are no foreign key relationships in the history tables.

But I suggest checking and testing in a local environment to make sure this won’t affect any other components that you might need.

William Robert Alves

Thank you very much for your help. I will try it out