Skip to content

Commit c20a039

Browse files
authored
Add ScheduledEventID to NexusOperationCancelRequest[Completed|Failed] (#572)
**What changed?** Added ScheduledEventID of the Nexus operation to the new NexusOperationCancelRequestCompleted and NexusOperationCancelRequestFailed events **Why?** For efficient lookups. Go SDK stores cancellation state machines keyed on scheduled event ID. **Server PR** temporalio/temporal#7612
1 parent 178128d commit c20a039

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

Diff for: openapi/openapiv2.json

+10
Original file line numberDiff line numberDiff line change
@@ -11224,6 +11224,11 @@
1122411224
"type": "string",
1122511225
"format": "int64",
1122611226
"description": "The `WORKFLOW_TASK_COMPLETED` event that the corresponding RequestCancelNexusOperation command was reported\nwith."
11227+
},
11228+
"scheduledEventId": {
11229+
"type": "string",
11230+
"format": "int64",
11231+
"description": "The id of the `NEXUS_OPERATION_SCHEDULED` event this cancel request corresponds to."
1122711232
}
1122811233
}
1122911234
},
@@ -11243,6 +11248,11 @@
1124311248
"failure": {
1124411249
"$ref": "#/definitions/apifailurev1Failure",
1124511250
"description": "Failure details. A NexusOperationFailureInfo wrapping a CanceledFailureInfo."
11251+
},
11252+
"scheduledEventId": {
11253+
"type": "string",
11254+
"format": "int64",
11255+
"description": "The id of the `NEXUS_OPERATION_SCHEDULED` event this cancel request corresponds to."
1124611256
}
1124711257
}
1124811258
},

Diff for: openapi/openapiv3.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -8397,6 +8397,9 @@ components:
83978397
description: |-
83988398
The `WORKFLOW_TASK_COMPLETED` event that the corresponding RequestCancelNexusOperation command was reported
83998399
with.
8400+
scheduledEventId:
8401+
type: string
8402+
description: The id of the `NEXUS_OPERATION_SCHEDULED` event this cancel request corresponds to.
84008403
NexusOperationCancelRequestFailedEventAttributes:
84018404
type: object
84028405
properties:
@@ -8412,6 +8415,9 @@ components:
84128415
allOf:
84138416
- $ref: '#/components/schemas/Failure'
84148417
description: Failure details. A NexusOperationFailureInfo wrapping a CanceledFailureInfo.
8418+
scheduledEventId:
8419+
type: string
8420+
description: The id of the `NEXUS_OPERATION_SCHEDULED` event this cancel request corresponds to.
84158421
NexusOperationCancelRequestedEventAttributes:
84168422
type: object
84178423
properties:

Diff for: temporal/api/history/v1/message.proto

+4
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,8 @@ message NexusOperationCancelRequestCompletedEventAttributes {
969969
// The `WORKFLOW_TASK_COMPLETED` event that the corresponding RequestCancelNexusOperation command was reported
970970
// with.
971971
int64 workflow_task_completed_event_id = 2;
972+
// The id of the `NEXUS_OPERATION_SCHEDULED` event this cancel request corresponds to.
973+
int64 scheduled_event_id = 3;
972974
}
973975

974976
message NexusOperationCancelRequestFailedEventAttributes {
@@ -979,6 +981,8 @@ message NexusOperationCancelRequestFailedEventAttributes {
979981
int64 workflow_task_completed_event_id = 2;
980982
// Failure details. A NexusOperationFailureInfo wrapping a CanceledFailureInfo.
981983
temporal.api.failure.v1.Failure failure = 3;
984+
// The id of the `NEXUS_OPERATION_SCHEDULED` event this cancel request corresponds to.
985+
int64 scheduled_event_id = 4;
982986
}
983987

984988
// History events are the method by which Temporal SDKs advance (or recreate) workflow state.

0 commit comments

Comments
 (0)