Delete single process instance from optimize

Hello, i’m currently using camunda 8 saas and i had some process instances that had to be deleted so i deleted them using operate, the problem is that they are still in optimize and affect the metrics there. Is there a way to connect to the elastic search where optimize saves its data? Or is there any API that i could use to delete all the process instances that were deleted in operate? Any lead that you could give me would be much appreciated

Hi @Luis_Godinez,

One option is to configure History Cleanup for Optimize.
Docs: Overview | Camunda 8 Docs

Best,
Yana

Please correct me if i’m wrong but for what i’ve read, History Cleanup for Optimize can only delete processes or vars based on a ttl, I need to delete just some process instances that had a start date of yesterday but i need to keep all the other history.

Thanks for the quick response.

Or if someone knows how to access the elastic search provided with the saas version so i can manually delete the records would be nice

In that case you can delete a process instance via Elasticsearch and you have access to it. Example via REST API:

DELETE http://localhost:9200/optimize-process-instance/_doc/{processInstanceID}

Deleting a definition can be done via

http://localhost:9200/optimize-process-definition/_doc/invoice:1:0f128603-124c-11ed-b5fa-0242ac120003

I hope that helps.

@Luis_Godinez, since you use SaaS version, please contact our support. They will help you with the manual deletion.

In my previous reply, I didn’t consider you that you are using SaaS solution.