Skip to content

Commit 2106c7e

Browse files
authored
Rename Nexus Operation ID to token (#548)
- Leave operation ID fields in tact and mark them as deprecated. We may delete (reserve) them later on.
1 parent e1a80bb commit 2106c7e

File tree

6 files changed

+68
-7
lines changed

6 files changed

+68
-7
lines changed

openapi/openapiv2.json

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5660,14 +5660,18 @@
56605660
"type": "object",
56615661
"properties": {
56625662
"operationId": {
5663-
"type": "string"
5663+
"type": "string",
5664+
"description": "Deprecated: Renamed to operation_token."
56645665
},
56655666
"links": {
56665667
"type": "array",
56675668
"items": {
56685669
"type": "object",
56695670
"$ref": "#/definitions/apinexusv1Link"
56705671
}
5672+
},
5673+
"operationToken": {
5674+
"type": "string"
56715675
}
56725676
},
56735677
"description": "The operation will complete asynchronously.\nThe returned ID can be used to reference this operation."
@@ -7668,7 +7672,11 @@
76687672
},
76697673
"operationId": {
76707674
"type": "string",
7671-
"description": "Operation ID as originally generated by a Handler."
7675+
"description": "Operation ID as originally generated by a Handler.\n\nDeprecated: Renamed to operation_token."
7676+
},
7677+
"operationToken": {
7678+
"type": "string",
7679+
"description": "Operation token as originally generated by a Handler."
76727680
}
76737681
},
76747682
"description": "A request to cancel an operation."
@@ -9902,7 +9910,11 @@
99029910
},
99039911
"operationId": {
99049912
"type": "string",
9905-
"description": "Operation ID - may be empty if the operation completed synchronously."
9913+
"description": "Operation ID - may be empty if the operation completed synchronously.\n\nDeprecated: Renamed to operation_token."
9914+
},
9915+
"operationToken": {
9916+
"type": "string",
9917+
"description": "Operation token - may be empty if the operation completed synchronously."
99069918
}
99079919
}
99089920
},
@@ -9962,11 +9974,15 @@
99629974
},
99639975
"operationId": {
99649976
"type": "string",
9965-
"description": "The operation ID returned by the Nexus handler in the response to the StartOperation request.\nThis ID is used when canceling the operation."
9977+
"description": "The operation ID returned by the Nexus handler in the response to the StartOperation request.\nThis ID is used when canceling the operation.\n\nDeprecated: Renamed to operation_token."
99669978
},
99679979
"requestId": {
99689980
"type": "string",
99699981
"description": "The request ID allocated at schedule time."
9982+
},
9983+
"operationToken": {
9984+
"type": "string",
9985+
"description": "The operation token returned by the Nexus handler in the response to the StartOperation request.\nThis token is used when canceling the operation."
99709986
}
99719987
},
99729988
"description": "Event marking an asynchronous operation was started by the responding Nexus handler.\nIf the operation completes synchronously, this event is not generated.\nIn rare situations, such as request timeouts, the service may fail to record the actual start time and will fabricate\nthis event upon receiving the operation completion via callback."
@@ -10185,7 +10201,7 @@
1018510201
},
1018610202
"operationId": {
1018710203
"type": "string",
10188-
"description": "Operation ID. Only set for asynchronous operations after a successful StartOperation call."
10204+
"description": "Operation ID. Only set for asynchronous operations after a successful StartOperation call.\n\nDeprecated: Renamed to operation_token."
1018910205
},
1019010206
"scheduleToCloseTimeout": {
1019110207
"type": "string",
@@ -10229,6 +10245,10 @@
1022910245
"blockedReason": {
1023010246
"type": "string",
1023110247
"description": "If the state is BLOCKED, blocked reason provides additional information."
10248+
},
10249+
"operationToken": {
10250+
"type": "string",
10251+
"description": "Operation token. Only set for asynchronous operations after a successful StartOperation call."
1023210252
}
1023310253
},
1023410254
"description": "PendingNexusOperationInfo contains the state of a pending Nexus operation."

openapi/openapiv3.yaml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7389,7 +7389,13 @@ components:
73897389
description: Operation name.
73907390
operationId:
73917391
type: string
7392-
description: Operation ID - may be empty if the operation completed synchronously.
7392+
description: |-
7393+
Operation ID - may be empty if the operation completed synchronously.
7394+
7395+
Deprecated: Renamed to operation_token.
7396+
operationToken:
7397+
type: string
7398+
description: Operation token - may be empty if the operation completed synchronously.
73937399
NexusOperationScheduledEventAttributes:
73947400
type: object
73957401
properties:
@@ -7452,9 +7458,16 @@ components:
74527458
description: |-
74537459
The operation ID returned by the Nexus handler in the response to the StartOperation request.
74547460
This ID is used when canceling the operation.
7461+
7462+
Deprecated: Renamed to operation_token.
74557463
requestId:
74567464
type: string
74577465
description: The request ID allocated at schedule time.
7466+
operationToken:
7467+
type: string
7468+
description: |-
7469+
The operation token returned by the Nexus handler in the response to the StartOperation request.
7470+
This token is used when canceling the operation.
74587471
description: |-
74597472
Event marking an asynchronous operation was started by the responding Nexus handler.
74607473
If the operation completes synchronously, this event is not generated.
@@ -7669,7 +7682,10 @@ components:
76697682
description: Operation name.
76707683
operationId:
76717684
type: string
7672-
description: Operation ID. Only set for asynchronous operations after a successful StartOperation call.
7685+
description: |-
7686+
Operation ID. Only set for asynchronous operations after a successful StartOperation call.
7687+
7688+
Deprecated: Renamed to operation_token.
76737689
scheduleToCloseTimeout:
76747690
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
76757691
type: string
@@ -7719,6 +7735,9 @@ components:
77197735
blockedReason:
77207736
type: string
77217737
description: If the state is BLOCKED, blocked reason provides additional information.
7738+
operationToken:
7739+
type: string
7740+
description: Operation token. Only set for asynchronous operations after a successful StartOperation call.
77227741
description: PendingNexusOperationInfo contains the state of a pending Nexus operation.
77237742
PendingWorkflowTaskInfo:
77247743
type: object

temporal/api/failure/v1/message.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ message NexusOperationFailureInfo {
9595
// Operation name.
9696
string operation = 4;
9797
// Operation ID - may be empty if the operation completed synchronously.
98+
//
99+
// Deprecated: Renamed to operation_token.
98100
string operation_id = 5;
101+
// Operation token - may be empty if the operation completed synchronously.
102+
string operation_token = 6;
99103
}
100104

101105
message NexusHandlerFailureInfo {

temporal/api/history/v1/message.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,10 +866,16 @@ message NexusOperationStartedEventAttributes {
866866
int64 scheduled_event_id = 1;
867867
// The operation ID returned by the Nexus handler in the response to the StartOperation request.
868868
// This ID is used when canceling the operation.
869+
//
870+
// Deprecated: Renamed to operation_token.
869871
string operation_id = 3;
870872

871873
// The request ID allocated at schedule time.
872874
string request_id = 4;
875+
876+
// The operation token returned by the Nexus handler in the response to the StartOperation request.
877+
// This token is used when canceling the operation.
878+
string operation_token = 5;
873879
}
874880

875881
// Nexus operation completed successfully.

temporal/api/nexus/v1/message.proto

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ message CancelOperationRequest {
8484
// Type of operation to cancel.
8585
string operation = 2;
8686
// Operation ID as originally generated by a Handler.
87+
//
88+
// Deprecated: Renamed to operation_token.
8789
string operation_id = 3;
90+
91+
// Operation token as originally generated by a Handler.
92+
string operation_token = 4;
8893
}
8994

9095
// A Nexus request.
@@ -115,8 +120,10 @@ message StartOperationResponse {
115120
// The operation will complete asynchronously.
116121
// The returned ID can be used to reference this operation.
117122
message Async {
123+
// Deprecated: Renamed to operation_token.
118124
string operation_id = 1;
119125
repeated Link links = 2;
126+
string operation_token = 3;
120127
}
121128

122129
oneof variant {

temporal/api/workflow/v1/message.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@ message PendingNexusOperationInfo {
367367
string operation = 3;
368368

369369
// Operation ID. Only set for asynchronous operations after a successful StartOperation call.
370+
//
371+
// Deprecated: Renamed to operation_token.
370372
string operation_id = 4;
371373

372374
// Schedule-to-close timeout for this operation.
@@ -399,6 +401,9 @@ message PendingNexusOperationInfo {
399401

400402
// If the state is BLOCKED, blocked reason provides additional information.
401403
string blocked_reason = 14;
404+
405+
// Operation token. Only set for asynchronous operations after a successful StartOperation call.
406+
string operation_token = 15;
402407
}
403408

404409
// NexusOperationCancellationInfo contains the state of a nexus operation cancellation.

0 commit comments

Comments
 (0)