Removing large amounts of task instances

Hi,

I am trying out Camunda for our company and came across the following:

I sent 33456 items to Camunda through the API. Then I wanted to delete them all, so I thought I can just remove the deployment and check cascade, so I did, but after 30 seconds or so it pops up a message:

Finished : Could not delete deployment: GC overhead limit exceeded

I check the ACT_HI_PROCINST table in my MySql database, and it still contains 33456

How can I delete these instances ?

You could take a look at the batch operations. It’s better to us that for those numbers of instances.

Thanks, I will take a look at this. For now I already dropped the whole DB since it was still in development :wink: But for next time I will use batches

I looked at the documentation page you sent, but I don’t really understand how this works. How do I create a batch to delete these process Instances? The documentation just gives some java code, but I don’t use Java I want to do it through the REST API, but there I only see options to activate/suspend or delete a batch, not to create one…

Ah, I think I found it. It is here right? https://docs.camunda.org/manual/7.6/reference/rest/process-instance/post-delete/

Do I really have to specify all process-instance id in this way? Can’t I just delete all at once ?

You could programmatically query for all process instance id’s and subsequently create the post call to remove them - but indeed this call does require you to specify all instances.

Hi @mac_doggie,

if you pass an empty query object, all instances are selected.

Cheers,
Tassilo

2 Likes