Skip to content

Commit ddc38c8

Browse files
authored
Add link field to propagate backlink in signal and signal-with-start responses (#761)
<!-- Describe what has changed in this PR --> **What changed?** Added `link` fields on `SignalWorkflowExecutionResponse` and `SignalWithStartWorkflowExecutionRequest`. I think a singular link should suffice but if reviewers feel otherwise (especially w.r.t. `SignalWithStartWorkflowExecutionRequest`) let me know. <!-- Tell your future self why have you made these changes --> **Why?** To propagate backlinks on signal and signal-with-start executions back to the caller. <!-- Are there any breaking changes on binary or code level? --> **Breaking changes** Not a breaking change (unused field) <!-- If this breaks the Server, please provide the Server PR to merge right after this PR was merged. --> **Server PR** temporalio/temporal#9897
1 parent f224850 commit ddc38c8

4 files changed

Lines changed: 46 additions & 2 deletions

File tree

openapi/openapiv2.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16546,11 +16546,21 @@
1654616546
"started": {
1654716547
"type": "boolean",
1654816548
"description": "If true, a new workflow was started."
16549+
},
16550+
"signalLink": {
16551+
"$ref": "#/definitions/v1Link",
16552+
"description": "Link to be associated with the WorkflowExecutionSignaled event.\nAdded on the response to propagate the backlink.\nAvailable from Temporal server 1.31 and up."
1654916553
}
1655016554
}
1655116555
},
1655216556
"v1SignalWorkflowExecutionResponse": {
16553-
"type": "object"
16557+
"type": "object",
16558+
"properties": {
16559+
"link": {
16560+
"$ref": "#/definitions/v1Link",
16561+
"description": "Link to be associated with the WorkflowExecutionSignaled event.\nAdded on the response to propagate the backlink.\nAvailable from Temporal server 1.31 and up."
16562+
}
16563+
}
1655416564
},
1655516565
"v1StartActivityExecutionResponse": {
1655616566
"type": "object",
@@ -18470,6 +18480,10 @@
1847018480
"externalWorkflowExecution": {
1847118481
"$ref": "#/definitions/v1WorkflowExecution",
1847218482
"description": "When signal origin is a workflow execution, this field is set."
18483+
},
18484+
"requestId": {
18485+
"type": "string",
18486+
"description": "The request ID of the Signal request, used by the server to attach this to\nthe correct Event ID when generating link."
1847318487
}
1847418488
}
1847518489
},

openapi/openapiv3.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14167,6 +14167,13 @@ components:
1416714167
started:
1416814168
type: boolean
1416914169
description: If true, a new workflow was started.
14170+
signalLink:
14171+
allOf:
14172+
- $ref: '#/components/schemas/Link'
14173+
description: |-
14174+
Link to be associated with the WorkflowExecutionSignaled event.
14175+
Added on the response to propagate the backlink.
14176+
Available from Temporal server 1.31 and up.
1417014177
SignalWorkflowExecutionRequest:
1417114178
type: object
1417214179
properties:
@@ -14207,7 +14214,14 @@ components:
1420714214
- temporal.api.workflow.v1.PostResetOperation.SignalWorkflow.
1420814215
SignalWorkflowExecutionResponse:
1420914216
type: object
14210-
properties: {}
14217+
properties:
14218+
link:
14219+
allOf:
14220+
- $ref: '#/components/schemas/Link'
14221+
description: |-
14222+
Link to be associated with the WorkflowExecutionSignaled event.
14223+
Added on the response to propagate the backlink.
14224+
Available from Temporal server 1.31 and up.
1421114225
StartActivityExecutionRequest:
1421214226
type: object
1421314227
properties:
@@ -17118,6 +17132,11 @@ components:
1711817132
allOf:
1711917133
- $ref: '#/components/schemas/WorkflowExecution'
1712017134
description: When signal origin is a workflow execution, this field is set.
17135+
requestId:
17136+
type: string
17137+
description: |-
17138+
The request ID of the Signal request, used by the server to attach this to
17139+
the correct Event ID when generating link.
1712117140
WorkflowExecutionStartedEventAttributes:
1712217141
type: object
1712317142
properties:

temporal/api/history/v1/message.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,9 @@ message WorkflowExecutionSignaledEventAttributes {
612612
bool skip_generate_workflow_task = 5 [deprecated = true];
613613
// When signal origin is a workflow execution, this field is set.
614614
temporal.api.common.v1.WorkflowExecution external_workflow_execution = 6;
615+
// The request ID of the Signal request, used by the server to attach this to
616+
// the correct Event ID when generating link.
617+
string request_id = 7;
615618
}
616619

617620
message WorkflowExecutionTerminatedEventAttributes {

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,10 @@ message SignalWorkflowExecutionRequest {
793793
}
794794

795795
message SignalWorkflowExecutionResponse {
796+
// Link to be associated with the WorkflowExecutionSignaled event.
797+
// Added on the response to propagate the backlink.
798+
// Available from Temporal server 1.31 and up.
799+
temporal.api.common.v1.Link link = 1;
796800
}
797801

798802
message SignalWithStartWorkflowExecutionRequest {
@@ -865,6 +869,10 @@ message SignalWithStartWorkflowExecutionResponse {
865869
string run_id = 1;
866870
// If true, a new workflow was started.
867871
bool started = 2;
872+
// Link to be associated with the WorkflowExecutionSignaled event.
873+
// Added on the response to propagate the backlink.
874+
// Available from Temporal server 1.31 and up.
875+
temporal.api.common.v1.Link signal_link = 3;
868876
}
869877

870878
message ResetWorkflowExecutionRequest {

0 commit comments

Comments
 (0)