temporalio / temporalio/temporal

GetWorkflow doesn't find archived one

Open
#8,235 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

potential-bug
Dominant language
Go
Stars
23.2k
Forks
1.9k
Avg merge
2d 8h
Merged PRs (30d)
228

Description

Expected Behavior

When passing both a workflow and run ID, the SDK should return the desired run for the given workflow, even though this workflow has been archived, right?

So this code should work:

wr := c.GetWorkflow(context.Background(), WorkflowId, RunId)
err = wr.Get(context.Background(), &ptr)
if err != nil {
  // ...
}

Actual Behavior

But when executing this, I have the following error:

Workflow executionsRow not found.  WorkflowId: <id>, RunId: <id>

It looks like the error comes from temporalio/temporal/blob/master/common/persistence/sql/execution.go#L257

Steps to Reproduce the Problem

  1. Run a workflow, and wait for it to be archived.
  2. With the SDK, get the workflow by passing its ID and a run ID.

(I use the file storage for archival, which works fine.)

Specifications

  • Version: SDK v1.8.0, Server v1.11.2
  • Platform: darwin

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at common/persistence/sql/execution.go around line 257 and trace the GetWorkflow path used with both WorkflowId and RunId. Reproduce the case after a workflow is archived, then verify that the SDK returns the requested archived run instead of the “Workflow executionsRow not found” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sql
Domain
api, databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.