# Manual deletion of workflow when history is corrupted

**URL:** <https://community.temporal.io/t/manual-deletion-of-workflow-when-history-is-corrupted/11887>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [April 24, 2024, 2:58am UTC](https://community.temporal.io/t/manual-deletion-of-workflow-when-history-is-corrupted/11887 "2024-04-24T02:58:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cg1972](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/cg1972/32/465_2.png) [@cg1972](https://community.temporal.io/u/cg1972)\
**Post date:** [April 24, 2024, 2:58am UTC](https://community.temporal.io/t/manual-deletion-of-workflow-when-history-is-corrupted/11887/1 "2024-04-24T02:58:42Z")

</div>

I have a couple of workflows that I want to delete. These are cron workflows and display in the web-ui with a status of “Running”. When I click on the “Run ID” to load the details of the workflow I get errors indicating that the workflow history is missing. In other examples the history loads but when I select the “Terminate” button I get errors about “maximum number of attempts reach to update history”.

I have also tried deleting the workflows programatically using code similar to

> service.blockingStub().terminateWorkflowExecution()

When I call this code it says the workflow is not running.

Are there any other options that are available to delete these corrupted workflows? Even if I need to manually go in and cleanout the tables is there information on which tables I would need to cleanup to remove these broken workflows?

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [April 24, 2024, 3:51am UTC](https://community.temporal.io/t/manual-deletion-of-workflow-when-history-is-corrupted/11887/2 "2024-04-24T03:51:35Z")

</div>

Try

```auto
temporal workflow delete

```

---

<div class="post-metadata">

**Author:** ![cg1972](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/cg1972/32/465_2.png) [@cg1972](https://community.temporal.io/u/cg1972)\
**Post date:** [April 24, 2024, 4:38am UTC](https://community.temporal.io/t/manual-deletion-of-workflow-when-history-is-corrupted/11887/3 "2024-04-24T04:38:19Z")

</div>

Hi maxim,

```
With the version we are running is there an equivalent tctl command? I've tried

```

> tctl workflow terminate --workflow\_id xxx

but it failed with error

```auto
Error: Terminate workflow failed.
Error Details: operation GetCurrentExecution encounter not found

```

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [April 24, 2024, 3:38pm UTC](https://community.temporal.io/t/manual-deletion-of-workflow-when-history-is-corrupted/11887/4 "2024-04-24T15:38:59Z")

</div>

```auto
tctl admin workflow delete

```
