# Workflow stuck in limbo state

**URL:** <https://community.temporal.io/t/workflow-stuck-in-limbo-state/15502>\
**Category:** Community Support\
**Created:** [December 3, 2024, 5:18pm UTC](https://community.temporal.io/t/workflow-stuck-in-limbo-state/15502 "2024-12-03T17:18:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwang97](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@jwang97](https://community.temporal.io/u/jwang97)\
**Post date:** [December 3, 2024, 5:18pm UTC](https://community.temporal.io/t/workflow-stuck-in-limbo-state/15502/1 "2024-12-03T17:18:12Z")

</div>

Hi All,

We are using self-hosted open source temporal 1.22.2 and we are running into an issue where a workflow can neither be terminated nor a new workflow spun up with the same workflowId.

The first symptom of this is that trying to load the workflow on temporalUI gives me:

 ![Screenshot 2024-12-03 at 12.12.19 PM](https://us1.discourse-cdn.com/flex016/uploads/temporal/original/2X/6/64cbb16ac9e10db88009eb3a461a1827bafe11c0.png)  
 ![Screenshot 2024-12-03 at 12.12.25 PM](https://us1.discourse-cdn.com/flex016/uploads/temporal/original/2X/a/a318537063541b78493432b87483e56319fcd9b1.png)  
these errors.

If i try to describe the workflow programatically using the client, i get a `WorkflowNotFoundError: operation GetWorkflowExecution encountered not found`

If i try to spin up a duplicate workflow on the same Id i get: `WorkflowExecutionAlreadyStartedError: Workflow execution already started`

Is there a way i can force terminate the old workflow and be able to start the new one? I assume this is caused by a de-sync in the persistence layer.

We use workflowIds in the application layer to keep track of what workflows to signal/cancel so it’s imperative that we spin up with the same workflowId.

---

<div class="post-metadata">

**Author:** ![jwang97](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@jwang97](https://community.temporal.io/u/jwang97)\
**Post date:** [December 3, 2024, 5:40pm UTC](https://community.temporal.io/t/workflow-stuck-in-limbo-state/15502/2 "2024-12-03T17:40:19Z")

</div>

Also some weird behavior with the temporal CLI:

```auto
➜ task-pipeline git:(master) ✗ temporal workflow list --query "WorkflowId='n-6oktExPAl9X2nuh5vmo8i'"
  Status WorkflowId Type StartTime
  Running n-6oktExPAl9X2nuh5vmo8i executePipelineNode 1 day ago
➜ task-pipeline git:(master) ✗ temporal workflow terminate --workflow-id='n-xyb8tp8BdTqibWQdzNO9H'
time=2024-12-03T12:38:11.567 level=ERROR msg="failed to terminate workflow: operation GetWorkflowExecution encountered not found"
➜ task-pipeline git:(master) ✗ temporal workflow list --query "WorkflowId='n-xyb8tp8BdTqibWQdzNO9H'"
  Status WorkflowId Type StartTime
  Running n-xyb8tp8BdTqibWQdzNO9H executePipelineNode 4 weeks ago

```

in the first command i list an unproblematic workflow (to verify that i am correctly connected to the cluster)

the second command i try to terminate the problematic workflow which fails

the third command i query the problematic workflow which then runs correctly

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [December 4, 2024, 1:35pm UTC](https://community.temporal.io/t/workflow-stuck-in-limbo-state/15502/3 "2024-12-04T13:35:03Z")

</div>

> Also some weird behavior with the temporal CLI

just means workflow execution with with workflow id `n-xyb8tp8BdTqibWQdzNO9H` is still in visibility store with status Running, but is no longer in your primary persistence (temporal db).  
probably was issue with moving visibility task to visibility store. whats your visibility store used (ES or sql)?

> If i try to spin up a duplicate workflow on the same Id i get: WorkflowExecutionAlreadyStartedError: Workflow execution already started

this i think is problem, can you this also using cli (try starting a workflow exec with workflow id n-`xyb8tp8BdTqibWQdzNO9H` from cli and show output please.

does this issue (not being able to start workflow with id after describing it and service responds to describe with not found) happen intermittently or consistently?

---

<div class="post-metadata">

**Author:** ![jwang97](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@jwang97](https://community.temporal.io/u/jwang97)\
**Post date:** [December 5, 2024, 8:13pm UTC](https://community.temporal.io/t/workflow-stuck-in-limbo-state/15502/4 "2024-12-05T20:13:34Z")

</div>

We are using mysql8 for visibility and ScyllaDB for persistence.

this happens very rarely but consistently. One out of a million workflows i would ballpark.

Is there an easy way i can clear these from visibility so i can just spin up the workflow from scratch?

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [December 5, 2024, 8:56pm UTC](https://community.temporal.io/t/workflow-stuck-in-limbo-state/15502/5 "2024-12-05T20:56:02Z")

</div>

Have you tried deleting this exec with

`tctl --namespace <ns_name> adm wf del -w <wfid> -r <runid>`

this should try to delete from both stores. otherwise you’d have to remove it manually from temporal\_visibility db, executions\_visibility table

---

<div class="post-metadata">

**Author:** ![jwang97](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@jwang97](https://community.temporal.io/u/jwang97)\
**Post date:** [December 6, 2024, 8:51pm UTC](https://community.temporal.io/t/workflow-stuck-in-limbo-state/15502/6 "2024-12-06T20:51:03Z")

</div>

This solved the issue. Thank you so much 🙂

---

<div class="post-metadata">

**Author:** ![Phuong\_Nguyen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/phuong_nguyen/32/6982_2.png) [@Phuong\_Nguyen](https://community.temporal.io/u/Phuong_Nguyen)\
**Post date:** [March 6, 2025, 2:00am UTC](https://community.temporal.io/t/workflow-stuck-in-limbo-state/15502/7 "2025-03-06T02:00:59Z")

</div>

Hi @jwang97 , re. this happens very rarely but consistently. One out of a million workflows i would ballpark.

Do you know which conditions leading to this
