Skip to content

Commit 269455f

Browse files
authored
Add MultiOperationExecutionFailure (#398)
1 parent 17693ce commit 269455f

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed

openapi/openapiv2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,7 @@
17061706
"/api/v1/namespaces/{namespace}/workflows/execute-multi-operation": {
17071707
"post": {
17081708
"summary": "ExecuteMultiOperation executes multiple operations within a single workflow.",
1709-
"description": "Operations are started atomically, meaning if *any* operation fails to be started, none are,\nand the request fails. Upon start, the API returns only when *all* operations have a response.\n\nUpon failure, the status code equals the status code of the *first* operation that failed to be started; and the\nlist of details contains one `google.grpc.Status` for each requested operation. The failed\noperation(s) have the same error details as if it was executed separately. All other operations have the\nstatus code `Aborted` and `temporal.api.failure.v1.MultiOperationExecutionAborted` is added to the details field.\n\nNOTE: Experimental API.",
1709+
"description": "Operations are started atomically, meaning if *any* operation fails to be started, none are,\nand the request fails. Upon start, the API returns only when *all* operations have a response.\n\nUpon failure, it returns `MultiOperationExecutionFailure` where the status code\nequals the status code of the *first* operation that failed to be started.\n\nNOTE: Experimental API.",
17101710
"operationId": "ExecuteMultiOperation",
17111711
"responses": {
17121712
"200": {

openapi/openapiv3.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,10 +1469,8 @@ paths:
14691469
Operations are started atomically, meaning if *any* operation fails to be started, none are,
14701470
and the request fails. Upon start, the API returns only when *all* operations have a response.
14711471
1472-
Upon failure, the status code equals the status code of the *first* operation that failed to be started; and the
1473-
list of details contains one `google.grpc.Status` for each requested operation. The failed
1474-
operation(s) have the same error details as if it was executed separately. All other operations have the
1475-
status code `Aborted` and `temporal.api.failure.v1.MultiOperationExecutionAborted` is added to the details field.
1472+
Upon failure, it returns `MultiOperationExecutionFailure` where the status code
1473+
equals the status code of the *first* operation that failed to be started.
14761474
14771475
NOTE: Experimental API.
14781476
operationId: ExecuteMultiOperation

temporal/api/common/v1/message.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,4 @@ message Callback {
191191
oneof variant {
192192
Nexus nexus = 2;
193193
}
194-
}
194+
}

temporal/api/errordetails/v1/message.proto

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ option java_outer_classname = "MessageProto";
3434
option ruby_package = "Temporalio::Api::ErrorDetails::V1";
3535
option csharp_namespace = "Temporalio.Api.ErrorDetails.V1";
3636

37+
import "google/protobuf/any.proto";
3738
import "temporal/api/common/v1/message.proto";
3839

3940
import "temporal/api/enums/v1/failed_cause.proto";
@@ -112,3 +113,21 @@ message NewerBuildExistsFailure {
112113
// The current default compatible build ID which will receive tasks
113114
string default_build_id = 1;
114115
}
116+
117+
message MultiOperationExecutionFailure {
118+
// One status for each requested operation from the failed MultiOperation. The failed
119+
// operation(s) have the same error details as if it was executed separately. All other operations have the
120+
// status code `Aborted` and `MultiOperationExecutionAborted` is added to the details field.
121+
repeated OperationStatus statuses = 1;
122+
123+
// NOTE: `OperationStatus` is modelled after
124+
// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto).
125+
//
126+
// (-- api-linter: core::0146::any=disabled
127+
// aip.dev/not-precedent: details are meant to hold arbitrary payloads. --)
128+
message OperationStatus {
129+
int32 code = 1;
130+
string message = 2;
131+
repeated google.protobuf.Any details = 3;
132+
}
133+
}

temporal/api/workflowservice/v1/service.proto

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,8 @@ service WorkflowService {
112112
// Operations are started atomically, meaning if *any* operation fails to be started, none are,
113113
// and the request fails. Upon start, the API returns only when *all* operations have a response.
114114
//
115-
// Upon failure, the status code equals the status code of the *first* operation that failed to be started; and the
116-
// list of details contains one `google.grpc.Status` for each requested operation. The failed
117-
// operation(s) have the same error details as if it was executed separately. All other operations have the
118-
// status code `Aborted` and `temporal.api.failure.v1.MultiOperationExecutionAborted` is added to the details field.
115+
// Upon failure, it returns `MultiOperationExecutionFailure` where the status code
116+
// equals the status code of the *first* operation that failed to be started.
119117
//
120118
// NOTE: Experimental API.
121119
rpc ExecuteMultiOperation (ExecuteMultiOperationRequest) returns (ExecuteMultiOperationResponse) {

0 commit comments

Comments
 (0)