Skip to content

[SDK Ergonomics] NEXUS-519: Add link to QueryWorkflowResponse - #842

Open
mavemuri wants to merge 1 commit into
mainfrom
mavemuri/nexus-query
Open

[SDK Ergonomics] NEXUS-519: Add link to QueryWorkflowResponse#842
mavemuri wants to merge 1 commit into
mainfrom
mavemuri/nexus-query

Conversation

@mavemuri

@mavemuri mavemuri commented Jul 24, 2026

Copy link
Copy Markdown

For Nexus Operations. Query is both read-only and sync- so

  1. no callbacks
  2. the link is only from caller to the handler- and is specifically a workflow link as there isnt a history event in handler for query

What changed?
Added link field to QueryWorkflowResponse

Why?
Required for QueryWorkflow-backed Nexus Operations

Breaking changes
None

Server PR
temporalio/temporal#11274 (Note: no server breakage)

For Nexus Operations. Query is both read-only and sync- so
1. no callbacks
2. the link is only from caller to the handler- and is specifically a workflow link as there isnt a history event in handler for query
@mavemuri
mavemuri force-pushed the mavemuri/nexus-query branch from 7b01da1 to b49ffb5 Compare July 25, 2026 00:41
@mavemuri
mavemuri marked this pull request as ready for review July 27, 2026 16:02
@mavemuri
mavemuri requested review from a team July 27, 2026 16:02
temporal.api.common.v1.Payloads query_result = 1;
temporal.api.query.v1.QueryRejected query_rejected = 2;
// Holds the link to the Workflow execution that processed the Query.
temporal.api.common.v1.Link link = 3;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

JFYI, I asked Claude if it was common to have a singular link in a -Response field vs. a repeated links for some hypothetical future where you would want multiple links back.

As it turns out, a singular link is the way to go. 👍


Five -Response messages have a temporal.api.common.v1.Link field, and all five are singular — none are repeated:

┌──────────────────────────────────────────┬──────────────────────┬─────────────────────────────┐
│                 Message                  │        Field         │            Line             │
├──────────────────────────────────────────┼──────────────────────┼─────────────────────────────┤
│ StartWorkflowExecutionResponse           │ Link link = 4        │ request_response.proto:238  │
├──────────────────────────────────────────┼──────────────────────┼─────────────────────────────┤
│ SignalWorkflowExecutionResponse          │ Link link = 1        │ request_response.proto:874  │
├──────────────────────────────────────────┼──────────────────────┼─────────────────────────────┤
│ SignalWithStartWorkflowExecutionResponse │ Link signal_link = 3 │ request_response.proto:952  │
├──────────────────────────────────────────┼──────────────────────┼─────────────────────────────┤
│ UpdateWorkflowExecutionResponse          │ Link link = 4        │ request_response.proto:1862 │
├──────────────────────────────────────────┼──────────────────────┼─────────────────────────────┤
│ StartActivityExecutionResponse           │ Link link = 3        │ request_response.proto:3258 │
└──────────────────────────────────────────┴──────────────────────┴─────────────────────────────┘

So: 5 singular, 0 repeated.

For contrast, the repeated links pattern shows up only on the request side — StartWorkflowExecutionRequest, RequestCancelWorkflowExecutionRequest, SignalWorkflowExecutionRequest, SignalWithStartWorkflowExecutionRequest, TerminateWorkflowExecutionRequest, and StartActivityExecutionRequest. Requests accept N inbound links; responses return the one link identifying the event they produced.

@chrsmith chrsmith 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.

This LGTM, but you might want to get another review first. As well as merge this and the server-side changes in the right order.

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.

4 participants