Skip to main content
Skip table of contents

Cleanup Activiti process history in Identity Manager

This article is valid for Smart ID 20.11 and later.

This article describes the scheduled job that regularly cleans up the the process history of Activiti. Finished processes are automatically removed from the database to improve performance and save disk space. This is used in Smart ID Identity Manager.

Configure Activiti process cleanup

In, you set up:

  • a Cron expression stating when the job shall run, for example, every Friday at 11 pm

  • a "buffer time", stating after how many days a finished or inactive process shall be deleted

This is an example:

Example: settings
# Age of history entries in days, after which finished task should be deleted
# Age of history entries in days, after which inactive task
# (i.e. unfinished task, which are untouched for daysAfterEndTime days) should be deleted
# Cron expression, when the cleanup task should run. Here every friday at 11 pm
activitiHistoryCleanerJobTrigger.cronExpression = 0 0 23 ? * FRI *

If these parameters are not set, then there are default values set in the process_execution-beans.xml.


A log file named nexus_activiti_history_cleanup.log is generated. It logs the history data that was deleted.

Used Activiti services

These Activiti services are used to perform the cleanup task:

  • HistoryService: Queries for finished process instances and deletes them

  • TaskService. Queries for inactive process instances

  • ManagementService: Queries for stuck process instances (asynchronous tasks, that have no retries left)

  • RuntimeService: Deletes process instances, which are returned by TaskService and ManagementService

Affected database tables

These are the affected database tables:

Database table










For all processes that have been finished for X-days ((END_ACT_ID_ is not null) AND (END_TIME_ >= current date - X-days after finishing)


General files, that are related to the specific process


For all processes that will not run anymore and all related data. -> (RETRIES_ <= 0)


For all unfinished processes where no user interaction has occurred in X-days (daysOfInactivity property)

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.