Skip to content

fix(client): include runId in WorkflowExecutionAlreadyStartedError - #2206

Open
ATKasem wants to merge 1 commit into
temporalio:mainfrom
ATKasem:fix/already-started-error-run-id
Open

fix(client): include runId in WorkflowExecutionAlreadyStartedError#2206
ATKasem wants to merge 1 commit into
temporalio:mainfrom
ATKasem:fix/already-started-error-run-id

Conversation

@ATKasem

@ATKasem ATKasem commented Jul 13, 2026

Copy link
Copy Markdown

Closes #1838

The server returns the runId of the already-running execution in the ALREADY_EXISTS error details (WorkflowExecutionAlreadyStartedFailure), but the SDK discarded it when building WorkflowExecutionAlreadyStartedError. This adds an optional runId to the error and populates it at the three throw sites (start, signalWithStart, update-with-start), decoding the detail via a new extractWorkflowExecutionAlreadyStartedRunId helper that mirrors the existing extractNexusOperationAlreadyStartedRunId.

The new field is optional, so this is backwards-compatible; when the server does not provide the detail (e.g. older servers), runId is simply undefined.

Test plan

Extended the existing Start of workflow respects workflow id conflict policy integration test to assert that err.runId matches the running execution's firstExecutionRunId.

@ATKasem
ATKasem requested a review from a team as a code owner July 13, 2026 19:54
@ATKasem
ATKasem force-pushed the fix/already-started-error-run-id branch from df528e3 to 936a4f2 Compare July 13, 2026 19:55
@CLAassistant

CLAassistant commented Jul 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ATKasem
ATKasem force-pushed the fix/already-started-error-run-id branch from 936a4f2 to 91b890e Compare July 13, 2026 19:56
The server returns the runId of the already-running execution in the
ALREADY_EXISTS error details (WorkflowExecutionAlreadyStartedFailure),
but the SDK dropped it when constructing the error. Decode it and expose
it as an optional `runId`, mirroring the existing Nexus handling.

Closes temporalio#1838
@ATKasem
ATKasem force-pushed the fix/already-started-error-run-id branch from 91b890e to 9437d90 Compare July 20, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] WorkflowExecutionAlreadyStartedError should contain runId if provided by server

2 participants