[SDK Ergonomics] NEXUS-519: Add link to QueryWorkflowResponse - #842
[SDK Ergonomics] NEXUS-519: Add link to QueryWorkflowResponse#842mavemuri wants to merge 1 commit into
Conversation
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
7b01da1 to
b49ffb5
Compare
| 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; |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
For Nexus Operations. Query is both read-only and sync- so
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)