Skip to content

Commit 6ba6f91

Browse files
Google APIscopybara-github
authored andcommitted
feat: add UNAVAILABLE and QUEUED to state enum
feat: add LOG_NONE to call_log_level feat: add status, labels, duration and state_error fields to Execution feat: add filter and order_by fields to ListExecutionsRequest PiperOrigin-RevId: 557594531
1 parent 4d57489 commit 6ba6f91

2 files changed

Lines changed: 129 additions & 32 deletions

File tree

google/cloud/workflows/executions/v1/BUILD.bazel

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ proto_library(
2828
"//google/api:client_proto",
2929
"//google/api:field_behavior_proto",
3030
"//google/api:resource_proto",
31+
"@com_google_protobuf//:duration_proto",
3132
"@com_google_protobuf//:timestamp_proto",
3233
],
3334
)
@@ -134,6 +135,7 @@ go_gapic_library(
134135
transport = "grpc",
135136
deps = [
136137
":executions_go_proto",
138+
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
137139
],
138140
)
139141

@@ -166,6 +168,8 @@ py_gapic_library(
166168
rest_numeric_enums = False,
167169
service_yaml = "workflowexecutions_v1.yaml",
168170
transport = "grpc",
171+
deps = [
172+
],
169173
)
170174

171175
py_test(
@@ -209,7 +213,9 @@ php_gapic_library(
209213
rest_numeric_enums = False,
210214
service_yaml = "workflowexecutions_v1.yaml",
211215
transport = "grpc+rest",
212-
deps = [":executions_php_proto"],
216+
deps = [
217+
":executions_php_proto",
218+
],
213219
)
214220

215221
# Open Source Packages
@@ -289,6 +295,7 @@ ruby_cloud_gapic_library(
289295
ruby_cloud_description = "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero..",
290296
ruby_cloud_title = "Workflows Executions V1",
291297
service_yaml = "workflowexecutions_v1.yaml",
298+
transport = "grpc+rest",
292299
deps = [
293300
":executions_ruby_grpc",
294301
":executions_ruby_proto",
@@ -318,6 +325,7 @@ load(
318325

319326
csharp_proto_library(
320327
name = "executions_csharp_proto",
328+
extra_opts = [],
321329
deps = [":executions_proto"],
322330
)
323331

google/cloud/workflows/executions/v1/executions.proto

Lines changed: 120 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import "google/api/annotations.proto";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
23+
import "google/protobuf/duration.proto";
2324
import "google/protobuf/timestamp.proto";
2425

2526
option go_package = "cloud.google.com/go/workflows/executions/apiv1/executionspb;executionspb";
@@ -35,7 +36,8 @@ option (google.api.resource_definition) = {
3536
// [Workflows][google.cloud.workflows.v1.Workflow] called executions.
3637
service Executions {
3738
option (google.api.default_host) = "workflowexecutions.googleapis.com";
38-
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
39+
option (google.api.oauth_scopes) =
40+
"https://www.googleapis.com/auth/cloud-platform";
3941

4042
// Returns a list of executions which belong to the workflow with
4143
// the given name. The method returns executions of all workflow
@@ -83,6 +85,31 @@ message Execution {
8385
pattern: "projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}"
8486
};
8587

88+
// Describes the current state of the execution. More states might be added
89+
// in the future.
90+
enum State {
91+
// Invalid state.
92+
STATE_UNSPECIFIED = 0;
93+
94+
// The execution is in progress.
95+
ACTIVE = 1;
96+
97+
// The execution finished successfully.
98+
SUCCEEDED = 2;
99+
100+
// The execution failed with an error.
101+
FAILED = 3;
102+
103+
// The execution was stopped intentionally.
104+
CANCELLED = 4;
105+
106+
// Execution data is unavailable. See the `state_error` field.
107+
UNAVAILABLE = 5;
108+
109+
// Request has been placed in the backlog for processing at a later time.
110+
QUEUED = 6;
111+
}
112+
86113
// A single stack element (frame) where an error occurred.
87114
message StackTraceElement {
88115
// Position contains source position information about the stack trace
@@ -128,29 +155,10 @@ message Execution {
128155
StackTrace stack_trace = 3;
129156
}
130157

131-
// Describes the current state of the execution. More states might be added
132-
// in the future.
133-
enum State {
134-
// Invalid state.
135-
STATE_UNSPECIFIED = 0;
136-
137-
// The execution is in progress.
138-
ACTIVE = 1;
139-
140-
// The execution finished successfully.
141-
SUCCEEDED = 2;
142-
143-
// The execution failed with an error.
144-
FAILED = 3;
145-
146-
// The execution was stopped intentionally.
147-
CANCELLED = 4;
148-
}
149-
150158
// Describes the level of platform logging to apply to calls and call
151159
// responses during workflow executions.
152160
enum CallLogLevel {
153-
// No call logging specified.
161+
// No call logging level specified.
154162
CALL_LOG_LEVEL_UNSPECIFIED = 0;
155163

156164
// Log all call steps within workflows, all call returns, and all exceptions
@@ -159,6 +167,48 @@ message Execution {
159167

160168
// Log only exceptions that are raised from call steps within workflows.
161169
LOG_ERRORS_ONLY = 2;
170+
171+
// Explicitly log nothing.
172+
LOG_NONE = 3;
173+
}
174+
175+
// Represents the current status of this execution.
176+
message Status {
177+
// Represents a step of the workflow this execution is running.
178+
message Step {
179+
// Name of a routine within the workflow.
180+
string routine = 1;
181+
182+
// Name of a step within the routine.
183+
string step = 2;
184+
}
185+
186+
// A list of currently executing or last executed step names for the
187+
// workflow execution currently running. If the workflow has succeeded or
188+
// failed, this is the last attempted or executed step. Presently, if the
189+
// current step is inside a subworkflow, the list only includes that step.
190+
// In the future, the list will contain items for each step in the call
191+
// stack, starting with the outermost step in the `main` subworkflow, and
192+
// ending with the most deeply nested step.
193+
repeated Step current_steps = 1;
194+
}
195+
196+
// Describes an error related to the current state of the Execution resource.
197+
message StateError {
198+
// Describes the possible types of a state error.
199+
enum Type {
200+
// No type specified.
201+
TYPE_UNSPECIFIED = 0;
202+
203+
// Caused by an issue with KMS.
204+
KMS_ERROR = 1;
205+
}
206+
207+
// Provides specifics about the error.
208+
string details = 1;
209+
210+
// The type of this state error.
211+
Type type = 2;
162212
}
163213

164214
// Output only. The resource name of the execution.
@@ -167,10 +217,16 @@ message Execution {
167217
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
168218

169219
// Output only. Marks the beginning of execution.
170-
google.protobuf.Timestamp start_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
220+
google.protobuf.Timestamp start_time = 2
221+
[(google.api.field_behavior) = OUTPUT_ONLY];
171222

172223
// Output only. Marks the end of execution, successful or not.
173-
google.protobuf.Timestamp end_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
224+
google.protobuf.Timestamp end_time = 3
225+
[(google.api.field_behavior) = OUTPUT_ONLY];
226+
227+
// Output only. Measures the duration of the execution.
228+
google.protobuf.Duration duration = 12
229+
[(google.api.field_behavior) = OUTPUT_ONLY];
174230

175231
// Output only. Current state of the execution.
176232
State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -197,6 +253,24 @@ message Execution {
197253

198254
// The call logging level associated to this execution.
199255
CallLogLevel call_log_level = 9;
256+
257+
// Output only. Status tracks the current steps and progress data of this
258+
// execution.
259+
Status status = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
260+
261+
// Labels associated with this execution.
262+
// Labels can contain at most 64 entries. Keys and values can be no longer
263+
// than 63 characters and can only contain lowercase letters, numeric
264+
// characters, underscores, and dashes. Label keys must start with a letter.
265+
// International characters are allowed.
266+
// By default, labels are inherited from the workflow but are overridden by
267+
// any labels associated with the execution.
268+
map<string, string> labels = 11;
269+
270+
// Output only. Error regarding the state of the Execution resource. For
271+
// example, this field will have error details if the execution data is
272+
// unavailable due to revoked KMS key permissions.
273+
StateError state_error = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
200274
}
201275

202276
// Request for the
@@ -213,7 +287,7 @@ message ListExecutionsRequest {
213287
];
214288

215289
// Maximum number of executions to return per call.
216-
// Max supported value depends on the selected Execution view: it's 10000 for
290+
// Max supported value depends on the selected Execution view: it's 1000 for
217291
// BASIC and 100 for FULL. The default value used if the field is not
218292
// specified is 100, regardless of the selected view. Values greater than
219293
// the max value will be coerced down to it.
@@ -224,11 +298,26 @@ message ListExecutionsRequest {
224298
//
225299
// When paginating, all other parameters provided to `ListExecutions` must
226300
// match the call that provided the page token.
301+
//
302+
// Note that pagination is applied to dynamic data. The list of executions
303+
// returned can change between page requests.
227304
string page_token = 3;
228305

229-
// Optional. A view defining which fields should be filled in the returned executions.
230-
// The API will default to the BASIC view.
306+
// Optional. A view defining which fields should be filled in the returned
307+
// executions. The API will default to the BASIC view.
231308
ExecutionView view = 4 [(google.api.field_behavior) = OPTIONAL];
309+
310+
// Optional. Filters applied to the [Executions.ListExecutions] results.
311+
// The following fields are supported for filtering:
312+
// executionID, state, startTime, endTime, duration, workflowRevisionID,
313+
// stepName, and label.
314+
string filter = 5 [(google.api.field_behavior) = OPTIONAL];
315+
316+
// Optional. The ordering applied to the [Executions.ListExecutions] results.
317+
// By default the ordering is based on descending start time.
318+
// The following fields are supported for order by:
319+
// executionID, startTime, endTime, duration, state, and workflowRevisionID.
320+
string order_by = 6 [(google.api.field_behavior) = OPTIONAL];
232321
}
233322

234323
// Response for the
@@ -275,8 +364,8 @@ message GetExecutionRequest {
275364
}
276365
];
277366

278-
// Optional. A view defining which fields should be filled in the returned execution.
279-
// The API will default to the FULL view.
367+
// Optional. A view defining which fields should be filled in the returned
368+
// execution. The API will default to the FULL view.
280369
ExecutionView view = 2 [(google.api.field_behavior) = OPTIONAL];
281370
}
282371

@@ -301,8 +390,8 @@ enum ExecutionView {
301390
EXECUTION_VIEW_UNSPECIFIED = 0;
302391

303392
// Includes only basic metadata about the execution.
304-
// Following fields are returned: name, start_time, end_time, state
305-
// and workflow_revision_id.
393+
// The following fields are returned: name, start_time, end_time, duration,
394+
// state, and workflow_revision_id.
306395
BASIC = 1;
307396

308397
// Includes all data.

0 commit comments

Comments
 (0)