Skip to content

Fix first_execution_run_id comments on Cancel and Terminate RPCs#755

Open
dandavison wants to merge 1 commit intomasterfrom
fix-first-execution-run-id-comments
Open

Fix first_execution_run_id comments on Cancel and Terminate RPCs#755
dandavison wants to merge 1 commit intomasterfrom
fix-first-execution-run-id-comments

Conversation

@dandavison
Copy link
Copy Markdown
Contributor

@dandavison dandavison commented Apr 4, 2026

The proto comments on first_execution_run_id in RequestCancelWorkflowExecutionRequest and TerminateWorkflowExecutionRequest claimed that when a run ID is set on workflow_execution, validation would demand that that run descends from first_execution_run_id. In reality, the server unconditionally ignores the workflow_execution run ID when first_execution_run_id is set, resolves to the most recent execution, and then checks that that descends from first_execution_run_id:

requestcancelworkflow/api.go:32-34

if len(firstExecutionRunID) != 0 {
    runID = ""
}

terminateworkflow/api.go:33-35

if len(request.FirstExecutionRunId) != 0 {
    runID = ""
}

The UpdateWorkflowExecutionRequest comment is left unchanged because its server implementation does pass the workflow_execution run ID through to execution resolution, and validates first_execution_run_id separately after loading the execution.

The comments on RequestCancelWorkflowExecution and
TerminateWorkflowExecution claimed that first_execution_run_id
validates against either the most recent or specified (by run id)
execution. In reality, the server unconditionally ignores the run id
when first_execution_run_id is set, always resolving to the most
recent execution for the workflow id.

The UpdateWorkflowExecution comment is left unchanged because its
server implementation does respect the run id when set.
@dandavison dandavison force-pushed the fix-first-execution-run-id-comments branch from 592d53b to 37f9840 Compare April 4, 2026 14:08
@dandavison dandavison marked this pull request as ready for review April 4, 2026 14:08
@dandavison dandavison requested review from a team April 4, 2026 14:08
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.

1 participant