Skip to content

Commit

Permalink
Add MultiOperationExecutionFailure (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanos authored Apr 24, 2024
1 parent 17693ce commit 269455f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -1706,7 +1706,7 @@
"/api/v1/namespaces/{namespace}/workflows/execute-multi-operation": {
"post": {
"summary": "ExecuteMultiOperation executes multiple operations within a single workflow.",
"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.",
"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.",
"operationId": "ExecuteMultiOperation",
"responses": {
"200": {
Expand Down
6 changes: 2 additions & 4 deletions openapi/openapiv3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1469,10 +1469,8 @@ paths:
Operations are started atomically, meaning if *any* operation fails to be started, none are,
and the request fails. Upon start, the API returns only when *all* operations have a response.
Upon failure, the status code equals the status code of the *first* operation that failed to be started; and the
list of details contains one `google.grpc.Status` for each requested operation. The failed
operation(s) have the same error details as if it was executed separately. All other operations have the
status code `Aborted` and `temporal.api.failure.v1.MultiOperationExecutionAborted` is added to the details field.
Upon failure, it returns `MultiOperationExecutionFailure` where the status code
equals the status code of the *first* operation that failed to be started.
NOTE: Experimental API.
operationId: ExecuteMultiOperation
Expand Down
2 changes: 1 addition & 1 deletion temporal/api/common/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,4 @@ message Callback {
oneof variant {
Nexus nexus = 2;
}
}
}
19 changes: 19 additions & 0 deletions temporal/api/errordetails/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ option java_outer_classname = "MessageProto";
option ruby_package = "Temporalio::Api::ErrorDetails::V1";
option csharp_namespace = "Temporalio.Api.ErrorDetails.V1";

import "google/protobuf/any.proto";
import "temporal/api/common/v1/message.proto";

import "temporal/api/enums/v1/failed_cause.proto";
Expand Down Expand Up @@ -112,3 +113,21 @@ message NewerBuildExistsFailure {
// The current default compatible build ID which will receive tasks
string default_build_id = 1;
}

message MultiOperationExecutionFailure {
// One status for each requested operation from the failed MultiOperation. The failed
// operation(s) have the same error details as if it was executed separately. All other operations have the
// status code `Aborted` and `MultiOperationExecutionAborted` is added to the details field.
repeated OperationStatus statuses = 1;

// NOTE: `OperationStatus` is modelled after
// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto).
//
// (-- api-linter: core::0146::any=disabled
// aip.dev/not-precedent: details are meant to hold arbitrary payloads. --)
message OperationStatus {
int32 code = 1;
string message = 2;
repeated google.protobuf.Any details = 3;
}
}
6 changes: 2 additions & 4 deletions temporal/api/workflowservice/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,8 @@ service WorkflowService {
// Operations are started atomically, meaning if *any* operation fails to be started, none are,
// and the request fails. Upon start, the API returns only when *all* operations have a response.
//
// Upon failure, the status code equals the status code of the *first* operation that failed to be started; and the
// list of details contains one `google.grpc.Status` for each requested operation. The failed
// operation(s) have the same error details as if it was executed separately. All other operations have the
// status code `Aborted` and `temporal.api.failure.v1.MultiOperationExecutionAborted` is added to the details field.
// Upon failure, it returns `MultiOperationExecutionFailure` where the status code
// equals the status code of the *first* operation that failed to be started.
//
// NOTE: Experimental API.
rpc ExecuteMultiOperation (ExecuteMultiOperationRequest) returns (ExecuteMultiOperationResponse) {
Expand Down

0 comments on commit 269455f

Please sign in to comment.