Skip to content

Commit 21593a7

Browse files
authored
Add blocked state to callbacks, pending nexus operation and cancellation (#470)
1 parent 5862ec7 commit 21593a7

File tree

4 files changed

+48
-6
lines changed

4 files changed

+48
-6
lines changed

openapi/openapiv2.json

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6959,6 +6959,10 @@
69596959
"type": "string",
69606960
"format": "date-time",
69616961
"description": "The time when the next attempt is scheduled."
6962+
},
6963+
"blockedReason": {
6964+
"type": "string",
6965+
"description": "If the state is BLOCKED, blocked reason provides additional information."
69626966
}
69636967
},
69646968
"description": "CallbackInfo contains the state of an attached workflow callback."
@@ -6971,10 +6975,11 @@
69716975
"CALLBACK_STATE_SCHEDULED",
69726976
"CALLBACK_STATE_BACKING_OFF",
69736977
"CALLBACK_STATE_FAILED",
6974-
"CALLBACK_STATE_SUCCEEDED"
6978+
"CALLBACK_STATE_SUCCEEDED",
6979+
"CALLBACK_STATE_BLOCKED"
69756980
],
69766981
"default": "CALLBACK_STATE_UNSPECIFIED",
6977-
"description": "State of a callback.\n\n - CALLBACK_STATE_UNSPECIFIED: Default value, unspecified state.\n - CALLBACK_STATE_STANDBY: Callback is standing by, waiting to be triggered.\n - CALLBACK_STATE_SCHEDULED: Callback is in the queue waiting to be executed or is currently executing.\n - CALLBACK_STATE_BACKING_OFF: Callback has failed with a retryable error and is backing off before the next attempt.\n - CALLBACK_STATE_FAILED: Callback has failed.\n - CALLBACK_STATE_SUCCEEDED: Callback has succeeded."
6982+
"description": "State of a callback.\n\n - CALLBACK_STATE_UNSPECIFIED: Default value, unspecified state.\n - CALLBACK_STATE_STANDBY: Callback is standing by, waiting to be triggered.\n - CALLBACK_STATE_SCHEDULED: Callback is in the queue waiting to be executed or is currently executing.\n - CALLBACK_STATE_BACKING_OFF: Callback has failed with a retryable error and is backing off before the next attempt.\n - CALLBACK_STATE_FAILED: Callback has failed.\n - CALLBACK_STATE_SUCCEEDED: Callback has succeeded.\n - CALLBACK_STATE_BLOCKED: Callback is blocked (eg: by circuit breaker)."
69786983
},
69796984
"v1CancelExternalWorkflowExecutionFailedCause": {
69806985
"type": "string",
@@ -8999,6 +9004,10 @@
89999004
"type": "string",
90009005
"format": "date-time",
90019006
"description": "The time when the next attempt is scheduled."
9007+
},
9008+
"blockedReason": {
9009+
"type": "string",
9010+
"description": "If the state is BLOCKED, blocked reason provides additional information."
90029011
}
90039012
},
90049013
"description": "NexusOperationCancellationInfo contains the state of a nexus operation cancellation."
@@ -9011,10 +9020,11 @@
90119020
"NEXUS_OPERATION_CANCELLATION_STATE_BACKING_OFF",
90129021
"NEXUS_OPERATION_CANCELLATION_STATE_SUCCEEDED",
90139022
"NEXUS_OPERATION_CANCELLATION_STATE_FAILED",
9014-
"NEXUS_OPERATION_CANCELLATION_STATE_TIMED_OUT"
9023+
"NEXUS_OPERATION_CANCELLATION_STATE_TIMED_OUT",
9024+
"NEXUS_OPERATION_CANCELLATION_STATE_BLOCKED"
90159025
],
90169026
"default": "NEXUS_OPERATION_CANCELLATION_STATE_UNSPECIFIED",
9017-
"description": "State of a Nexus operation cancellation.\n\n - NEXUS_OPERATION_CANCELLATION_STATE_UNSPECIFIED: Default value, unspecified state.\n - NEXUS_OPERATION_CANCELLATION_STATE_SCHEDULED: Cancellation request is in the queue waiting to be executed or is currently executing.\n - NEXUS_OPERATION_CANCELLATION_STATE_BACKING_OFF: Cancellation request has failed with a retryable error and is backing off before the next attempt.\n - NEXUS_OPERATION_CANCELLATION_STATE_SUCCEEDED: Cancellation request succeeded.\n - NEXUS_OPERATION_CANCELLATION_STATE_FAILED: Cancellation request failed with a non-retryable error.\n - NEXUS_OPERATION_CANCELLATION_STATE_TIMED_OUT: The associated operation timed out - exceeded the user supplied schedule-to-close timeout."
9027+
"description": "State of a Nexus operation cancellation.\n\n - NEXUS_OPERATION_CANCELLATION_STATE_UNSPECIFIED: Default value, unspecified state.\n - NEXUS_OPERATION_CANCELLATION_STATE_SCHEDULED: Cancellation request is in the queue waiting to be executed or is currently executing.\n - NEXUS_OPERATION_CANCELLATION_STATE_BACKING_OFF: Cancellation request has failed with a retryable error and is backing off before the next attempt.\n - NEXUS_OPERATION_CANCELLATION_STATE_SUCCEEDED: Cancellation request succeeded.\n - NEXUS_OPERATION_CANCELLATION_STATE_FAILED: Cancellation request failed with a non-retryable error.\n - NEXUS_OPERATION_CANCELLATION_STATE_TIMED_OUT: The associated operation timed out - exceeded the user supplied schedule-to-close timeout.\n - NEXUS_OPERATION_CANCELLATION_STATE_BLOCKED: Cancellation request is blocked (eg: by circuit breaker)."
90189028
},
90199029
"v1NexusOperationCompletedEventAttributes": {
90209030
"type": "object",
@@ -9377,6 +9387,10 @@
93779387
"type": "string",
93789388
"format": "int64",
93799389
"description": "The event ID of the NexusOperationScheduled event. Can be used to correlate an operation in the\nDescribeWorkflowExecution response with workflow history."
9390+
},
9391+
"blockedReason": {
9392+
"type": "string",
9393+
"description": "If the state is BLOCKED, blocked reason provides additional information."
93809394
}
93819395
},
93829396
"description": "PendingNexusOperationInfo contains the state of a pending Nexus operation."
@@ -9387,10 +9401,11 @@
93879401
"PENDING_NEXUS_OPERATION_STATE_UNSPECIFIED",
93889402
"PENDING_NEXUS_OPERATION_STATE_SCHEDULED",
93899403
"PENDING_NEXUS_OPERATION_STATE_BACKING_OFF",
9390-
"PENDING_NEXUS_OPERATION_STATE_STARTED"
9404+
"PENDING_NEXUS_OPERATION_STATE_STARTED",
9405+
"PENDING_NEXUS_OPERATION_STATE_BLOCKED"
93919406
],
93929407
"default": "PENDING_NEXUS_OPERATION_STATE_UNSPECIFIED",
9393-
"description": "State of a pending Nexus operation.\n\n - PENDING_NEXUS_OPERATION_STATE_UNSPECIFIED: Default value, unspecified state.\n - PENDING_NEXUS_OPERATION_STATE_SCHEDULED: Operation is in the queue waiting to be executed or is currently executing.\n - PENDING_NEXUS_OPERATION_STATE_BACKING_OFF: Operation has failed with a retryable error and is backing off before the next attempt.\n - PENDING_NEXUS_OPERATION_STATE_STARTED: Operation was started and will complete asynchronously."
9408+
"description": "State of a pending Nexus operation.\n\n - PENDING_NEXUS_OPERATION_STATE_UNSPECIFIED: Default value, unspecified state.\n - PENDING_NEXUS_OPERATION_STATE_SCHEDULED: Operation is in the queue waiting to be executed or is currently executing.\n - PENDING_NEXUS_OPERATION_STATE_BACKING_OFF: Operation has failed with a retryable error and is backing off before the next attempt.\n - PENDING_NEXUS_OPERATION_STATE_STARTED: Operation was started and will complete asynchronously.\n - PENDING_NEXUS_OPERATION_STATE_BLOCKED: Operation is blocked (eg: by circuit breaker)."
93949409
},
93959410
"v1PendingWorkflowTaskInfo": {
93969411
"type": "object",

openapi/openapiv3.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4983,6 +4983,7 @@ components:
49834983
- CALLBACK_STATE_BACKING_OFF
49844984
- CALLBACK_STATE_FAILED
49854985
- CALLBACK_STATE_SUCCEEDED
4986+
- CALLBACK_STATE_BLOCKED
49864987
type: string
49874988
format: enum
49884989
attempt:
@@ -5003,6 +5004,9 @@ components:
50035004
type: string
50045005
description: The time when the next attempt is scheduled.
50055006
format: date-time
5007+
blockedReason:
5008+
type: string
5009+
description: If the state is BLOCKED, blocked reason provides additional information.
50065010
description: CallbackInfo contains the state of an attached workflow callback.
50075011
CallbackInfo_Trigger:
50085012
type: object
@@ -6582,6 +6586,7 @@ components:
65826586
- NEXUS_OPERATION_CANCELLATION_STATE_SUCCEEDED
65836587
- NEXUS_OPERATION_CANCELLATION_STATE_FAILED
65846588
- NEXUS_OPERATION_CANCELLATION_STATE_TIMED_OUT
6589+
- NEXUS_OPERATION_CANCELLATION_STATE_BLOCKED
65856590
type: string
65866591
format: enum
65876592
attempt:
@@ -6602,6 +6607,9 @@ components:
66026607
type: string
66036608
description: The time when the next attempt is scheduled.
66046609
format: date-time
6610+
blockedReason:
6611+
type: string
6612+
description: If the state is BLOCKED, blocked reason provides additional information.
66056613
description: NexusOperationCancellationInfo contains the state of a nexus operation cancellation.
66066614
NexusOperationCompletedEventAttributes:
66076615
type: object
@@ -6928,6 +6936,7 @@ components:
69286936
- PENDING_NEXUS_OPERATION_STATE_SCHEDULED
69296937
- PENDING_NEXUS_OPERATION_STATE_BACKING_OFF
69306938
- PENDING_NEXUS_OPERATION_STATE_STARTED
6939+
- PENDING_NEXUS_OPERATION_STATE_BLOCKED
69316940
type: string
69326941
format: enum
69336942
attempt:
@@ -6955,6 +6964,9 @@ components:
69556964
description: |-
69566965
The event ID of the NexusOperationScheduled event. Can be used to correlate an operation in the
69576966
DescribeWorkflowExecution response with workflow history.
6967+
blockedReason:
6968+
type: string
6969+
description: If the state is BLOCKED, blocked reason provides additional information.
69586970
description: PendingNexusOperationInfo contains the state of a pending Nexus operation.
69596971
PendingWorkflowTaskInfo:
69606972
type: object

temporal/api/enums/v1/common.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ enum CallbackState {
6969
CALLBACK_STATE_FAILED = 4;
7070
// Callback has succeeded.
7171
CALLBACK_STATE_SUCCEEDED = 5;
72+
// Callback is blocked (eg: by circuit breaker).
73+
CALLBACK_STATE_BLOCKED = 6;
7274
}
7375

7476
// State of a pending Nexus operation.
@@ -81,6 +83,8 @@ enum PendingNexusOperationState {
8183
PENDING_NEXUS_OPERATION_STATE_BACKING_OFF = 2;
8284
// Operation was started and will complete asynchronously.
8385
PENDING_NEXUS_OPERATION_STATE_STARTED = 3;
86+
// Operation is blocked (eg: by circuit breaker).
87+
PENDING_NEXUS_OPERATION_STATE_BLOCKED = 4;
8488
}
8589

8690
// State of a Nexus operation cancellation.
@@ -97,4 +101,6 @@ enum NexusOperationCancellationState {
97101
NEXUS_OPERATION_CANCELLATION_STATE_FAILED = 4;
98102
// The associated operation timed out - exceeded the user supplied schedule-to-close timeout.
99103
NEXUS_OPERATION_CANCELLATION_STATE_TIMED_OUT = 5;
104+
// Cancellation request is blocked (eg: by circuit breaker).
105+
NEXUS_OPERATION_CANCELLATION_STATE_BLOCKED = 6;
100106
}

temporal/api/workflow/v1/message.proto

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ message CallbackInfo {
258258
temporal.api.failure.v1.Failure last_attempt_failure = 7;
259259
// The time when the next attempt is scheduled.
260260
google.protobuf.Timestamp next_attempt_schedule_time = 8;
261+
262+
// If the state is BLOCKED, blocked reason provides additional information.
263+
string blocked_reason = 9;
261264
}
262265

263266
// PendingNexusOperationInfo contains the state of a pending Nexus operation.
@@ -300,6 +303,9 @@ message PendingNexusOperationInfo {
300303
// The event ID of the NexusOperationScheduled event. Can be used to correlate an operation in the
301304
// DescribeWorkflowExecution response with workflow history.
302305
int64 scheduled_event_id = 13;
306+
307+
// If the state is BLOCKED, blocked reason provides additional information.
308+
string blocked_reason = 14;
303309
}
304310

305311
// NexusOperationCancellationInfo contains the state of a nexus operation cancellation.
@@ -319,4 +325,7 @@ message NexusOperationCancellationInfo {
319325
temporal.api.failure.v1.Failure last_attempt_failure = 5;
320326
// The time when the next attempt is scheduled.
321327
google.protobuf.Timestamp next_attempt_schedule_time = 6;
328+
329+
// If the state is BLOCKED, blocked reason provides additional information.
330+
string blocked_reason = 7;
322331
}

0 commit comments

Comments
 (0)