Skip to content

Commit 37dd38c

Browse files
Respond to PR comments
1 parent 27b770c commit 37dd38c

File tree

3 files changed

+33
-23
lines changed

3 files changed

+33
-23
lines changed

temporal/api/callback/v1/message.proto

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,41 +52,44 @@ message CallbackExecutionInfo {
5252
// Information on how this callback should be invoked (e.g. its URL and type).
5353
temporal.api.common.v1.Callback callback = 3;
5454

55-
// Current state of the callback execution.
56-
temporal.api.enums.v1.CallbackExecutionState state = 4;
55+
// A general status for this callback, indicates whether it is currently running or in one of the terminal statuses.
56+
temporal.api.enums.v1.CallbackExecutionStatus status = 4;
57+
58+
// The detailed state of this callback, provides more granular information than the general status.
59+
temporal.api.enums.v1.CallbackState state = 5;
5760

5861
// The number of attempts made to deliver the callback.
5962
// This number represents a minimum bound since the attempt is incremented after the callback request completes.
60-
int32 attempt = 5;
63+
int32 attempt = 6;
6164

6265
// The time when the callback was created/scheduled.
63-
google.protobuf.Timestamp create_time = 6;
66+
google.protobuf.Timestamp create_time = 7;
6467

6568
// The time when the last attempt completed.
66-
google.protobuf.Timestamp last_attempt_complete_time = 7;
69+
google.protobuf.Timestamp last_attempt_complete_time = 8;
6770

6871
// The last attempt's failure, if any.
69-
temporal.api.failure.v1.Failure last_attempt_failure = 8;
72+
temporal.api.failure.v1.Failure last_attempt_failure = 9;
7073

7174
// The time when the next attempt is scheduled.
72-
google.protobuf.Timestamp next_attempt_schedule_time = 9;
75+
google.protobuf.Timestamp next_attempt_schedule_time = 10;
7376

7477
// If the state is BLOCKED, provides additional information.
75-
string blocked_reason = 10;
78+
string blocked_reason = 11;
7679

7780
// Time when the callback transitioned to a terminal state.
78-
google.protobuf.Timestamp close_time = 11;
81+
google.protobuf.Timestamp close_time = 12;
7982

8083
// Search attributes for indexing.
81-
temporal.api.common.v1.SearchAttributes search_attributes = 12;
84+
temporal.api.common.v1.SearchAttributes search_attributes = 13;
8285

8386
// Schedule-to-close timeout for this callback.
8487
// (-- api-linter: core::0140::prepositions=disabled
8588
// aip.dev/not-precedent: "to" is used to indicate interval. --)
86-
google.protobuf.Duration schedule_to_close_timeout = 13;
89+
google.protobuf.Duration schedule_to_close_timeout = 14;
8790

8891
// Incremented each time the callback's state is mutated in persistence.
89-
int64 state_transition_count = 14;
92+
int64 state_transition_count = 15;
9093
}
9194

9295
// Limited callback information returned in the list response.
@@ -97,8 +100,9 @@ message CallbackExecutionListInfo {
97100
// Run ID of the callback execution.
98101
string run_id = 2;
99102

100-
// Current state of the callback execution.
101-
temporal.api.enums.v1.CallbackExecutionState state = 3;
103+
// Only running and terminal statuses appear here. More detailed information in CallbackExecutionInfo but not
104+
// available in the list response.
105+
temporal.api.enums.v1.CallbackExecutionStatus status = 3;
102106

103107
// The time when the callback was created/scheduled.
104108
google.protobuf.Timestamp create_time = 4;

temporal/api/enums/v1/common.proto

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,22 @@ enum CallbackState {
5353
CALLBACK_STATE_TERMINATED = 7;
5454
}
5555

56-
// Terminal status of a standalone callback execution.
57-
enum CallbackExecutionState {
56+
// Status of a callback execution.
57+
// The status is updated once, when the callback is originally scheduled, and again when the callback reaches a terminal
58+
// status.
59+
// (-- api-linter: core::0216::synonyms=disabled
60+
// aip.dev/not-precedent: To be consistent with other enums like ActivityExecutionStatus. --)
61+
enum CallbackExecutionStatus {
5862
// Default value, unspecified status.
59-
CALLBACK_EXECUTION_STATE_UNSPECIFIED = 0;
63+
CALLBACK_EXECUTION_STATUS_UNSPECIFIED = 0;
6064
// Callback execution is running.
61-
CALLBACK_EXECUTION_STATE_RUNNING = 1;
65+
CALLBACK_EXECUTION_STATUS_RUNNING = 1;
6266
// Callback has succeeded.
63-
CALLBACK_EXECUTION_STATE_SUCCEEDED = 2;
67+
CALLBACK_EXECUTION_STATUS_SUCCEEDED = 2;
6468
// Callback has failed.
65-
CALLBACK_EXECUTION_STATE_FAILED = 3;
69+
CALLBACK_EXECUTION_STATUS_FAILED = 3;
6670
// Callback was terminated via TerminateCallbackExecution.
67-
CALLBACK_EXECUTION_STATE_TERMINATED = 4;
71+
CALLBACK_EXECUTION_STATUS_TERMINATED = 4;
6872
}
6973

7074
// State of a pending Nexus operation.

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3023,8 +3023,10 @@ message PollCallbackExecutionRequest {
30233023
string run_id = 3;
30243024
}
30253025

3026-
message PollCallbackExecutionResponse {
3027-
temporal.api.callback.v1.CallbackExecutionOutcome outcome = 1;
3026+
message PollCallbackExecutionResponse {
3027+
// The run ID of the callback, useful when run_id was not specified in the request.
3028+
string run_id = 1;
3029+
temporal.api.callback.v1.CallbackExecutionOutcome outcome = 2;
30283030
}
30293031

30303032
message ListCallbackExecutionsRequest {

0 commit comments

Comments
 (0)