Mass deletion of flowable data

Is there any way to delete all the data of flowable based on tenant id, and delete deployment, process definition, process instances, task, a form of deployment, and other all the object like history data all the object?

I have checked there is one rest call that is used for delete deployment
DELETE /repository/deployments/ {deploymentId}

Is this work fine if I have millions of process definitions, process instances, and tasks are created?

Or is there any other way to delete batch-wise all the flowable data?
Or is there any way to delete flowable data from using java code?

Note: I have millions of data, like process definitions, process instances, and tasks.

~Thanks!

Yes, although it might take a while, depending on the system of your database.

With the Java API’s you can query and delete selectively, however you’ll need to query different types of data and iterate over them.

@joram Thanks for the replay.