# Batch delete of running process instances

**URL:** <https://forum.flowable.org/t/batch-delete-of-running-process-instances/12541>\
**Category:** Flowable Engine\
**Created:** [February 24, 2026, 2:56pm UTC](https://forum.flowable.org/t/batch-delete-of-running-process-instances/12541 "2026-02-24T14:56:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![desp.kaz](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@desp.kaz](https://forum.flowable.org/u/desp.kaz)\
**Post date:** [February 24, 2026, 2:56pm UTC](https://forum.flowable.org/t/batch-delete-of-running-process-instances/12541/1 "2026-02-24T14:56:27Z")

</div>

Hello,

I want to bulk delete running workflow instances but the

```auto
runtimeService.bulkDeleteProcessInstances(ids,
    "Definition " + workflowDefinitionId + " is deleted");

```

deletes them one by one if I understood correctly.

Can I create my own BatchBuilder? or there is some other way?

---

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [March 16, 2026, 12:17pm UTC](https://forum.flowable.org/t/batch-delete-of-running-process-instances/12541/2 "2026-03-16T12:17:07Z")

</div>

Use historyService.createHistoricProcessInstanceQuery()…. .deleteParallelUsingBatch….

---

<div class="post-metadata">

**Author:** ![desp.kaz](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@desp.kaz](https://forum.flowable.org/u/desp.kaz)\
**Post date:** [March 17, 2026, 7:41am UTC](https://forum.flowable.org/t/batch-delete-of-running-process-instances/12541/3 "2026-03-17T07:41:42Z")

</div>

I want to keep the historic process instances and remove only the runtime ones.

We use this technique for implementing “cancel” for running workflow instances

---

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [March 17, 2026, 7:57am UTC](https://forum.flowable.org/t/batch-delete-of-running-process-instances/12541/4 "2026-03-17T07:57:23Z")

</div>

Fine, use the same approach as for HistoricProcessInstances.

Why do you need to batch delete running process instances?

Regards

Martin

---

<div class="post-metadata">

**Author:** ![desp.kaz](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@desp.kaz](https://forum.flowable.org/u/desp.kaz)\
**Post date:** [March 17, 2026, 8:27am UTC](https://forum.flowable.org/t/batch-delete-of-running-process-instances/12541/5 "2026-03-17T08:27:44Z")

</div>

> [@desp.kaz](#):
>
> `bulkDeleteProcessInstances`

By using the same approach as HistoricProcessInstances, you mean to implement something like deleteParallelUsingBatch?

There might be a lot of process instances, so I want to use batch for faster execution.

The logic is that I want to delete a specific version of a process definition and cancel all running instances of it. Is maybe other way to do that?

---

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [March 17, 2026, 10:21am UTC](https://forum.flowable.org/t/batch-delete-of-running-process-instances/12541/6 "2026-03-17T10:21:27Z")

</div>

Yes,

split the query into batch parts, to keep transaction small. Each batch part will be responsible for deleting specific part of the query.
