Manual deletion of workflow when history is corrupted

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?

Try

temporal workflow delete

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

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

tctl admin workflow delete