Workflow execution not found but cannot create new workflow of the same ID

Hello!

I am running:

temporal workflow terminate --workflow-id=n-lhujyzac44zDVcdbvPe8P
Error: unable to terminate workflow: operation GetWorkflowExecution encountered not found
('export TEMPORAL_CLI_SHOW_STACKS=1' to see stack traces)

so it seems like this workflow does not exist. Yet when i use a script to start a new workflow with the same ID, i get:

              ^
WorkflowExecutionAlreadyStartedError: Workflow execution already started
    at WorkflowClient._startWorkflowHandler (/Users/jack.wang/scaleapi/.yarn/cache/@temporalio-client-npm-1.8.6-dce4743dea-a240950961.zip/node_modules/@temporalio/client/src/workflow-client.ts:752:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async WorkflowClient.start (/Users/jack.wang/scaleapi/.yarn/cache/@temporalio-client-npm-1.8.6-dce4743dea-a240950961.zip/node_modules/@temporalio/client/src/workflow-client.ts:405:19)
    at async /Users/jack.wang/scaleapi/packages/task-pipeline/src/scripts/jwang/restart-node-wf.ts:43:9
    at async /Users/jack.wang/scaleapi/packages/task-pipeline/src/test-utils.ts:393:12
    at async withRequestEM (/Users/jack.wang/scaleapi/packages/task-pipeline/src/test-utils.ts:391:10)
    at async concurrency (/Users/jack.wang/scaleapi/packages/task-pipeline/src/scripts/jwang/restart-node-wf.ts:26:7)
    at async /Users/jack.wang/scaleapi/.yarn/cache/@esm2cjs-p-map-npm-5.5.0-2e2c06940a-e87c37647f.zip/node_modules/@esm2cjs/p-map/esm/index.js:141:20 {
  cause: undefined,
  workflowId: 'n-lhujyzac44zDVcdbvPe8P',
  workflowType: 'executePipelineNode'
}

This seems like it’s coming from some kind of inconsistency inside the temporal server.

I can see the node workflow in the search


but when i click it it says:

Failed to fetch

What can i do here to unblock?

What version of the Temporal service are you running?

i am using

1.22.2

At face value I’d think the script is using the correct namespace, while the terminate command isn’t. That would be the first thing I’d check.

Nevertheless, “unable to fetch” from the UI is a bit weird. How is your Temporal server / UI being deployed? What persistence layer are you using?