Skip to content

Add GetWorkflowExecution API contract - #933

Open
timl3136 wants to merge 2 commits into
temporalio:mainfrom
timl3136:api/result-contract
Open

timl3136 wants to merge 2 commits into
temporalio:mainfrom
timl3136:api/result-contract

Conversation

@timl3136

@timl3136 timl3136 commented Nov 30, 2026 •

Copy link
Copy Markdown

What changed?

Source and generator changes:

  • Add the experimental GetWorkflowExecutionResult system Nexus operation. Its request identifies a workflow and optionally a run ID; it returns the final result of the run chain as a single Payload.
  • Add server-authored callback metadata for result subscriptions and a history field for recording cancellations by request ID. Public callback inputs must reject the subscription metadata.
  • Update the Nexus RPC YAML generator to resolve language references from each message's own proto file, and exempt the bare Payload response from the standard response-name lint rule.

The proto sources and generator code produce these CI-generated artifacts:

  • openapi/openapiv2.json
  • openapi/openapiv3.yaml
  • nexus/temporal-proto-models-nexusrpc.yaml
  • nexus/workflow-service.wit

Why?

This defines the API contract for workflows to wait for another workflow's result, including across a chain of runs. Server implementation is required to provide the operation and enforce the callback metadata rules.

SDK and generator updates are required before release. They must handle raw payload results with the caller's data converter for both immediate and callback results. The TypeScript registry build and result decoder also need verification.

Breaking changes

The protobuf fields are additive. the feature won't work until server & sdk side implementation is complete.

Verification

run ci

@timl3136
timl3136 force-pushed the api/result-contract branch from cacf87c to c42fb0c Compare November 30, 2026 21:36
@timl3136 timl3136 changed the title Add workflow execution result API contract Add GetWorkflowExecution API contract Nov 30, 2026
@timl3136
timl3136 marked this pull request as ready for review November 30, 2026 21:46
@timl3136
timl3136 requested review from a team and a balanced review from Copilot November 30, 2026 21:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The bare-Payload response requires downstream SDK and generator validation, especially TypeScript registry generation and immediate/callback data conversion, beyond what this API-only snapshot and its CI cover.

No open issues 🎉

What changed in this PR

Defines the experimental GetWorkflowExecutionResult system Nexus API for waiting on a workflow run chain’s final result as a single Payload. Server and SDK support remain required before release.

Changes:

  • Add the operation contract, server-authored subscription metadata, and cancellation history field.
  • Resolve generated language references from each message’s own proto file and allow the bare Payload response name.
  • Update generated OpenAPI and Nexus artifacts.
File Description
temporal/​api/​workflowservice/​v1/​service.proto Declare the experimental result operation.
temporal/​api/​workflowservice/​v1/​request_response.proto Define the workflow execution request.
temporal/​api/​history/​v1/​message.proto Record subscription cancellations by request ID.
temporal/​api/​common/​v1/​message.proto Add subscription metadata and document public-input rejection.
openapi/​openapiv3.yaml Reflect new callback and history fields.
openapi/​openapiv2.json Reflect new callback and history fields.
nexus/​workflow-service.wit Expose the operation with a payload result.
nexus/​temporal-proto-models-nexusrpc.yaml Add language references for the operation’s input and output.
cmd/​protoc-gen-nexus-rpc-yaml/​generator.go Use each message’s defining file for language references.
buf.yaml Exempt the service file from response-name linting.

Review effort: Balanced

// Version 1 uses the GetWorkflowExecutionResult single-Payload result format.
// The server must set a supported, positive version.
int32 result_format_version = 2;
// Target execution resolved when the subscription was attached, including its run ID.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the event the workflow executions CANs or is reset, would that result in a stale value?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That's intentional, when the caller want to cancel the callback even if the target workflow CAN or reset, it would walk the run chain to find the run that is still open.

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.

3 participants