From 13a17820fb78f92f5c037d522d841c732cc13d07 Mon Sep 17 00:00:00 2001 From: Yuri Date: Thu, 8 Aug 2024 11:00:46 -0700 Subject: [PATCH 01/12] Definitions for single activity API --- temporal/api/activity/v1/message.proto | 83 +++++++++++++++++++ temporal/api/enums/v1/common.proto | 18 ++++ .../workflowservice/v1/request_response.proto | 56 +++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 temporal/api/activity/v1/message.proto diff --git a/temporal/api/activity/v1/message.proto b/temporal/api/activity/v1/message.proto new file mode 100644 index 00000000..44beaa98 --- /dev/null +++ b/temporal/api/activity/v1/message.proto @@ -0,0 +1,83 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.activity.v1; + +option go_package = "go.temporal.io/api/activity/v1;activity"; +option java_package = "io.temporal.api.activity.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporalio::Api::Activity::V1"; +option csharp_namespace = "Temporalio.Api.Activity.V1"; + +import "temporal/api/common/v1/message.proto"; +import "temporal/api/taskqueue/v1/message.proto"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; + +message Timeouts { + // Indicates how long the caller is willing to wait for activity completion. The "schedule" time + // is when the activity is initially scheduled, not when the most recent retry is scheduled. + // Limits how long retries will be attempted. Either this or `start_to_close_timeout` must be + // specified. When not specified, defaults to the workflow execution timeout. + // + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration schedule_to_close_timeout = 1; + // Limits the time an activity task can stay in a task queue before a worker picks it up. The + // "schedule" time is when the most recent retry is scheduled. This timeout should usually not + // be set: it's useful in specific scenarios like worker-specific task queues. This timeout is + // always non retryable, as all a retry would achieve is to put it back into the same queue. + // Defaults to `schedule_to_close_timeout` or workflow execution timeout if that is not + // specified. More info: + // https://docs.temporal.io/docs/content/what-is-a-schedule-to-start-timeout/ + // + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration schedule_to_start_timeout = 2; + // Maximum time an activity is allowed to execute after being picked up by a worker. This + // timeout is always retryable. Either this or `schedule_to_close_timeout` must be specified. + // + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration start_to_close_timeout = 3; + // Maximum permitted time between successful worker heartbeats. + google.protobuf.Duration heartbeat_timeout = 4; + +} + +message ActivityOptions { + temporal.api.taskqueue.v1.TaskQueue task_queue = 1; + + temporal.api.activity.v1.Timeouts timeouts = 2; + + temporal.api.common.v1.RetryPolicy retry_policy = 3; +} + +message ActivityUpdate { + temporal.api.activity.v1.ActivityOptions options = 1; + + google.protobuf.FieldMask update_mask = 2; +} diff --git a/temporal/api/enums/v1/common.proto b/temporal/api/enums/v1/common.proto index e137bc66..8717aa16 100644 --- a/temporal/api/enums/v1/common.proto +++ b/temporal/api/enums/v1/common.proto @@ -98,3 +98,21 @@ enum NexusOperationCancellationState { // The associated operation timed out - exceeded the user supplied schedule-to-close timeout. NEXUS_OPERATION_CANCELLATION_STATE_TIMED_OUT = 5; } + +// State of the activity +enum ActivityState { + // Default value, unspecified state. + ACTIVITY_STATE_UNSPECIFIED = 0; + // Activity is scheduled for execution + ACTIVITY_STATE_SCHEDULED = 1; + // Activity is currently running + ACTIVITY_STATE_RUNNING = 2; + // Activity is paused + ACTIVITY_STATE_PAUSED = 3; + // Activity is completed successfully + ACTIVITY_STATE_SUCCEEDED = 4; + // Activity is completed, failed + ACTIVITY_STATE_FAILED = 5; + // Activity is completed, timed out + ACTIVITY_STATE_TIMED_OUT = 6; +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index e086d72f..ab7b05dc 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -55,6 +55,7 @@ import "temporal/api/taskqueue/v1/message.proto"; import "temporal/api/update/v1/message.proto"; import "temporal/api/version/v1/message.proto"; import "temporal/api/batch/v1/message.proto"; +import "temporal/api/activity/v1/message.proto"; import "temporal/api/sdk/v1/task_complete_metadata.proto"; import "temporal/api/sdk/v1/user_metadata.proto"; import "temporal/api/nexus/v1/message.proto"; @@ -1652,3 +1653,58 @@ message ExecuteMultiOperationResponse { } } } + +message UpdateActivityRequest { + string namespace = 1; + string workflow_id = 2; + string run_id = 3 ; + string activity_id = 4; + + temporal.api.activity.v1.ActivityUpdate activity_update = 5; + // The identity of the worker/client/caller + string identity = 6; +} + +message UpdateActivityResponse { +} + +message DescribeActivityRequest { + string namespace = 1; + string workflow_id = 2; + string run_id = 3 ; + string activity_id = 4; + + string identity = 5; +} + +message DescribeActivityResponse { + temporal.api.activity.v1.ActivityOptions activity_options = 1; + + temporal.api.enums.v1.ActivityState activity_state = 2; +} + +message PauseActivityRequest { + string namespace = 1; + string workflow_id = 2; + string run_id = 3 ; + string activity_id = 4; + + string identity = 5; +} + +message PauseActivityResponse { +} + +message ResumeActivityRequest { + string namespace = 1; + string workflow_id = 2; + string run_id = 3 ; + string activity_id = 4; + + bool trigger = 5; + bool reset = 6; + + string identity = 7; +} +message ResumeActivityResponse { +} \ No newline at end of file From 76c0a1c674fdcbe6d508bb3082ffd8583889452d Mon Sep 17 00:00:00 2001 From: Yuri Date: Thu, 8 Aug 2024 11:25:02 -0700 Subject: [PATCH 02/12] add rpc calls --- .../workflowservice/v1/request_response.proto | 4 +- temporal/api/workflowservice/v1/service.proto | 49 +++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index ab7b05dc..5f4cabd2 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1701,8 +1701,8 @@ message ResumeActivityRequest { string run_id = 3 ; string activity_id = 4; - bool trigger = 5; - bool reset = 6; + bool trigger_immediately = 5; + bool reset_attempts = 6; string identity = 7; } diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index cd73cb81..153a6a33 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -835,4 +835,53 @@ service WorkflowService { // aip.dev/not-precedent: We do not expose worker API to HTTP. --) rpc RespondNexusTaskFailed(RespondNexusTaskFailedRequest) returns (RespondNexusTaskFailedResponse) { } + + rpc UpdateActivity (UpdateActivityRequest) returns (UpdateActivityResponse) + { + option (google.api.http) = { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/update" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/update" + body: "*" + } + }; + } + + rpc DescribeActivity (DescribeActivityRequest) returns (DescribeActivityResponse) + { + option (google.api.http) = { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}" + body: "*" + } + }; + } + + // PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started. + rpc PauseActivity (PauseActivityRequest) returns (PauseActivityResponse) + { + option (google.api.http) = { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/pause" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/pause" + body: "*" + } + }; + } + // ResumeActivity will basically unpause the activity is the activity is in the paused state. + rpc ResumeActivity (ResumeActivityRequest) returns (ResumeActivityResponse) + { + option (google.api.http) = { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/resume" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/resume" + body: "*" + } + }; + } } From b3984a24ad943380e6da6ed370c9a47f94a130ad Mon Sep 17 00:00:00 2001 From: Yuri Date: Thu, 8 Aug 2024 11:37:03 -0700 Subject: [PATCH 03/12] make task queue a string in activity update message --- temporal/api/activity/v1/message.proto | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/temporal/api/activity/v1/message.proto b/temporal/api/activity/v1/message.proto index 44beaa98..c5733c36 100644 --- a/temporal/api/activity/v1/message.proto +++ b/temporal/api/activity/v1/message.proto @@ -65,7 +65,6 @@ message Timeouts { google.protobuf.Duration start_to_close_timeout = 3; // Maximum permitted time between successful worker heartbeats. google.protobuf.Duration heartbeat_timeout = 4; - } message ActivityOptions { @@ -77,7 +76,11 @@ message ActivityOptions { } message ActivityUpdate { - temporal.api.activity.v1.ActivityOptions options = 1; + string task_queue = 1; + + temporal.api.activity.v1.Timeouts timeouts = 2; + + temporal.api.common.v1.RetryPolicy retry_policy = 3; - google.protobuf.FieldMask update_mask = 2; + google.protobuf.FieldMask update_mask = 4; } From 3d44dc89b0faaac9ba0b30ded646318be6c9d087 Mon Sep 17 00:00:00 2001 From: Yuri Date: Thu, 8 Aug 2024 11:55:03 -0700 Subject: [PATCH 04/12] update opeapi definitions --- openapi/openapiv2.json | 545 +++++++++++++++++++++++++++++++++++++++++ openapi/openapiv3.yaml | 470 +++++++++++++++++++++++++++++++++++ 2 files changed, 1015 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 4a5ab1d6..93d466fe 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -2065,6 +2065,208 @@ ] } }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}": { + "post": { + "operationId": "DescribeActivity2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceDescribeActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { + "post": { + "summary": "PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started.", + "operationId": "PauseActivity2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resume": { + "post": { + "summary": "ResumeActivity will basically unpause the activity is the activity is in the paused state.", + "operationId": "ResumeActivity2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ResumeActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResumeActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update": { + "post": { + "operationId": "UpdateActivity2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { "post": { "summary": "SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if\nit isn't yet started.", @@ -4563,6 +4765,208 @@ ] } }, + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}": { + "post": { + "operationId": "DescribeActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceDescribeActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { + "post": { + "summary": "PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started.", + "operationId": "PauseActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resume": { + "post": { + "summary": "ResumeActivity will basically unpause the activity is the activity is in the paused state.", + "operationId": "ResumeActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ResumeActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResumeActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update": { + "post": { + "operationId": "UpdateActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { "post": { "summary": "SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if\nit isn't yet started.", @@ -4905,6 +5309,17 @@ } } }, + "WorkflowServiceDescribeActivityBody": { + "type": "object", + "properties": { + "runId": { + "type": "string" + }, + "identity": { + "type": "string" + } + } + }, "WorkflowServiceExecuteMultiOperationBody": { "type": "object", "properties": { @@ -4934,6 +5349,17 @@ } } }, + "WorkflowServicePauseActivityBody": { + "type": "object", + "properties": { + "runId": { + "type": "string" + }, + "identity": { + "type": "string" + } + } + }, "WorkflowServiceQueryWorkflowBody": { "type": "object", "properties": { @@ -5225,6 +5651,23 @@ } } }, + "WorkflowServiceResumeActivityBody": { + "type": "object", + "properties": { + "runId": { + "type": "string" + }, + "triggerImmediately": { + "type": "boolean" + }, + "resetAttempts": { + "type": "boolean" + }, + "identity": { + "type": "string" + } + } + }, "WorkflowServiceSignalWithStartWorkflowExecutionBody": { "type": "object", "properties": { @@ -5514,6 +5957,21 @@ } } }, + "WorkflowServiceUpdateActivityBody": { + "type": "object", + "properties": { + "runId": { + "type": "string" + }, + "activityUpdate": { + "$ref": "#/definitions/v1ActivityUpdate" + }, + "identity": { + "type": "string", + "title": "The identity of the worker/client/caller" + } + } + }, "WorkflowServiceUpdateNamespaceBody": { "type": "object", "properties": { @@ -5780,6 +6238,20 @@ } } }, + "v1ActivityOptions": { + "type": "object", + "properties": { + "taskQueue": { + "$ref": "#/definitions/v1TaskQueue" + }, + "timeouts": { + "$ref": "#/definitions/v1Timeouts" + }, + "retryPolicy": { + "$ref": "#/definitions/v1RetryPolicy" + } + } + }, "v1ActivityPropertiesModifiedExternallyEventAttributes": { "type": "object", "properties": { @@ -5794,6 +6266,21 @@ } } }, + "v1ActivityState": { + "type": "string", + "enum": [ + "ACTIVITY_STATE_UNSPECIFIED", + "ACTIVITY_STATE_SCHEDULED", + "ACTIVITY_STATE_RUNNING", + "ACTIVITY_STATE_PAUSED", + "ACTIVITY_STATE_SUCCEEDED", + "ACTIVITY_STATE_FAILED", + "ACTIVITY_STATE_TIMED_OUT" + ], + "default": "ACTIVITY_STATE_UNSPECIFIED", + "description": "- ACTIVITY_STATE_UNSPECIFIED: Default value, unspecified state.\n - ACTIVITY_STATE_SCHEDULED: Activity is scheduled for execution\n - ACTIVITY_STATE_RUNNING: Activity is currently running\n - ACTIVITY_STATE_PAUSED: Activity is paused\n - ACTIVITY_STATE_SUCCEEDED: Activity is completed successfully\n - ACTIVITY_STATE_FAILED: Activity is completed, failed\n - ACTIVITY_STATE_TIMED_OUT: Activity is completed, timed out", + "title": "State of the activity" + }, "v1ActivityTaskCancelRequestedEventAttributes": { "type": "object", "properties": { @@ -6015,6 +6502,23 @@ }, "title": "Represents the identifier used by a activity author to define the activity. Typically, the\nname of a function. This is sometimes referred to as the activity's \"name\"" }, + "v1ActivityUpdate": { + "type": "object", + "properties": { + "taskQueue": { + "type": "string" + }, + "timeouts": { + "$ref": "#/definitions/v1Timeouts" + }, + "retryPolicy": { + "$ref": "#/definitions/v1RetryPolicy" + }, + "updateMask": { + "type": "string" + } + } + }, "v1AddOrUpdateRemoteClusterResponse": { "type": "object" }, @@ -6949,6 +7453,17 @@ "type": "object", "description": "Deprecated." }, + "v1DescribeActivityResponse": { + "type": "object", + "properties": { + "activityOptions": { + "$ref": "#/definitions/v1ActivityOptions" + }, + "activityState": { + "$ref": "#/definitions/v1ActivityState" + } + } + }, "v1DescribeBatchOperationResponse": { "type": "object", "properties": { @@ -8580,6 +9095,9 @@ "v1PatchScheduleResponse": { "type": "object" }, + "v1PauseActivityResponse": { + "type": "object" + }, "v1Payload": { "description": "Arbitrary payload data in an unconstrained format.\nThis may be activity input parameters, a workflow result, a memo, etc.\n" }, @@ -9528,6 +10046,9 @@ "v1RespondWorkflowTaskFailedResponse": { "type": "object" }, + "v1ResumeActivityResponse": { + "type": "object" + }, "v1RetryPolicy": { "type": "object", "properties": { @@ -10835,6 +11356,27 @@ ], "default": "TIMEOUT_TYPE_UNSPECIFIED" }, + "v1Timeouts": { + "type": "object", + "properties": { + "scheduleToCloseTimeout": { + "type": "string", + "description": "Indicates how long the caller is willing to wait for activity completion. The \"schedule\" time\nis when the activity is initially scheduled, not when the most recent retry is scheduled.\nLimits how long retries will be attempted. Either this or `start_to_close_timeout` must be\nspecified. When not specified, defaults to the workflow execution timeout.\n" + }, + "scheduleToStartTimeout": { + "type": "string", + "title": "Limits the time an activity task can stay in a task queue before a worker picks it up. The\n\"schedule\" time is when the most recent retry is scheduled. This timeout should usually not\nbe set: it's useful in specific scenarios like worker-specific task queues. This timeout is\nalways non retryable, as all a retry would achieve is to put it back into the same queue.\nDefaults to `schedule_to_close_timeout` or workflow execution timeout if that is not\nspecified. More info:\nhttps://docs.temporal.io/docs/content/what-is-a-schedule-to-start-timeout/" + }, + "startToCloseTimeout": { + "type": "string", + "description": "Maximum time an activity is allowed to execute after being picked up by a worker. This\ntimeout is always retryable. Either this or `schedule_to_close_timeout` must be specified.\n" + }, + "heartbeatTimeout": { + "type": "string", + "description": "Maximum permitted time between successful worker heartbeats." + } + } + }, "v1TimerCanceledEventAttributes": { "type": "object", "properties": { @@ -10935,6 +11477,9 @@ } } }, + "v1UpdateActivityResponse": { + "type": "object" + }, "v1UpdateAdmittedEventOrigin": { "type": "string", "enum": [ diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 6d9d73fa..37a13f66 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1561,6 +1561,168 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}: + post: + tags: + - WorkflowService + operationId: DescribeActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: workflowId + in: path + required: true + schema: + type: string + - name: activityId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: + post: + tags: + - WorkflowService + description: PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started. + operationId: PauseActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: workflowId + in: path + required: true + schema: + type: string + - name: activityId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resume: + post: + tags: + - WorkflowService + description: ResumeActivity will basically unpause the activity is the activity is in the paused state. + operationId: ResumeActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: workflowId + in: path + required: true + schema: + type: string + - name: activityId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResumeActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResumeActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update: + post: + tags: + - WorkflowService + operationId: UpdateActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: workflowId + in: path + required: true + schema: + type: string + - name: activityId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}: post: tags: @@ -3730,6 +3892,168 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}: + post: + tags: + - WorkflowService + operationId: DescribeActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: workflowId + in: path + required: true + schema: + type: string + - name: activityId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: + post: + tags: + - WorkflowService + description: PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started. + operationId: PauseActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: workflowId + in: path + required: true + schema: + type: string + - name: activityId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resume: + post: + tags: + - WorkflowService + description: ResumeActivity will basically unpause the activity is the activity is in the paused state. + operationId: ResumeActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: workflowId + in: path + required: true + schema: + type: string + - name: activityId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResumeActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResumeActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update: + post: + tags: + - WorkflowService + operationId: UpdateActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: workflowId + in: path + required: true + schema: + type: string + - name: activityId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}: post: tags: @@ -4039,6 +4363,15 @@ components: - RETRY_STATE_CANCEL_REQUESTED type: string format: enum + ActivityOptions: + type: object + properties: + taskQueue: + $ref: '#/components/schemas/TaskQueue' + timeouts: + $ref: '#/components/schemas/Timeouts' + retryPolicy: + $ref: '#/components/schemas/RetryPolicy' ActivityPropertiesModifiedExternallyEventAttributes: type: object properties: @@ -4272,6 +4605,18 @@ components: description: |- Represents the identifier used by a activity author to define the activity. Typically, the name of a function. This is sometimes referred to as the activity's "name" + ActivityUpdate: + type: object + properties: + taskQueue: + type: string + timeouts: + $ref: '#/components/schemas/Timeouts' + retryPolicy: + $ref: '#/components/schemas/RetryPolicy' + updateMask: + type: string + format: field-mask Alert: type: object properties: @@ -4977,6 +5322,35 @@ components: DeleteScheduleResponse: type: object properties: {} + DescribeActivityRequest: + type: object + properties: + namespace: + type: string + workflowId: + type: string + runId: + type: string + activityId: + type: string + identity: + type: string + DescribeActivityResponse: + type: object + properties: + activityOptions: + $ref: '#/components/schemas/ActivityOptions' + activityState: + enum: + - ACTIVITY_STATE_UNSPECIFIED + - ACTIVITY_STATE_SCHEDULED + - ACTIVITY_STATE_RUNNING + - ACTIVITY_STATE_PAUSED + - ACTIVITY_STATE_SUCCEEDED + - ACTIVITY_STATE_FAILED + - ACTIVITY_STATE_TIMED_OUT + type: string + format: enum DescribeBatchOperationResponse: type: object properties: @@ -6340,6 +6714,22 @@ components: PatchScheduleResponse: type: object properties: {} + PauseActivityRequest: + type: object + properties: + namespace: + type: string + workflowId: + type: string + runId: + type: string + activityId: + type: string + identity: + type: string + PauseActivityResponse: + type: object + properties: {} Payload: description: |- Represents some binary (byte array) data (ex: activity input parameters or workflow result) with @@ -7188,6 +7578,26 @@ components: description: |- Server validation failures could include last_heartbeat_details payload is too large, request failure is too large + ResumeActivityRequest: + type: object + properties: + namespace: + type: string + workflowId: + type: string + runId: + type: string + activityId: + type: string + triggerImmediately: + type: boolean + resetAttempts: + type: boolean + identity: + type: string + ResumeActivityResponse: + type: object + properties: {} RetryPolicy: type: object properties: @@ -8314,6 +8724,47 @@ components: format: enum lastHeartbeatDetails: $ref: '#/components/schemas/Payloads' + Timeouts: + type: object + properties: + scheduleToCloseTimeout: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + Indicates how long the caller is willing to wait for activity completion. The "schedule" time + is when the activity is initially scheduled, not when the most recent retry is scheduled. + Limits how long retries will be attempted. Either this or `start_to_close_timeout` must be + specified. When not specified, defaults to the workflow execution timeout. + + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "to" is used to indicate interval. --) + scheduleToStartTimeout: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + Limits the time an activity task can stay in a task queue before a worker picks it up. The + "schedule" time is when the most recent retry is scheduled. This timeout should usually not + be set: it's useful in specific scenarios like worker-specific task queues. This timeout is + always non retryable, as all a retry would achieve is to put it back into the same queue. + Defaults to `schedule_to_close_timeout` or workflow execution timeout if that is not + specified. More info: + https://docs.temporal.io/docs/content/what-is-a-schedule-to-start-timeout/ + + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "to" is used to indicate interval. --) + startToCloseTimeout: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + Maximum time an activity is allowed to execute after being picked up by a worker. This + timeout is always retryable. Either this or `schedule_to_close_timeout` must be specified. + + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "to" is used to indicate interval. --) + heartbeatTimeout: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Maximum permitted time between successful worker heartbeats. TimerCanceledEventAttributes: type: object properties: @@ -8386,6 +8837,25 @@ components: type: string description: If set, override overlap policy for this one request. format: enum + UpdateActivityRequest: + type: object + properties: + namespace: + type: string + workflowId: + type: string + runId: + type: string + activityId: + type: string + activityUpdate: + $ref: '#/components/schemas/ActivityUpdate' + identity: + type: string + description: The identity of the worker/client/caller + UpdateActivityResponse: + type: object + properties: {} UpdateNamespaceInfo: type: object properties: From 37d5afc53cb8c4ba03401c86b14a8ffcfba0c343 Mon Sep 17 00:00:00 2001 From: Yuri Date: Tue, 20 Aug 2024 10:31:38 -0700 Subject: [PATCH 05/12] add ResetActivity API --- .../workflowservice/v1/request_response.proto | 19 +++++++++++++++++-- temporal/api/workflowservice/v1/service.proto | 14 +++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 5f4cabd2..4daac87d 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1702,9 +1702,24 @@ message ResumeActivityRequest { string activity_id = 4; bool trigger_immediately = 5; - bool reset_attempts = 6; - string identity = 7; + string identity = 6; } + message ResumeActivityResponse { +} + +message ResetActivityRequest { + string namespace = 1; + string workflow_id = 2; + string run_id = 3 ; + string activity_id = 4; + + bool trigger_immediately = 5; + bool keep_paused = 6; + + string identity = 7; +} + +message ResetActivityResponse { } \ No newline at end of file diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 153a6a33..62d74f08 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -872,7 +872,7 @@ service WorkflowService { } }; } - // ResumeActivity will basically unpause the activity is the activity is in the paused state. + // ResumeActivity will unpause the activity is the activity is in the paused state. rpc ResumeActivity (ResumeActivityRequest) returns (ResumeActivityResponse) { option (google.api.http) = { @@ -884,4 +884,16 @@ service WorkflowService { } }; } + // Reset will reset activity to an initial state. + rpc ResetActivity (ResetActivityRequest) returns (ResetActivityResponse) + { + option (google.api.http) = { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/reset" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/reset" + body: "*" + } + }; + } } From 0354e58176d40c05d19a1a37814c22375cb8f337 Mon Sep 17 00:00:00 2001 From: Yuri Date: Tue, 20 Aug 2024 11:12:14 -0700 Subject: [PATCH 06/12] update openapi docs --- openapi/openapiv2.json | 129 +++++++++++++++++++++++++++++++++++++++-- openapi/openapiv3.yaml | 108 ++++++++++++++++++++++++++++++++-- 2 files changed, 228 insertions(+), 9 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 93d466fe..b38ecb63 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -2166,9 +2166,60 @@ ] } }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { + "post": { + "summary": "Reset will reset activity to an initial state.", + "operationId": "ResetActivity2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ResetActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resume": { "post": { - "summary": "ResumeActivity will basically unpause the activity is the activity is in the paused state.", + "summary": "ResumeActivity will unpause the activity is the activity is in the paused state.", "operationId": "ResumeActivity2", "responses": { "200": { @@ -4866,9 +4917,60 @@ ] } }, + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { + "post": { + "summary": "Reset will reset activity to an initial state.", + "operationId": "ResetActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ResetActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resume": { "post": { - "summary": "ResumeActivity will basically unpause the activity is the activity is in the paused state.", + "summary": "ResumeActivity will unpause the activity is the activity is in the paused state.", "operationId": "ResumeActivity", "responses": { "200": { @@ -5465,6 +5567,23 @@ } } }, + "WorkflowServiceResetActivityBody": { + "type": "object", + "properties": { + "runId": { + "type": "string" + }, + "triggerImmediately": { + "type": "boolean" + }, + "keepPaused": { + "type": "boolean" + }, + "identity": { + "type": "string" + } + } + }, "WorkflowServiceResetWorkflowExecutionBody": { "type": "object", "properties": { @@ -5660,9 +5779,6 @@ "triggerImmediately": { "type": "boolean" }, - "resetAttempts": { - "type": "boolean" - }, "identity": { "type": "string" } @@ -9836,6 +9952,9 @@ "v1RequestCancelWorkflowExecutionResponse": { "type": "object" }, + "v1ResetActivityResponse": { + "type": "object" + }, "v1ResetOptions": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 37a13f66..e7d46e4f 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1642,11 +1642,52 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: + post: + tags: + - WorkflowService + description: Reset will reset activity to an initial state. + operationId: ResetActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: workflowId + in: path + required: true + schema: + type: string + - name: activityId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resume: post: tags: - WorkflowService - description: ResumeActivity will basically unpause the activity is the activity is in the paused state. + description: ResumeActivity will unpause the activity is the activity is in the paused state. operationId: ResumeActivity parameters: - name: namespace @@ -3973,11 +4014,52 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: + post: + tags: + - WorkflowService + description: Reset will reset activity to an initial state. + operationId: ResetActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: workflowId + in: path + required: true + schema: + type: string + - name: activityId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resume: post: tags: - WorkflowService - description: ResumeActivity will basically unpause the activity is the activity is in the paused state. + description: ResumeActivity will unpause the activity is the activity is in the paused state. operationId: ResumeActivity parameters: - name: namespace @@ -7270,6 +7352,26 @@ components: RequestCancelWorkflowExecutionResponse: type: object properties: {} + ResetActivityRequest: + type: object + properties: + namespace: + type: string + workflowId: + type: string + runId: + type: string + activityId: + type: string + triggerImmediately: + type: boolean + keepPaused: + type: boolean + identity: + type: string + ResetActivityResponse: + type: object + properties: {} ResetOptions: type: object properties: @@ -7591,8 +7693,6 @@ components: type: string triggerImmediately: type: boolean - resetAttempts: - type: boolean identity: type: string ResumeActivityResponse: From 14ba3d0a72ccfc878ab2766109656dfa2d0100f4 Mon Sep 17 00:00:00 2001 From: Yuri Date: Wed, 21 Aug 2024 12:15:54 -0700 Subject: [PATCH 07/12] update API based on design discussion --- openapi/openapiv2.json | 898 ++++++++++-------- openapi/openapiv3.yaml | 824 ++++++++-------- temporal/api/common/v1/message.proto | 9 + temporal/api/enums/v1/common.proto | 10 +- .../workflowservice/v1/request_response.proto | 31 +- temporal/api/workflowservice/v1/service.proto | 22 +- 6 files changed, 924 insertions(+), 870 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index b38ecb63..5852db2d 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -1541,15 +1541,14 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}": { - "get": { - "summary": "DescribeWorkflowExecution returns information about the specified workflow execution.", - "operationId": "DescribeWorkflowExecution2", + "/api/v1/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}": { + "post": { + "operationId": "DescribeActivity2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1DescribeWorkflowExecutionResponse" + "$ref": "#/definitions/v1DescribeActivityResponse" } }, "default": { @@ -1567,16 +1566,24 @@ "type": "string" }, { - "name": "execution.workflowId", + "name": "activityExecution.workflowExecution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "execution.runId", - "in": "query", - "required": false, + "name": "activityExecution.activityId", + "in": "path", + "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceDescribeActivityBody" + } } ], "tags": [ @@ -1584,15 +1591,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}/history": { - "get": { - "summary": "GetWorkflowExecutionHistory returns the history of specified workflow execution. Fails with\n`NotFound` if the specified workflow execution is unknown to the service.", - "operationId": "GetWorkflowExecutionHistory2", + "/api/v1/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/pause": { + "post": { + "summary": "PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started.", + "operationId": "PauseActivity2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1GetWorkflowExecutionHistoryResponse" + "$ref": "#/definitions/v1PauseActivityResponse" } }, "default": { @@ -1610,57 +1617,24 @@ "type": "string" }, { - "name": "execution.workflowId", + "name": "activityExecution.workflowExecution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "execution.runId", - "in": "query", - "required": false, + "name": "activityExecution.activityId", + "in": "path", + "required": true, "type": "string" }, { - "name": "maximumPageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "nextPageToken", - "description": "If a `GetWorkflowExecutionHistoryResponse` or a `PollWorkflowTaskQueueResponse` had one of\nthese, it should be passed here to fetch the next page.", - "in": "query", - "required": false, - "type": "string", - "format": "byte" - }, - { - "name": "waitNewEvent", - "description": "If set to true, the RPC call will not resolve until there is a new event which matches\nthe `history_event_filter_type`, or a timeout is hit.", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "historyEventFilterType", - "description": "Filter returned events such that they match the specified filter type.\nDefault: HISTORY_EVENT_FILTER_TYPE_ALL_EVENT.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED", - "HISTORY_EVENT_FILTER_TYPE_ALL_EVENT", - "HISTORY_EVENT_FILTER_TYPE_CLOSE_EVENT" - ], - "default": "HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED" - }, - { - "name": "skipArchival", - "in": "query", - "required": false, - "type": "boolean" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityBody" + } } ], "tags": [ @@ -1668,15 +1642,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}/history-reverse": { - "get": { - "summary": "GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse \norder (starting from last event). Fails with`NotFound` if the specified workflow execution is \nunknown to the service.", - "operationId": "GetWorkflowExecutionHistoryReverse2", + "/api/v1/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/reset": { + "post": { + "summary": "Reset will reset activity to an initial state.", + "operationId": "ResetActivity2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1GetWorkflowExecutionHistoryReverseResponse" + "$ref": "#/definitions/v1ResetActivityResponse" } }, "default": { @@ -1694,30 +1668,24 @@ "type": "string" }, { - "name": "execution.workflowId", + "name": "activityExecution.workflowExecution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "execution.runId", - "in": "query", - "required": false, + "name": "activityExecution.activityId", + "in": "path", + "required": true, "type": "string" }, { - "name": "maximumPageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "nextPageToken", - "in": "query", - "required": false, - "type": "string", - "format": "byte" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityBody" + } } ], "tags": [ @@ -1725,15 +1693,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}/query/{query.queryType}": { + "/api/v1/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/resume": { "post": { - "summary": "QueryWorkflow requests a query be executed for a specified workflow execution.", - "operationId": "QueryWorkflow2", + "summary": "ResumeActivity will unpause the activity is the activity is in the paused state.", + "operationId": "ResumeActivity2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1QueryWorkflowResponse" + "$ref": "#/definitions/v1ResumeActivityResponse" } }, "default": { @@ -1751,14 +1719,13 @@ "type": "string" }, { - "name": "execution.workflowId", + "name": "activityExecution.workflowExecution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "query.queryType", - "description": "The workflow-author-defined identifier of the query. Typically a function name.", + "name": "activityExecution.activityId", "in": "path", "required": true, "type": "string" @@ -1768,7 +1735,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceQueryWorkflowBody" + "$ref": "#/definitions/WorkflowServiceResumeActivityBody" } } ], @@ -1777,16 +1744,14 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { + "/api/v1/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/update": { "post": { - "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", - "description": "This results in a new `WORKFLOW_EXECUTION_CANCEL_REQUESTED` event being written to the\nworkflow history and a new workflow task created for the workflow. It returns success if the requested\nworkflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.", - "operationId": "RequestCancelWorkflowExecution2", + "operationId": "UpdateActivityOptions2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RequestCancelWorkflowExecutionResponse" + "$ref": "#/definitions/v1UpdateActivityOptionsResponse" } }, "default": { @@ -1804,7 +1769,13 @@ "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "activityExecution.workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.activityId", "in": "path", "required": true, "type": "string" @@ -1814,7 +1785,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRequestCancelWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityOptionsBody" } } ], @@ -1823,15 +1794,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/reset": { - "post": { - "summary": "ResetWorkflowExecution will reset an existing workflow execution to a specified\n`WORKFLOW_TASK_COMPLETED` event (exclusive). It will immediately terminate the current\nexecution instance.\nTODO: Does exclusive here mean *just* the completed event, or also WFT started? Otherwise the task is doomed to time out?", - "operationId": "ResetWorkflowExecution2", + "/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}": { + "get": { + "summary": "DescribeWorkflowExecution returns information about the specified workflow execution.", + "operationId": "DescribeWorkflowExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetWorkflowExecutionResponse" + "$ref": "#/definitions/v1DescribeWorkflowExecutionResponse" } }, "default": { @@ -1849,18 +1820,16 @@ "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "execution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceResetWorkflowExecutionBody" - } + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -1868,16 +1837,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/signal/{signalName}": { - "post": { - "summary": "SignalWorkflowExecution is used to send a signal to a running workflow execution.", - "description": "This results in a `WORKFLOW_EXECUTION_SIGNALED` event recorded in the history and a workflow\ntask being created for the execution.", - "operationId": "SignalWorkflowExecution2", + "/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}/history": { + "get": { + "summary": "GetWorkflowExecutionHistory returns the history of specified workflow execution. Fails with\n`NotFound` if the specified workflow execution is unknown to the service.", + "operationId": "GetWorkflowExecutionHistory2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1SignalWorkflowExecutionResponse" + "$ref": "#/definitions/v1GetWorkflowExecutionHistoryResponse" } }, "default": { @@ -1895,25 +1863,57 @@ "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "execution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "signalName", - "description": "The workflow author-defined name of the signal to send to the workflow", - "in": "path", - "required": true, + "name": "execution.runId", + "in": "query", + "required": false, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" - } + "name": "maximumPageSize", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "nextPageToken", + "description": "If a `GetWorkflowExecutionHistoryResponse` or a `PollWorkflowTaskQueueResponse` had one of\nthese, it should be passed here to fetch the next page.", + "in": "query", + "required": false, + "type": "string", + "format": "byte" + }, + { + "name": "waitNewEvent", + "description": "If set to true, the RPC call will not resolve until there is a new event which matches\nthe `history_event_filter_type`, or a timeout is hit.", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "historyEventFilterType", + "description": "Filter returned events such that they match the specified filter type.\nDefault: HISTORY_EVENT_FILTER_TYPE_ALL_EVENT.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED", + "HISTORY_EVENT_FILTER_TYPE_ALL_EVENT", + "HISTORY_EVENT_FILTER_TYPE_CLOSE_EVENT" + ], + "default": "HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED" + }, + { + "name": "skipArchival", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -1921,15 +1921,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { - "post": { - "summary": "TerminateWorkflowExecution terminates an existing workflow execution by recording a\n`WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the\nexecution instance.", - "operationId": "TerminateWorkflowExecution2", + "/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}/history-reverse": { + "get": { + "summary": "GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse \norder (starting from last event). Fails with`NotFound` if the specified workflow execution is \nunknown to the service.", + "operationId": "GetWorkflowExecutionHistoryReverse2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" + "$ref": "#/definitions/v1GetWorkflowExecutionHistoryReverseResponse" } }, "default": { @@ -1947,18 +1947,30 @@ "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "execution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" - } + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "maximumPageSize", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "nextPageToken", + "in": "query", + "required": false, + "type": "string", + "format": "byte" } ], "tags": [ @@ -1966,15 +1978,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { + "/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}/query/{query.queryType}": { "post": { - "summary": "Invokes the specified update function on user workflow code.", - "operationId": "UpdateWorkflowExecution2", + "summary": "QueryWorkflow requests a query be executed for a specified workflow execution.", + "operationId": "QueryWorkflow2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" + "$ref": "#/definitions/v1QueryWorkflowResponse" } }, "default": { @@ -1987,20 +1999,19 @@ "parameters": [ { "name": "namespace", - "description": "The namespace name of the target workflow", "in": "path", "required": true, "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "execution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "request.input.name", - "description": "The name of the input handler to invoke on the target workflow", + "name": "query.queryType", + "description": "The workflow-author-defined identifier of the query. Typically a function name.", "in": "path", "required": true, "type": "string" @@ -2010,7 +2021,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceQueryWorkflowBody" } } ], @@ -2019,16 +2030,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}": { + "/api/v1/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { "post": { - "summary": "StartWorkflowExecution starts a new workflow execution.", - "description": "It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and\nalso schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an\ninstance already exists with same workflow id.", - "operationId": "StartWorkflowExecution2", + "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", + "description": "This results in a new `WORKFLOW_EXECUTION_CANCEL_REQUESTED` event being written to the\nworkflow history and a new workflow task created for the workflow. It returns success if the requested\nworkflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.", + "operationId": "RequestCancelWorkflowExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1StartWorkflowExecutionResponse" + "$ref": "#/definitions/v1RequestCancelWorkflowExecutionResponse" } }, "default": { @@ -2046,7 +2057,7 @@ "type": "string" }, { - "name": "workflowId", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" @@ -2056,7 +2067,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRequestCancelWorkflowExecutionBody" } } ], @@ -2065,14 +2076,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}": { + "/api/v1/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/reset": { "post": { - "operationId": "DescribeActivity2", + "summary": "ResetWorkflowExecution will reset an existing workflow execution to a specified\n`WORKFLOW_TASK_COMPLETED` event (exclusive). It will immediately terminate the current\nexecution instance.\nTODO: Does exclusive here mean *just* the completed event, or also WFT started? Otherwise the task is doomed to time out?", + "operationId": "ResetWorkflowExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1DescribeActivityResponse" + "$ref": "#/definitions/v1ResetWorkflowExecutionResponse" } }, "default": { @@ -2090,13 +2102,7 @@ "type": "string" }, { - "name": "workflowId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" @@ -2106,7 +2112,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceDescribeActivityBody" + "$ref": "#/definitions/WorkflowServiceResetWorkflowExecutionBody" } } ], @@ -2115,15 +2121,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { + "/api/v1/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/signal/{signalName}": { "post": { - "summary": "PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started.", - "operationId": "PauseActivity2", + "summary": "SignalWorkflowExecution is used to send a signal to a running workflow execution.", + "description": "This results in a `WORKFLOW_EXECUTION_SIGNALED` event recorded in the history and a workflow\ntask being created for the execution.", + "operationId": "SignalWorkflowExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityResponse" + "$ref": "#/definitions/v1SignalWorkflowExecutionResponse" } }, "default": { @@ -2141,13 +2148,14 @@ "type": "string" }, { - "name": "workflowId", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", + "name": "signalName", + "description": "The workflow author-defined name of the signal to send to the workflow", "in": "path", "required": true, "type": "string" @@ -2157,7 +2165,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityBody" + "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" } } ], @@ -2166,15 +2174,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { + "/api/v1/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { "post": { - "summary": "Reset will reset activity to an initial state.", - "operationId": "ResetActivity2", + "summary": "TerminateWorkflowExecution terminates an existing workflow execution by recording a\n`WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the\nexecution instance.", + "operationId": "TerminateWorkflowExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetActivityResponse" + "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" } }, "default": { @@ -2192,13 +2200,7 @@ "type": "string" }, { - "name": "workflowId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" @@ -2208,7 +2210,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityBody" + "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" } } ], @@ -2217,15 +2219,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resume": { + "/api/v1/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { "post": { - "summary": "ResumeActivity will unpause the activity is the activity is in the paused state.", - "operationId": "ResumeActivity2", + "summary": "Invokes the specified update function on user workflow code.", + "operationId": "UpdateWorkflowExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResumeActivityResponse" + "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" } }, "default": { @@ -2238,18 +2240,20 @@ "parameters": [ { "name": "namespace", + "description": "The namespace name of the target workflow", "in": "path", "required": true, "type": "string" }, { - "name": "workflowId", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", + "name": "request.input.name", + "description": "The name of the input handler to invoke on the target workflow", "in": "path", "required": true, "type": "string" @@ -2259,7 +2263,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResumeActivityBody" + "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" } } ], @@ -2268,14 +2272,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}": { "post": { - "operationId": "UpdateActivity2", + "summary": "StartWorkflowExecution starts a new workflow execution.", + "description": "It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and\nalso schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an\ninstance already exists with same workflow id.", + "operationId": "StartWorkflowExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateActivityResponse" + "$ref": "#/definitions/v1StartWorkflowExecutionResponse" } }, "default": { @@ -2298,18 +2304,12 @@ "required": true, "type": "string" }, - { - "name": "activityId", - "in": "path", - "required": true, - "type": "string" - }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityBody" + "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" } } ], @@ -4292,15 +4292,14 @@ ] } }, - "/namespaces/{namespace}/workflows/{execution.workflowId}": { - "get": { - "summary": "DescribeWorkflowExecution returns information about the specified workflow execution.", - "operationId": "DescribeWorkflowExecution", + "/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}": { + "post": { + "operationId": "DescribeActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1DescribeWorkflowExecutionResponse" + "$ref": "#/definitions/v1DescribeActivityResponse" } }, "default": { @@ -4318,16 +4317,24 @@ "type": "string" }, { - "name": "execution.workflowId", + "name": "activityExecution.workflowExecution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "execution.runId", - "in": "query", - "required": false, + "name": "activityExecution.activityId", + "in": "path", + "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceDescribeActivityBody" + } } ], "tags": [ @@ -4335,15 +4342,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{execution.workflowId}/history": { - "get": { - "summary": "GetWorkflowExecutionHistory returns the history of specified workflow execution. Fails with\n`NotFound` if the specified workflow execution is unknown to the service.", - "operationId": "GetWorkflowExecutionHistory", + "/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/pause": { + "post": { + "summary": "PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started.", + "operationId": "PauseActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1GetWorkflowExecutionHistoryResponse" + "$ref": "#/definitions/v1PauseActivityResponse" } }, "default": { @@ -4361,57 +4368,24 @@ "type": "string" }, { - "name": "execution.workflowId", + "name": "activityExecution.workflowExecution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "execution.runId", - "in": "query", - "required": false, + "name": "activityExecution.activityId", + "in": "path", + "required": true, "type": "string" }, { - "name": "maximumPageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "nextPageToken", - "description": "If a `GetWorkflowExecutionHistoryResponse` or a `PollWorkflowTaskQueueResponse` had one of\nthese, it should be passed here to fetch the next page.", - "in": "query", - "required": false, - "type": "string", - "format": "byte" - }, - { - "name": "waitNewEvent", - "description": "If set to true, the RPC call will not resolve until there is a new event which matches\nthe `history_event_filter_type`, or a timeout is hit.", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "historyEventFilterType", - "description": "Filter returned events such that they match the specified filter type.\nDefault: HISTORY_EVENT_FILTER_TYPE_ALL_EVENT.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED", - "HISTORY_EVENT_FILTER_TYPE_ALL_EVENT", - "HISTORY_EVENT_FILTER_TYPE_CLOSE_EVENT" - ], - "default": "HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED" - }, - { - "name": "skipArchival", - "in": "query", - "required": false, - "type": "boolean" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityBody" + } } ], "tags": [ @@ -4419,15 +4393,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{execution.workflowId}/history-reverse": { - "get": { - "summary": "GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse \norder (starting from last event). Fails with`NotFound` if the specified workflow execution is \nunknown to the service.", - "operationId": "GetWorkflowExecutionHistoryReverse", + "/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/reset": { + "post": { + "summary": "Reset will reset activity to an initial state.", + "operationId": "ResetActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1GetWorkflowExecutionHistoryReverseResponse" + "$ref": "#/definitions/v1ResetActivityResponse" } }, "default": { @@ -4445,30 +4419,24 @@ "type": "string" }, { - "name": "execution.workflowId", + "name": "activityExecution.workflowExecution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "execution.runId", - "in": "query", - "required": false, + "name": "activityExecution.activityId", + "in": "path", + "required": true, "type": "string" }, { - "name": "maximumPageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "nextPageToken", - "in": "query", - "required": false, - "type": "string", - "format": "byte" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityBody" + } } ], "tags": [ @@ -4476,15 +4444,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{execution.workflowId}/query/{query.queryType}": { + "/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/resume": { "post": { - "summary": "QueryWorkflow requests a query be executed for a specified workflow execution.", - "operationId": "QueryWorkflow", + "summary": "ResumeActivity will unpause the activity is the activity is in the paused state.", + "operationId": "ResumeActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1QueryWorkflowResponse" + "$ref": "#/definitions/v1ResumeActivityResponse" } }, "default": { @@ -4502,14 +4470,13 @@ "type": "string" }, { - "name": "execution.workflowId", + "name": "activityExecution.workflowExecution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "query.queryType", - "description": "The workflow-author-defined identifier of the query. Typically a function name.", + "name": "activityExecution.activityId", "in": "path", "required": true, "type": "string" @@ -4519,7 +4486,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceQueryWorkflowBody" + "$ref": "#/definitions/WorkflowServiceResumeActivityBody" } } ], @@ -4528,16 +4495,14 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { + "/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/update": { "post": { - "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", - "description": "This results in a new `WORKFLOW_EXECUTION_CANCEL_REQUESTED` event being written to the\nworkflow history and a new workflow task created for the workflow. It returns success if the requested\nworkflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.", - "operationId": "RequestCancelWorkflowExecution", + "operationId": "UpdateActivityOptions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RequestCancelWorkflowExecutionResponse" + "$ref": "#/definitions/v1UpdateActivityOptionsResponse" } }, "default": { @@ -4555,7 +4520,13 @@ "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "activityExecution.workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.activityId", "in": "path", "required": true, "type": "string" @@ -4565,7 +4536,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRequestCancelWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityOptionsBody" } } ], @@ -4574,15 +4545,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/reset": { - "post": { - "summary": "ResetWorkflowExecution will reset an existing workflow execution to a specified\n`WORKFLOW_TASK_COMPLETED` event (exclusive). It will immediately terminate the current\nexecution instance.\nTODO: Does exclusive here mean *just* the completed event, or also WFT started? Otherwise the task is doomed to time out?", - "operationId": "ResetWorkflowExecution", + "/namespaces/{namespace}/workflows/{execution.workflowId}": { + "get": { + "summary": "DescribeWorkflowExecution returns information about the specified workflow execution.", + "operationId": "DescribeWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetWorkflowExecutionResponse" + "$ref": "#/definitions/v1DescribeWorkflowExecutionResponse" } }, "default": { @@ -4600,35 +4571,32 @@ "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "execution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceResetWorkflowExecutionBody" - } + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "WorkflowService" - ] - } - }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/signal/{signalName}": { - "post": { - "summary": "SignalWorkflowExecution is used to send a signal to a running workflow execution.", - "description": "This results in a `WORKFLOW_EXECUTION_SIGNALED` event recorded in the history and a workflow\ntask being created for the execution.", - "operationId": "SignalWorkflowExecution", + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{execution.workflowId}/history": { + "get": { + "summary": "GetWorkflowExecutionHistory returns the history of specified workflow execution. Fails with\n`NotFound` if the specified workflow execution is unknown to the service.", + "operationId": "GetWorkflowExecutionHistory", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1SignalWorkflowExecutionResponse" + "$ref": "#/definitions/v1GetWorkflowExecutionHistoryResponse" } }, "default": { @@ -4646,25 +4614,57 @@ "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "execution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "signalName", - "description": "The workflow author-defined name of the signal to send to the workflow", - "in": "path", - "required": true, + "name": "execution.runId", + "in": "query", + "required": false, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" - } + "name": "maximumPageSize", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "nextPageToken", + "description": "If a `GetWorkflowExecutionHistoryResponse` or a `PollWorkflowTaskQueueResponse` had one of\nthese, it should be passed here to fetch the next page.", + "in": "query", + "required": false, + "type": "string", + "format": "byte" + }, + { + "name": "waitNewEvent", + "description": "If set to true, the RPC call will not resolve until there is a new event which matches\nthe `history_event_filter_type`, or a timeout is hit.", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "historyEventFilterType", + "description": "Filter returned events such that they match the specified filter type.\nDefault: HISTORY_EVENT_FILTER_TYPE_ALL_EVENT.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED", + "HISTORY_EVENT_FILTER_TYPE_ALL_EVENT", + "HISTORY_EVENT_FILTER_TYPE_CLOSE_EVENT" + ], + "default": "HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED" + }, + { + "name": "skipArchival", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -4672,15 +4672,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { - "post": { - "summary": "TerminateWorkflowExecution terminates an existing workflow execution by recording a\n`WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the\nexecution instance.", - "operationId": "TerminateWorkflowExecution", + "/namespaces/{namespace}/workflows/{execution.workflowId}/history-reverse": { + "get": { + "summary": "GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse \norder (starting from last event). Fails with`NotFound` if the specified workflow execution is \nunknown to the service.", + "operationId": "GetWorkflowExecutionHistoryReverse", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" + "$ref": "#/definitions/v1GetWorkflowExecutionHistoryReverseResponse" } }, "default": { @@ -4698,18 +4698,30 @@ "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "execution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" - } + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "maximumPageSize", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "nextPageToken", + "in": "query", + "required": false, + "type": "string", + "format": "byte" } ], "tags": [ @@ -4717,15 +4729,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { + "/namespaces/{namespace}/workflows/{execution.workflowId}/query/{query.queryType}": { "post": { - "summary": "Invokes the specified update function on user workflow code.", - "operationId": "UpdateWorkflowExecution", + "summary": "QueryWorkflow requests a query be executed for a specified workflow execution.", + "operationId": "QueryWorkflow", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" + "$ref": "#/definitions/v1QueryWorkflowResponse" } }, "default": { @@ -4738,20 +4750,19 @@ "parameters": [ { "name": "namespace", - "description": "The namespace name of the target workflow", "in": "path", "required": true, "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "execution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "request.input.name", - "description": "The name of the input handler to invoke on the target workflow", + "name": "query.queryType", + "description": "The workflow-author-defined identifier of the query. Typically a function name.", "in": "path", "required": true, "type": "string" @@ -4761,7 +4772,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceQueryWorkflowBody" } } ], @@ -4770,16 +4781,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { "post": { - "summary": "StartWorkflowExecution starts a new workflow execution.", - "description": "It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and\nalso schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an\ninstance already exists with same workflow id.", - "operationId": "StartWorkflowExecution", + "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", + "description": "This results in a new `WORKFLOW_EXECUTION_CANCEL_REQUESTED` event being written to the\nworkflow history and a new workflow task created for the workflow. It returns success if the requested\nworkflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.", + "operationId": "RequestCancelWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1StartWorkflowExecutionResponse" + "$ref": "#/definitions/v1RequestCancelWorkflowExecutionResponse" } }, "default": { @@ -4797,7 +4808,7 @@ "type": "string" }, { - "name": "workflowId", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" @@ -4807,7 +4818,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRequestCancelWorkflowExecutionBody" } } ], @@ -4816,14 +4827,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/reset": { "post": { - "operationId": "DescribeActivity", + "summary": "ResetWorkflowExecution will reset an existing workflow execution to a specified\n`WORKFLOW_TASK_COMPLETED` event (exclusive). It will immediately terminate the current\nexecution instance.\nTODO: Does exclusive here mean *just* the completed event, or also WFT started? Otherwise the task is doomed to time out?", + "operationId": "ResetWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1DescribeActivityResponse" + "$ref": "#/definitions/v1ResetWorkflowExecutionResponse" } }, "default": { @@ -4841,13 +4853,7 @@ "type": "string" }, { - "name": "workflowId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" @@ -4857,7 +4863,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceDescribeActivityBody" + "$ref": "#/definitions/WorkflowServiceResetWorkflowExecutionBody" } } ], @@ -4866,15 +4872,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/signal/{signalName}": { "post": { - "summary": "PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started.", - "operationId": "PauseActivity", + "summary": "SignalWorkflowExecution is used to send a signal to a running workflow execution.", + "description": "This results in a `WORKFLOW_EXECUTION_SIGNALED` event recorded in the history and a workflow\ntask being created for the execution.", + "operationId": "SignalWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityResponse" + "$ref": "#/definitions/v1SignalWorkflowExecutionResponse" } }, "default": { @@ -4892,13 +4899,14 @@ "type": "string" }, { - "name": "workflowId", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", + "name": "signalName", + "description": "The workflow author-defined name of the signal to send to the workflow", "in": "path", "required": true, "type": "string" @@ -4908,7 +4916,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityBody" + "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" } } ], @@ -4917,15 +4925,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { "post": { - "summary": "Reset will reset activity to an initial state.", - "operationId": "ResetActivity", + "summary": "TerminateWorkflowExecution terminates an existing workflow execution by recording a\n`WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the\nexecution instance.", + "operationId": "TerminateWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetActivityResponse" + "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" } }, "default": { @@ -4943,13 +4951,7 @@ "type": "string" }, { - "name": "workflowId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" @@ -4959,7 +4961,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityBody" + "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" } } ], @@ -4968,15 +4970,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resume": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { "post": { - "summary": "ResumeActivity will unpause the activity is the activity is in the paused state.", - "operationId": "ResumeActivity", + "summary": "Invokes the specified update function on user workflow code.", + "operationId": "UpdateWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResumeActivityResponse" + "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" } }, "default": { @@ -4989,18 +4991,20 @@ "parameters": [ { "name": "namespace", + "description": "The namespace name of the target workflow", "in": "path", "required": true, "type": "string" }, { - "name": "workflowId", + "name": "workflowExecution.workflowId", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", + "name": "request.input.name", + "description": "The name of the input handler to invoke on the target workflow", "in": "path", "required": true, "type": "string" @@ -5010,7 +5014,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResumeActivityBody" + "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" } } ], @@ -5019,14 +5023,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update": { + "/namespaces/{namespace}/workflows/{workflowId}": { "post": { - "operationId": "UpdateActivity", + "summary": "StartWorkflowExecution starts a new workflow execution.", + "description": "It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and\nalso schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an\ninstance already exists with same workflow id.", + "operationId": "StartWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateActivityResponse" + "$ref": "#/definitions/v1StartWorkflowExecutionResponse" } }, "default": { @@ -5049,18 +5055,12 @@ "required": true, "type": "string" }, - { - "name": "activityId", - "in": "path", - "required": true, - "type": "string" - }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityBody" + "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" } } ], @@ -5414,8 +5414,20 @@ "WorkflowServiceDescribeActivityBody": { "type": "object", "properties": { - "runId": { - "type": "string" + "activityExecution": { + "type": "object", + "properties": { + "workflowExecution": { + "type": "object", + "properties": { + "runId": { + "type": "string" + } + }, + "description": "Identifies a specific workflow within a namespace. Practically speaking, because run_id is a\nuuid, a workflow execution is globally unique. Note that many commands allow specifying an empty\nrun id as a way of saying \"target the latest run of the workflow\"." + } + }, + "title": "Identifies a specific activity within a namespace. ActivityExecution is expected to be\nglobally unique for running workflows.\nrun_id in workflow_execution can be empty,\nwhen run_id is empty the latest run of the workflow should be selected" }, "identity": { "type": "string" @@ -5454,8 +5466,20 @@ "WorkflowServicePauseActivityBody": { "type": "object", "properties": { - "runId": { - "type": "string" + "activityExecution": { + "type": "object", + "properties": { + "workflowExecution": { + "type": "object", + "properties": { + "runId": { + "type": "string" + } + }, + "description": "Identifies a specific workflow within a namespace. Practically speaking, because run_id is a\nuuid, a workflow execution is globally unique. Note that many commands allow specifying an empty\nrun id as a way of saying \"target the latest run of the workflow\"." + } + }, + "title": "Identifies a specific activity within a namespace. ActivityExecution is expected to be\nglobally unique for running workflows.\nrun_id in workflow_execution can be empty,\nwhen run_id is empty the latest run of the workflow should be selected" }, "identity": { "type": "string" @@ -5570,8 +5594,20 @@ "WorkflowServiceResetActivityBody": { "type": "object", "properties": { - "runId": { - "type": "string" + "activityExecution": { + "type": "object", + "properties": { + "workflowExecution": { + "type": "object", + "properties": { + "runId": { + "type": "string" + } + }, + "description": "Identifies a specific workflow within a namespace. Practically speaking, because run_id is a\nuuid, a workflow execution is globally unique. Note that many commands allow specifying an empty\nrun id as a way of saying \"target the latest run of the workflow\"." + } + }, + "title": "Identifies a specific activity within a namespace. ActivityExecution is expected to be\nglobally unique for running workflows.\nrun_id in workflow_execution can be empty,\nwhen run_id is empty the latest run of the workflow should be selected" }, "triggerImmediately": { "type": "boolean" @@ -5773,8 +5809,20 @@ "WorkflowServiceResumeActivityBody": { "type": "object", "properties": { - "runId": { - "type": "string" + "activityExecution": { + "type": "object", + "properties": { + "workflowExecution": { + "type": "object", + "properties": { + "runId": { + "type": "string" + } + }, + "description": "Identifies a specific workflow within a namespace. Practically speaking, because run_id is a\nuuid, a workflow execution is globally unique. Note that many commands allow specifying an empty\nrun id as a way of saying \"target the latest run of the workflow\"." + } + }, + "title": "Identifies a specific activity within a namespace. ActivityExecution is expected to be\nglobally unique for running workflows.\nrun_id in workflow_execution can be empty,\nwhen run_id is empty the latest run of the workflow should be selected" }, "triggerImmediately": { "type": "boolean" @@ -6073,11 +6121,23 @@ } } }, - "WorkflowServiceUpdateActivityBody": { + "WorkflowServiceUpdateActivityOptionsBody": { "type": "object", "properties": { - "runId": { - "type": "string" + "activityExecution": { + "type": "object", + "properties": { + "workflowExecution": { + "type": "object", + "properties": { + "runId": { + "type": "string" + } + }, + "description": "Identifies a specific workflow within a namespace. Practically speaking, because run_id is a\nuuid, a workflow execution is globally unique. Note that many commands allow specifying an empty\nrun id as a way of saying \"target the latest run of the workflow\"." + } + }, + "title": "Identifies a specific activity within a namespace. ActivityExecution is expected to be\nglobally unique for running workflows.\nrun_id in workflow_execution can be empty,\nwhen run_id is empty the latest run of the workflow should be selected" }, "activityUpdate": { "$ref": "#/definitions/v1ActivityUpdate" @@ -6329,6 +6389,18 @@ } } }, + "v1ActivityExecution": { + "type": "object", + "properties": { + "workflowExecution": { + "$ref": "#/definitions/v1WorkflowExecution" + }, + "activityId": { + "type": "string" + } + }, + "title": "Identifies a specific activity within a namespace. ActivityExecution is expected to be\nglobally unique for running workflows.\nrun_id in workflow_execution can be empty,\nwhen run_id is empty the latest run of the workflow should be selected" + }, "v1ActivityFailureInfo": { "type": "object", "properties": { @@ -6387,15 +6459,13 @@ "enum": [ "ACTIVITY_STATE_UNSPECIFIED", "ACTIVITY_STATE_SCHEDULED", - "ACTIVITY_STATE_RUNNING", + "ACTIVITY_STATE_STARTED", "ACTIVITY_STATE_PAUSED", "ACTIVITY_STATE_SUCCEEDED", "ACTIVITY_STATE_FAILED", "ACTIVITY_STATE_TIMED_OUT" ], - "default": "ACTIVITY_STATE_UNSPECIFIED", - "description": "- ACTIVITY_STATE_UNSPECIFIED: Default value, unspecified state.\n - ACTIVITY_STATE_SCHEDULED: Activity is scheduled for execution\n - ACTIVITY_STATE_RUNNING: Activity is currently running\n - ACTIVITY_STATE_PAUSED: Activity is paused\n - ACTIVITY_STATE_SUCCEEDED: Activity is completed successfully\n - ACTIVITY_STATE_FAILED: Activity is completed, failed\n - ACTIVITY_STATE_TIMED_OUT: Activity is completed, timed out", - "title": "State of the activity" + "default": "ACTIVITY_STATE_UNSPECIFIED" }, "v1ActivityTaskCancelRequestedEventAttributes": { "type": "object", @@ -11596,7 +11666,7 @@ } } }, - "v1UpdateActivityResponse": { + "v1UpdateActivityOptionsResponse": { "type": "object" }, "v1UpdateAdmittedEventOrigin": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index e7d46e4f..b5b9a7d0 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1317,186 +1317,146 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}: - get: + ? /api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id} + : post: tags: - WorkflowService - description: DescribeWorkflowExecution returns information about the specified workflow execution. - operationId: DescribeWorkflowExecution + operationId: DescribeActivity parameters: - name: namespace in: path required: true schema: type: string - - name: execution.workflow_id + - name: activity_execution.workflow_execution.workflow_id in: path required: true schema: type: string - - name: execution.workflowId - in: query - schema: - type: string - - name: execution.runId - in: query + - name: activity_execution.activity_id + in: path + required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeActivityRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/DescribeWorkflowExecutionResponse' + $ref: '#/components/schemas/DescribeActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/history: - get: + ? /api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/pause + : post: tags: - WorkflowService - description: |- - GetWorkflowExecutionHistory returns the history of specified workflow execution. Fails with - `NotFound` if the specified workflow execution is unknown to the service. - operationId: GetWorkflowExecutionHistory + description: PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started. + operationId: PauseActivity parameters: - name: namespace in: path required: true schema: type: string - - name: execution.workflow_id + - name: activity_execution.workflow_execution.workflow_id in: path required: true schema: type: string - - name: execution.workflowId - in: query - schema: - type: string - - name: execution.runId - in: query - schema: - type: string - - name: maximumPageSize - in: query - schema: - type: integer - format: int32 - - name: nextPageToken - in: query - description: |- - If a `GetWorkflowExecutionHistoryResponse` or a `PollWorkflowTaskQueueResponse` had one of - these, it should be passed here to fetch the next page. - schema: - type: string - format: bytes - - name: waitNewEvent - in: query - description: |- - If set to true, the RPC call will not resolve until there is a new event which matches - the `history_event_filter_type`, or a timeout is hit. - schema: - type: boolean - - name: historyEventFilterType - in: query - description: |- - Filter returned events such that they match the specified filter type. - Default: HISTORY_EVENT_FILTER_TYPE_ALL_EVENT. + - name: activity_execution.activity_id + in: path + required: true schema: - enum: - - HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED - - HISTORY_EVENT_FILTER_TYPE_ALL_EVENT - - HISTORY_EVENT_FILTER_TYPE_CLOSE_EVENT type: string - format: enum - - name: skipArchival - in: query - schema: - type: boolean + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/GetWorkflowExecutionHistoryResponse' + $ref: '#/components/schemas/PauseActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/history-reverse: - get: + ? /api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/reset + : post: tags: - WorkflowService - description: "GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse \n order (starting from last event). Fails with`NotFound` if the specified workflow execution is \n unknown to the service." - operationId: GetWorkflowExecutionHistoryReverse + description: Reset will reset activity to an initial state. + operationId: ResetActivity parameters: - name: namespace in: path required: true schema: type: string - - name: execution.workflow_id + - name: activity_execution.workflow_execution.workflow_id in: path required: true schema: type: string - - name: execution.workflowId - in: query - schema: - type: string - - name: execution.runId - in: query - schema: - type: string - - name: maximumPageSize - in: query - schema: - type: integer - format: int32 - - name: nextPageToken - in: query + - name: activity_execution.activity_id + in: path + required: true schema: type: string - format: bytes + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/GetWorkflowExecutionHistoryReverseResponse' + $ref: '#/components/schemas/ResetActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/query/{query.query_type}: - post: + ? /api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/resume + : post: tags: - WorkflowService - description: QueryWorkflow requests a query be executed for a specified workflow execution. - operationId: QueryWorkflow + description: ResumeActivity will unpause the activity is the activity is in the paused state. + operationId: ResumeActivity parameters: - name: namespace in: path required: true schema: type: string - - name: execution.workflow_id + - name: activity_execution.workflow_execution.workflow_id in: path required: true schema: type: string - - name: query.query_type + - name: activity_execution.activity_id in: path required: true schema: @@ -1505,7 +1465,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/QueryWorkflowRequest' + $ref: '#/components/schemas/ResumeActivityRequest' required: true responses: "200": @@ -1513,31 +1473,30 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/QueryWorkflowResponse' + $ref: '#/components/schemas/ResumeActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}: - post: + ? /api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/update + : post: tags: - WorkflowService - description: |- - StartWorkflowExecution starts a new workflow execution. - - It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and - also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an - instance already exists with same workflow id. - operationId: StartWorkflowExecution + operationId: UpdateActivityOptions parameters: - name: namespace in: path required: true schema: type: string - - name: workflowId + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id in: path required: true schema: @@ -1546,7 +1505,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartWorkflowExecutionRequest' + $ref: '#/components/schemas/UpdateActivityOptionsRequest' required: true responses: "200": @@ -1554,153 +1513,193 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartWorkflowExecutionResponse' + $ref: '#/components/schemas/UpdateActivityOptionsResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}: - post: + /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}: + get: tags: - WorkflowService - operationId: DescribeActivity + description: DescribeWorkflowExecution returns information about the specified workflow execution. + operationId: DescribeWorkflowExecution parameters: - name: namespace in: path required: true schema: type: string - - name: workflowId + - name: execution.workflow_id in: path required: true schema: type: string - - name: activityId - in: path - required: true + - name: execution.workflowId + in: query + schema: + type: string + - name: execution.runId + in: query schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DescribeActivityRequest' - required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/DescribeActivityResponse' + $ref: '#/components/schemas/DescribeWorkflowExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: - post: + /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/history: + get: tags: - WorkflowService - description: PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started. - operationId: PauseActivity + description: |- + GetWorkflowExecutionHistory returns the history of specified workflow execution. Fails with + `NotFound` if the specified workflow execution is unknown to the service. + operationId: GetWorkflowExecutionHistory parameters: - name: namespace in: path required: true schema: type: string - - name: workflowId + - name: execution.workflow_id in: path required: true schema: type: string - - name: activityId - in: path - required: true + - name: execution.workflowId + in: query schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityRequest' - required: true + - name: execution.runId + in: query + schema: + type: string + - name: maximumPageSize + in: query + schema: + type: integer + format: int32 + - name: nextPageToken + in: query + description: |- + If a `GetWorkflowExecutionHistoryResponse` or a `PollWorkflowTaskQueueResponse` had one of + these, it should be passed here to fetch the next page. + schema: + type: string + format: bytes + - name: waitNewEvent + in: query + description: |- + If set to true, the RPC call will not resolve until there is a new event which matches + the `history_event_filter_type`, or a timeout is hit. + schema: + type: boolean + - name: historyEventFilterType + in: query + description: |- + Filter returned events such that they match the specified filter type. + Default: HISTORY_EVENT_FILTER_TYPE_ALL_EVENT. + schema: + enum: + - HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED + - HISTORY_EVENT_FILTER_TYPE_ALL_EVENT + - HISTORY_EVENT_FILTER_TYPE_CLOSE_EVENT + type: string + format: enum + - name: skipArchival + in: query + schema: + type: boolean responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/PauseActivityResponse' + $ref: '#/components/schemas/GetWorkflowExecutionHistoryResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: - post: + /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/history-reverse: + get: tags: - WorkflowService - description: Reset will reset activity to an initial state. - operationId: ResetActivity + description: "GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse \n order (starting from last event). Fails with`NotFound` if the specified workflow execution is \n unknown to the service." + operationId: GetWorkflowExecutionHistoryReverse parameters: - name: namespace in: path required: true schema: type: string - - name: workflowId + - name: execution.workflow_id in: path required: true schema: type: string - - name: activityId - in: path - required: true + - name: execution.workflowId + in: query schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ResetActivityRequest' - required: true + - name: execution.runId + in: query + schema: + type: string + - name: maximumPageSize + in: query + schema: + type: integer + format: int32 + - name: nextPageToken + in: query + schema: + type: string + format: bytes responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/ResetActivityResponse' + $ref: '#/components/schemas/GetWorkflowExecutionHistoryReverseResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resume: + /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/query/{query.query_type}: post: tags: - WorkflowService - description: ResumeActivity will unpause the activity is the activity is in the paused state. - operationId: ResumeActivity + description: QueryWorkflow requests a query be executed for a specified workflow execution. + operationId: QueryWorkflow parameters: - name: namespace in: path required: true schema: type: string - - name: workflowId + - name: execution.workflow_id in: path required: true schema: type: string - - name: activityId + - name: query.query_type in: path required: true schema: @@ -1709,7 +1708,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResumeActivityRequest' + $ref: '#/components/schemas/QueryWorkflowRequest' required: true responses: "200": @@ -1717,18 +1716,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResumeActivityResponse' + $ref: '#/components/schemas/QueryWorkflowResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update: + /api/v1/namespaces/{namespace}/workflows/{workflowId}: post: tags: - WorkflowService - operationId: UpdateActivity + description: |- + StartWorkflowExecution starts a new workflow execution. + + It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and + also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an + instance already exists with same workflow id. + operationId: StartWorkflowExecution parameters: - name: namespace in: path @@ -1740,16 +1745,11 @@ paths: required: true schema: type: string - - name: activityId - in: path - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/UpdateActivityRequest' + $ref: '#/components/schemas/StartWorkflowExecutionRequest' required: true responses: "200": @@ -1757,7 +1757,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateActivityResponse' + $ref: '#/components/schemas/StartWorkflowExecutionResponse' default: description: Default error response content: @@ -3642,39 +3642,242 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListWorkflowExecutionsResponse' + $ref: '#/components/schemas/ListWorkflowExecutionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/execute-multi-operation: + post: + tags: + - WorkflowService + description: |- + ExecuteMultiOperation executes multiple operations within a single workflow. + + 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, 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 + parameters: + - name: namespace + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ExecuteMultiOperationRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ExecuteMultiOperationResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + ? /namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id} + : post: + tags: + - WorkflowService + operationId: DescribeActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + ? /namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/pause + : post: + tags: + - WorkflowService + description: PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started. + operationId: PauseActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + ? /namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/reset + : post: + tags: + - WorkflowService + description: Reset will reset activity to an initial state. + operationId: ResetActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + ? /namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/resume + : post: + tags: + - WorkflowService + description: ResumeActivity will unpause the activity is the activity is in the paused state. + operationId: ResumeActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResumeActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResumeActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/execute-multi-operation: - post: + ? /namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/update + : post: tags: - WorkflowService - description: |- - ExecuteMultiOperation executes multiple operations within a single workflow. - - 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, 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 + operationId: UpdateActivityOptions parameters: - name: namespace in: path required: true schema: type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/ExecuteMultiOperationRequest' + $ref: '#/components/schemas/UpdateActivityOptionsRequest' required: true responses: "200": @@ -3682,7 +3885,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ExecuteMultiOperationResponse' + $ref: '#/components/schemas/UpdateActivityOptionsResponse' default: description: Default error response content: @@ -3933,209 +4136,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}: - post: - tags: - - WorkflowService - operationId: DescribeActivity - parameters: - - name: namespace - in: path - required: true - schema: - type: string - - name: workflowId - in: path - required: true - schema: - type: string - - name: activityId - in: path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DescribeActivityRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/DescribeActivityResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: - post: - tags: - - WorkflowService - description: PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started. - operationId: PauseActivity - parameters: - - name: namespace - in: path - required: true - schema: - type: string - - name: workflowId - in: path - required: true - schema: - type: string - - name: activityId - in: path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: - post: - tags: - - WorkflowService - description: Reset will reset activity to an initial state. - operationId: ResetActivity - parameters: - - name: namespace - in: path - required: true - schema: - type: string - - name: workflowId - in: path - required: true - schema: - type: string - - name: activityId - in: path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ResetActivityRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ResetActivityResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resume: - post: - tags: - - WorkflowService - description: ResumeActivity will unpause the activity is the activity is in the paused state. - operationId: ResumeActivity - parameters: - - name: namespace - in: path - required: true - schema: - type: string - - name: workflowId - in: path - required: true - schema: - type: string - - name: activityId - in: path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ResumeActivityRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ResumeActivityResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update: - post: - tags: - - WorkflowService - operationId: UpdateActivity - parameters: - - name: namespace - in: path - required: true - schema: - type: string - - name: workflowId - in: path - required: true - schema: - type: string - - name: activityId - in: path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateActivityRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateActivityResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}: post: tags: @@ -4420,6 +4420,18 @@ paths: $ref: '#/components/schemas/Status' components: schemas: + ActivityExecution: + type: object + properties: + workflowExecution: + $ref: '#/components/schemas/WorkflowExecution' + activityId: + type: string + description: |- + Identifies a specific activity within a namespace. ActivityExecution is expected to be + globally unique for running workflows. + run_id in workflow_execution can be empty, + when run_id is empty the latest run of the workflow should be selected ActivityFailureInfo: type: object properties: @@ -5409,12 +5421,8 @@ components: properties: namespace: type: string - workflowId: - type: string - runId: - type: string - activityId: - type: string + activityExecution: + $ref: '#/components/schemas/ActivityExecution' identity: type: string DescribeActivityResponse: @@ -5426,7 +5434,7 @@ components: enum: - ACTIVITY_STATE_UNSPECIFIED - ACTIVITY_STATE_SCHEDULED - - ACTIVITY_STATE_RUNNING + - ACTIVITY_STATE_STARTED - ACTIVITY_STATE_PAUSED - ACTIVITY_STATE_SUCCEEDED - ACTIVITY_STATE_FAILED @@ -6801,12 +6809,8 @@ components: properties: namespace: type: string - workflowId: - type: string - runId: - type: string - activityId: - type: string + activityExecution: + $ref: '#/components/schemas/ActivityExecution' identity: type: string PauseActivityResponse: @@ -7357,12 +7361,8 @@ components: properties: namespace: type: string - workflowId: - type: string - runId: - type: string - activityId: - type: string + activityExecution: + $ref: '#/components/schemas/ActivityExecution' triggerImmediately: type: boolean keepPaused: @@ -7685,12 +7685,8 @@ components: properties: namespace: type: string - workflowId: - type: string - runId: - type: string - activityId: - type: string + activityExecution: + $ref: '#/components/schemas/ActivityExecution' triggerImmediately: type: boolean identity: @@ -8937,23 +8933,19 @@ components: type: string description: If set, override overlap policy for this one request. format: enum - UpdateActivityRequest: + UpdateActivityOptionsRequest: type: object properties: namespace: type: string - workflowId: - type: string - runId: - type: string - activityId: - type: string + activityExecution: + $ref: '#/components/schemas/ActivityExecution' activityUpdate: $ref: '#/components/schemas/ActivityUpdate' identity: type: string description: The identity of the worker/client/caller - UpdateActivityResponse: + UpdateActivityOptionsResponse: type: object properties: {} UpdateNamespaceInfo: diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index 4284a706..4f474349 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -80,6 +80,15 @@ message WorkflowExecution { string run_id = 2; } +// Identifies a specific activity within a namespace. ActivityExecution is expected to be +// globally unique for running workflows. +// run_id in workflow_execution can be empty, +// when run_id is empty the latest run of the workflow should be selected +message ActivityExecution { + temporal.api.common.v1.WorkflowExecution workflow_execution = 1; + string activity_id = 2; +} + // Represents the identifier used by a workflow author to define the workflow. Typically, the // name of a function. This is sometimes referred to as the workflow's "name" message WorkflowType { diff --git a/temporal/api/enums/v1/common.proto b/temporal/api/enums/v1/common.proto index 8717aa16..426e2c17 100644 --- a/temporal/api/enums/v1/common.proto +++ b/temporal/api/enums/v1/common.proto @@ -99,20 +99,12 @@ enum NexusOperationCancellationState { NEXUS_OPERATION_CANCELLATION_STATE_TIMED_OUT = 5; } -// State of the activity enum ActivityState { - // Default value, unspecified state. ACTIVITY_STATE_UNSPECIFIED = 0; - // Activity is scheduled for execution ACTIVITY_STATE_SCHEDULED = 1; - // Activity is currently running - ACTIVITY_STATE_RUNNING = 2; - // Activity is paused + ACTIVITY_STATE_STARTED = 2; ACTIVITY_STATE_PAUSED = 3; - // Activity is completed successfully ACTIVITY_STATE_SUCCEEDED = 4; - // Activity is completed, failed ACTIVITY_STATE_FAILED = 5; - // Activity is completed, timed out ACTIVITY_STATE_TIMED_OUT = 6; } diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 4daac87d..4672524e 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1654,27 +1654,24 @@ message ExecuteMultiOperationResponse { } } -message UpdateActivityRequest { +message UpdateActivityOptionsRequest { + string namespace = 1; - string workflow_id = 2; - string run_id = 3 ; - string activity_id = 4; + temporal.api.common.v1.ActivityExecution activity_execution = 2; - temporal.api.activity.v1.ActivityUpdate activity_update = 5; + temporal.api.activity.v1.ActivityUpdate activity_update = 3; // The identity of the worker/client/caller - string identity = 6; + string identity = 4; } -message UpdateActivityResponse { +message UpdateActivityOptionsResponse { } message DescribeActivityRequest { string namespace = 1; - string workflow_id = 2; - string run_id = 3 ; - string activity_id = 4; + temporal.api.common.v1.ActivityExecution activity_execution = 2; - string identity = 5; + string identity = 3; } message DescribeActivityResponse { @@ -1685,9 +1682,7 @@ message DescribeActivityResponse { message PauseActivityRequest { string namespace = 1; - string workflow_id = 2; - string run_id = 3 ; - string activity_id = 4; + temporal.api.common.v1.ActivityExecution activity_execution = 2; string identity = 5; } @@ -1697,9 +1692,7 @@ message PauseActivityResponse { message ResumeActivityRequest { string namespace = 1; - string workflow_id = 2; - string run_id = 3 ; - string activity_id = 4; + temporal.api.common.v1.ActivityExecution activity_execution = 2; bool trigger_immediately = 5; @@ -1711,9 +1704,7 @@ message ResumeActivityResponse { message ResetActivityRequest { string namespace = 1; - string workflow_id = 2; - string run_id = 3 ; - string activity_id = 4; + temporal.api.common.v1.ActivityExecution activity_execution = 2; bool trigger_immediately = 5; bool keep_paused = 6; diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 62d74f08..0c3f8278 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -836,13 +836,13 @@ service WorkflowService { rpc RespondNexusTaskFailed(RespondNexusTaskFailedRequest) returns (RespondNexusTaskFailedResponse) { } - rpc UpdateActivity (UpdateActivityRequest) returns (UpdateActivityResponse) + rpc UpdateActivityOptions (UpdateActivityOptionsRequest) returns (UpdateActivityOptionsResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/update" + post: "/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/update" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/update" + post: "/api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/update" body: "*" } }; @@ -851,10 +851,10 @@ service WorkflowService { rpc DescribeActivity (DescribeActivityRequest) returns (DescribeActivityResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}" + post: "/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}" + post: "/api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}" body: "*" } }; @@ -864,10 +864,10 @@ service WorkflowService { rpc PauseActivity (PauseActivityRequest) returns (PauseActivityResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/pause" + post: "/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/pause" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/pause" + post: "/api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/pause" body: "*" } }; @@ -876,10 +876,10 @@ service WorkflowService { rpc ResumeActivity (ResumeActivityRequest) returns (ResumeActivityResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/resume" + post: "/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/resume" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/resume" + post: "/api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/resume" body: "*" } }; @@ -888,10 +888,10 @@ service WorkflowService { rpc ResetActivity (ResetActivityRequest) returns (ResetActivityResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/reset" + post: "/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/reset" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/reset" + post: "/api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/reset" body: "*" } }; From b3883d8fbb1a152b0b50f48db2a26c3241fd188a Mon Sep 17 00:00:00 2001 From: Yuri Date: Wed, 21 Aug 2024 12:21:31 -0700 Subject: [PATCH 08/12] Rename ActivityUpdate to ActivityOptionsUpdate --- temporal/api/activity/v1/message.proto | 10 +++++----- temporal/api/workflowservice/v1/request_response.proto | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/temporal/api/activity/v1/message.proto b/temporal/api/activity/v1/message.proto index c5733c36..2db64f87 100644 --- a/temporal/api/activity/v1/message.proto +++ b/temporal/api/activity/v1/message.proto @@ -45,7 +45,7 @@ message Timeouts { // // (-- api-linter: core::0140::prepositions=disabled // aip.dev/not-precedent: "to" is used to indicate interval. --) - google.protobuf.Duration schedule_to_close_timeout = 1; + google.protobuf.Duration schedule_to_close = 1; // Limits the time an activity task can stay in a task queue before a worker picks it up. The // "schedule" time is when the most recent retry is scheduled. This timeout should usually not // be set: it's useful in specific scenarios like worker-specific task queues. This timeout is @@ -56,15 +56,15 @@ message Timeouts { // // (-- api-linter: core::0140::prepositions=disabled // aip.dev/not-precedent: "to" is used to indicate interval. --) - google.protobuf.Duration schedule_to_start_timeout = 2; + google.protobuf.Duration schedule_to_start = 2; // Maximum time an activity is allowed to execute after being picked up by a worker. This // timeout is always retryable. Either this or `schedule_to_close_timeout` must be specified. // // (-- api-linter: core::0140::prepositions=disabled // aip.dev/not-precedent: "to" is used to indicate interval. --) - google.protobuf.Duration start_to_close_timeout = 3; + google.protobuf.Duration start_to_close = 3; // Maximum permitted time between successful worker heartbeats. - google.protobuf.Duration heartbeat_timeout = 4; + google.protobuf.Duration between_heartbeats = 4; } message ActivityOptions { @@ -75,7 +75,7 @@ message ActivityOptions { temporal.api.common.v1.RetryPolicy retry_policy = 3; } -message ActivityUpdate { +message ActivityOptionsUpdate { string task_queue = 1; temporal.api.activity.v1.Timeouts timeouts = 2; diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 4672524e..b47983f4 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1655,12 +1655,10 @@ message ExecuteMultiOperationResponse { } message UpdateActivityOptionsRequest { - string namespace = 1; temporal.api.common.v1.ActivityExecution activity_execution = 2; - temporal.api.activity.v1.ActivityUpdate activity_update = 3; - // The identity of the worker/client/caller + temporal.api.activity.v1.ActivityOptionsUpdate activity_options_update = 3; string identity = 4; } From 8d4ec6ff79db71d7afd73f7ae535a4866a3b2f35 Mon Sep 17 00:00:00 2001 From: Yuri Date: Wed, 21 Aug 2024 13:14:42 -0700 Subject: [PATCH 09/12] liter errors --- temporal/api/activity/v1/message.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/temporal/api/activity/v1/message.proto b/temporal/api/activity/v1/message.proto index 2db64f87..ce8b87c6 100644 --- a/temporal/api/activity/v1/message.proto +++ b/temporal/api/activity/v1/message.proto @@ -64,7 +64,7 @@ message Timeouts { // aip.dev/not-precedent: "to" is used to indicate interval. --) google.protobuf.Duration start_to_close = 3; // Maximum permitted time between successful worker heartbeats. - google.protobuf.Duration between_heartbeats = 4; + google.protobuf.Duration heartbeats_timeout = 4; } message ActivityOptions { From e7778d27208f72b04c53d2c258bb4d0c51b0a1ee Mon Sep 17 00:00:00 2001 From: Yuri Date: Wed, 21 Aug 2024 13:27:51 -0700 Subject: [PATCH 10/12] update openapi --- openapi/openapiv2.json | 49 +++++++++++++++++++++--------------------- openapi/openapiv3.yaml | 37 ++++++++++++++++--------------- 2 files changed, 42 insertions(+), 44 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 5852db2d..4e528873 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -6139,12 +6139,11 @@ }, "title": "Identifies a specific activity within a namespace. ActivityExecution is expected to be\nglobally unique for running workflows.\nrun_id in workflow_execution can be empty,\nwhen run_id is empty the latest run of the workflow should be selected" }, - "activityUpdate": { - "$ref": "#/definitions/v1ActivityUpdate" + "activityOptionsUpdate": { + "$ref": "#/definitions/v1ActivityOptionsUpdate" }, "identity": { - "type": "string", - "title": "The identity of the worker/client/caller" + "type": "string" } } }, @@ -6440,6 +6439,23 @@ } } }, + "v1ActivityOptionsUpdate": { + "type": "object", + "properties": { + "taskQueue": { + "type": "string" + }, + "timeouts": { + "$ref": "#/definitions/v1Timeouts" + }, + "retryPolicy": { + "$ref": "#/definitions/v1RetryPolicy" + }, + "updateMask": { + "type": "string" + } + } + }, "v1ActivityPropertiesModifiedExternallyEventAttributes": { "type": "object", "properties": { @@ -6688,23 +6704,6 @@ }, "title": "Represents the identifier used by a activity author to define the activity. Typically, the\nname of a function. This is sometimes referred to as the activity's \"name\"" }, - "v1ActivityUpdate": { - "type": "object", - "properties": { - "taskQueue": { - "type": "string" - }, - "timeouts": { - "$ref": "#/definitions/v1Timeouts" - }, - "retryPolicy": { - "$ref": "#/definitions/v1RetryPolicy" - }, - "updateMask": { - "type": "string" - } - } - }, "v1AddOrUpdateRemoteClusterResponse": { "type": "object" }, @@ -11548,19 +11547,19 @@ "v1Timeouts": { "type": "object", "properties": { - "scheduleToCloseTimeout": { + "scheduleToClose": { "type": "string", "description": "Indicates how long the caller is willing to wait for activity completion. The \"schedule\" time\nis when the activity is initially scheduled, not when the most recent retry is scheduled.\nLimits how long retries will be attempted. Either this or `start_to_close_timeout` must be\nspecified. When not specified, defaults to the workflow execution timeout.\n" }, - "scheduleToStartTimeout": { + "scheduleToStart": { "type": "string", "title": "Limits the time an activity task can stay in a task queue before a worker picks it up. The\n\"schedule\" time is when the most recent retry is scheduled. This timeout should usually not\nbe set: it's useful in specific scenarios like worker-specific task queues. This timeout is\nalways non retryable, as all a retry would achieve is to put it back into the same queue.\nDefaults to `schedule_to_close_timeout` or workflow execution timeout if that is not\nspecified. More info:\nhttps://docs.temporal.io/docs/content/what-is-a-schedule-to-start-timeout/" }, - "startToCloseTimeout": { + "startToClose": { "type": "string", "description": "Maximum time an activity is allowed to execute after being picked up by a worker. This\ntimeout is always retryable. Either this or `schedule_to_close_timeout` must be specified.\n" }, - "heartbeatTimeout": { + "heartbeatsTimeout": { "type": "string", "description": "Maximum permitted time between successful worker heartbeats." } diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index b5b9a7d0..af27d159 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -4466,6 +4466,18 @@ components: $ref: '#/components/schemas/Timeouts' retryPolicy: $ref: '#/components/schemas/RetryPolicy' + ActivityOptionsUpdate: + type: object + properties: + taskQueue: + type: string + timeouts: + $ref: '#/components/schemas/Timeouts' + retryPolicy: + $ref: '#/components/schemas/RetryPolicy' + updateMask: + type: string + format: field-mask ActivityPropertiesModifiedExternallyEventAttributes: type: object properties: @@ -4699,18 +4711,6 @@ components: description: |- Represents the identifier used by a activity author to define the activity. Typically, the name of a function. This is sometimes referred to as the activity's "name" - ActivityUpdate: - type: object - properties: - taskQueue: - type: string - timeouts: - $ref: '#/components/schemas/Timeouts' - retryPolicy: - $ref: '#/components/schemas/RetryPolicy' - updateMask: - type: string - format: field-mask Alert: type: object properties: @@ -8823,7 +8823,7 @@ components: Timeouts: type: object properties: - scheduleToCloseTimeout: + scheduleToClose: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: |- @@ -8834,7 +8834,7 @@ components: (-- api-linter: core::0140::prepositions=disabled aip.dev/not-precedent: "to" is used to indicate interval. --) - scheduleToStartTimeout: + scheduleToStart: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: |- @@ -8848,7 +8848,7 @@ components: (-- api-linter: core::0140::prepositions=disabled aip.dev/not-precedent: "to" is used to indicate interval. --) - startToCloseTimeout: + startToClose: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: |- @@ -8857,7 +8857,7 @@ components: (-- api-linter: core::0140::prepositions=disabled aip.dev/not-precedent: "to" is used to indicate interval. --) - heartbeatTimeout: + heartbeatsTimeout: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: Maximum permitted time between successful worker heartbeats. @@ -8940,11 +8940,10 @@ components: type: string activityExecution: $ref: '#/components/schemas/ActivityExecution' - activityUpdate: - $ref: '#/components/schemas/ActivityUpdate' + activityOptionsUpdate: + $ref: '#/components/schemas/ActivityOptionsUpdate' identity: type: string - description: The identity of the worker/client/caller UpdateActivityOptionsResponse: type: object properties: {} From 46ad359a9814cca842ceee910dec30c7a5ccb021 Mon Sep 17 00:00:00 2001 From: Yuri Date: Wed, 21 Aug 2024 14:47:55 -0700 Subject: [PATCH 11/12] comments --- openapi/openapiv2.json | 2 +- openapi/openapiv3.yaml | 2 +- temporal/api/activity/v1/message.proto | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 4e528873..75a90622 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -11559,7 +11559,7 @@ "type": "string", "description": "Maximum time an activity is allowed to execute after being picked up by a worker. This\ntimeout is always retryable. Either this or `schedule_to_close_timeout` must be specified.\n" }, - "heartbeatsTimeout": { + "heartbeatTimeout": { "type": "string", "description": "Maximum permitted time between successful worker heartbeats." } diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index af27d159..7b8d9562 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -8857,7 +8857,7 @@ components: (-- api-linter: core::0140::prepositions=disabled aip.dev/not-precedent: "to" is used to indicate interval. --) - heartbeatsTimeout: + heartbeatTimeout: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: Maximum permitted time between successful worker heartbeats. diff --git a/temporal/api/activity/v1/message.proto b/temporal/api/activity/v1/message.proto index ce8b87c6..ddd44f05 100644 --- a/temporal/api/activity/v1/message.proto +++ b/temporal/api/activity/v1/message.proto @@ -64,7 +64,7 @@ message Timeouts { // aip.dev/not-precedent: "to" is used to indicate interval. --) google.protobuf.Duration start_to_close = 3; // Maximum permitted time between successful worker heartbeats. - google.protobuf.Duration heartbeats_timeout = 4; + google.protobuf.Duration heartbeat_timeout = 4; } message ActivityOptions { From 5b86617e3bd62b48297094a2250cde878c0adbc1 Mon Sep 17 00:00:00 2001 From: Yuri Date: Wed, 21 Aug 2024 15:04:44 -0700 Subject: [PATCH 12/12] working on comments --- openapi/openapiv2.json | 66 +++++++++---------- openapi/openapiv3.yaml | 46 ++++++------- temporal/api/activity/v1/message.proto | 4 +- temporal/api/enums/v1/activity.proto | 44 +++++++++++++ temporal/api/enums/v1/common.proto | 10 --- .../workflowservice/v1/request_response.proto | 7 +- 6 files changed, 106 insertions(+), 71 deletions(-) create mode 100644 temporal/api/enums/v1/activity.proto diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 75a90622..1bf7cb4d 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -6140,7 +6140,7 @@ "title": "Identifies a specific activity within a namespace. ActivityExecution is expected to be\nglobally unique for running workflows.\nrun_id in workflow_execution can be empty,\nwhen run_id is empty the latest run of the workflow should be selected" }, "activityOptionsUpdate": { - "$ref": "#/definitions/v1ActivityOptionsUpdate" + "$ref": "#/definitions/v1OptionsUpdate" }, "identity": { "type": "string" @@ -6425,37 +6425,6 @@ } } }, - "v1ActivityOptions": { - "type": "object", - "properties": { - "taskQueue": { - "$ref": "#/definitions/v1TaskQueue" - }, - "timeouts": { - "$ref": "#/definitions/v1Timeouts" - }, - "retryPolicy": { - "$ref": "#/definitions/v1RetryPolicy" - } - } - }, - "v1ActivityOptionsUpdate": { - "type": "object", - "properties": { - "taskQueue": { - "type": "string" - }, - "timeouts": { - "$ref": "#/definitions/v1Timeouts" - }, - "retryPolicy": { - "$ref": "#/definitions/v1RetryPolicy" - }, - "updateMask": { - "type": "string" - } - } - }, "v1ActivityPropertiesModifiedExternallyEventAttributes": { "type": "object", "properties": { @@ -7642,7 +7611,7 @@ "type": "object", "properties": { "activityOptions": { - "$ref": "#/definitions/v1ActivityOptions" + "$ref": "#/definitions/v1Options" }, "activityState": { "$ref": "#/definitions/v1ActivityState" @@ -9253,6 +9222,37 @@ }, "description": "Nexus operation timed out." }, + "v1Options": { + "type": "object", + "properties": { + "taskQueue": { + "$ref": "#/definitions/v1TaskQueue" + }, + "timeouts": { + "$ref": "#/definitions/v1Timeouts" + }, + "retryPolicy": { + "$ref": "#/definitions/v1RetryPolicy" + } + } + }, + "v1OptionsUpdate": { + "type": "object", + "properties": { + "taskQueue": { + "type": "string" + }, + "timeouts": { + "$ref": "#/definitions/v1Timeouts" + }, + "retryPolicy": { + "$ref": "#/definitions/v1RetryPolicy" + }, + "updateMask": { + "type": "string" + } + } + }, "v1Outcome": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 7b8d9562..875f2b8f 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -4457,27 +4457,6 @@ components: - RETRY_STATE_CANCEL_REQUESTED type: string format: enum - ActivityOptions: - type: object - properties: - taskQueue: - $ref: '#/components/schemas/TaskQueue' - timeouts: - $ref: '#/components/schemas/Timeouts' - retryPolicy: - $ref: '#/components/schemas/RetryPolicy' - ActivityOptionsUpdate: - type: object - properties: - taskQueue: - type: string - timeouts: - $ref: '#/components/schemas/Timeouts' - retryPolicy: - $ref: '#/components/schemas/RetryPolicy' - updateMask: - type: string - format: field-mask ActivityPropertiesModifiedExternallyEventAttributes: type: object properties: @@ -5429,7 +5408,7 @@ components: type: object properties: activityOptions: - $ref: '#/components/schemas/ActivityOptions' + $ref: '#/components/schemas/Options' activityState: enum: - ACTIVITY_STATE_UNSPECIFIED @@ -6776,6 +6755,27 @@ components: type: string description: The request ID allocated at schedule time. description: Nexus operation timed out. + Options: + type: object + properties: + taskQueue: + $ref: '#/components/schemas/TaskQueue' + timeouts: + $ref: '#/components/schemas/Timeouts' + retryPolicy: + $ref: '#/components/schemas/RetryPolicy' + OptionsUpdate: + type: object + properties: + taskQueue: + type: string + timeouts: + $ref: '#/components/schemas/Timeouts' + retryPolicy: + $ref: '#/components/schemas/RetryPolicy' + updateMask: + type: string + format: field-mask Outcome: type: object properties: @@ -8941,7 +8941,7 @@ components: activityExecution: $ref: '#/components/schemas/ActivityExecution' activityOptionsUpdate: - $ref: '#/components/schemas/ActivityOptionsUpdate' + $ref: '#/components/schemas/OptionsUpdate' identity: type: string UpdateActivityOptionsResponse: diff --git a/temporal/api/activity/v1/message.proto b/temporal/api/activity/v1/message.proto index ddd44f05..43e98a48 100644 --- a/temporal/api/activity/v1/message.proto +++ b/temporal/api/activity/v1/message.proto @@ -67,7 +67,7 @@ message Timeouts { google.protobuf.Duration heartbeat_timeout = 4; } -message ActivityOptions { +message Options { temporal.api.taskqueue.v1.TaskQueue task_queue = 1; temporal.api.activity.v1.Timeouts timeouts = 2; @@ -75,7 +75,7 @@ message ActivityOptions { temporal.api.common.v1.RetryPolicy retry_policy = 3; } -message ActivityOptionsUpdate { +message OptionsUpdate { string task_queue = 1; temporal.api.activity.v1.Timeouts timeouts = 2; diff --git a/temporal/api/enums/v1/activity.proto b/temporal/api/enums/v1/activity.proto new file mode 100644 index 00000000..3b44f014 --- /dev/null +++ b/temporal/api/enums/v1/activity.proto @@ -0,0 +1,44 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.enums.v1; + +option go_package = "go.temporal.io/api/enums/v1;enums"; +option java_package = "io.temporal.api.enums.v1"; +option java_multiple_files = true; +option java_outer_classname = "ActivityProto"; +option ruby_package = "Temporalio::Api::Enums::V1"; +option csharp_namespace = "Temporalio.Api.Enums.V1"; + + +enum ActivityState { + ACTIVITY_STATE_UNSPECIFIED = 0; + ACTIVITY_STATE_SCHEDULED = 1; + ACTIVITY_STATE_STARTED = 2; + ACTIVITY_STATE_PAUSED = 3; + ACTIVITY_STATE_SUCCEEDED = 4; + ACTIVITY_STATE_FAILED = 5; + ACTIVITY_STATE_TIMED_OUT = 6; +} + diff --git a/temporal/api/enums/v1/common.proto b/temporal/api/enums/v1/common.proto index 426e2c17..e137bc66 100644 --- a/temporal/api/enums/v1/common.proto +++ b/temporal/api/enums/v1/common.proto @@ -98,13 +98,3 @@ enum NexusOperationCancellationState { // The associated operation timed out - exceeded the user supplied schedule-to-close timeout. NEXUS_OPERATION_CANCELLATION_STATE_TIMED_OUT = 5; } - -enum ActivityState { - ACTIVITY_STATE_UNSPECIFIED = 0; - ACTIVITY_STATE_SCHEDULED = 1; - ACTIVITY_STATE_STARTED = 2; - ACTIVITY_STATE_PAUSED = 3; - ACTIVITY_STATE_SUCCEEDED = 4; - ACTIVITY_STATE_FAILED = 5; - ACTIVITY_STATE_TIMED_OUT = 6; -} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index b47983f4..de07f2cb 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -31,11 +31,12 @@ option java_outer_classname = "RequestResponseProto"; option ruby_package = "Temporalio::Api::WorkflowService::V1"; option csharp_namespace = "Temporalio.Api.WorkflowService.V1"; +import "temporal/api/enums/v1/activity.proto"; import "temporal/api/enums/v1/batch_operation.proto"; +import "temporal/api/enums/v1/common.proto"; import "temporal/api/enums/v1/workflow.proto"; import "temporal/api/enums/v1/namespace.proto"; import "temporal/api/enums/v1/failed_cause.proto"; -import "temporal/api/enums/v1/common.proto"; import "temporal/api/enums/v1/query.proto"; import "temporal/api/enums/v1/reset.proto"; import "temporal/api/enums/v1/task_queue.proto"; @@ -1658,7 +1659,7 @@ message UpdateActivityOptionsRequest { string namespace = 1; temporal.api.common.v1.ActivityExecution activity_execution = 2; - temporal.api.activity.v1.ActivityOptionsUpdate activity_options_update = 3; + temporal.api.activity.v1.OptionsUpdate activity_options_update = 3; string identity = 4; } @@ -1673,7 +1674,7 @@ message DescribeActivityRequest { } message DescribeActivityResponse { - temporal.api.activity.v1.ActivityOptions activity_options = 1; + temporal.api.activity.v1.Options activity_options = 1; temporal.api.enums.v1.ActivityState activity_state = 2; }