From bfbb26fbadbc2d4d6c6f681d99ffc103e046a361 Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Fri, 20 Mar 2026 17:17:26 -0600 Subject: [PATCH 01/11] sample Pause universal operator command request --- .../workflowservice/v1/request_response.proto | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 2d9dd7b83..708c97826 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2010,6 +2010,7 @@ message UpdateActivityOptionsResponse { temporal.api.activity.v1.ActivityOptions activity_options = 1; } +// Deprecated. Use `PauseActivityExecutionRequest`. message PauseActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -2032,9 +2033,40 @@ message PauseActivityRequest { string reason = 6; } +message PauseActivityExecutionRequest { + // Namespace of the workflow which scheduled this activity. + string namespace = 1; + + // If provided, pause a workflow activity (or activities) for the given workflow ID. + // If empty, target a standalone activity. + string workflow_id = 2; + // Pause an activity with this ID. Must be provided for a standalone activity. + // Mutually exclusive with workflow_activity_type. + string activity_id = 3; + // Run ID of the workflow or standalone activity. + string run_id = 4; + + // The identity of the client who initiated this request. + string identity = 5; + + // Pause all pending activities of this type. + // Only available if workflow_id is provided. + // Mutually exclusive with activity_id. + // + // Note: Experimental - the behavior of pausing by activity type might change or be removed in a future release. + string workflow_activity_type = 6; + + // Reason to pause the activity. + string reason = 7; +} + +// Deprecated. Use `PauseActivityExecutionRequest`. message PauseActivityResponse { } +message PauseActivityExecutionResponse { +} + message UnpauseActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; From d8ecd33504ddad5218e4e2760d658aae33345e18 Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Mon, 23 Mar 2026 15:51:21 -0600 Subject: [PATCH 02/11] add pause and unpause activity execution --- .../workflowservice/v1/request_response.proto | 38 ++++++++--- temporal/api/workflowservice/v1/service.proto | 63 +++++++++++++++++++ 2 files changed, 93 insertions(+), 8 deletions(-) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 708c97826..9b94b0fe3 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2049,15 +2049,8 @@ message PauseActivityExecutionRequest { // The identity of the client who initiated this request. string identity = 5; - // Pause all pending activities of this type. - // Only available if workflow_id is provided. - // Mutually exclusive with activity_id. - // - // Note: Experimental - the behavior of pausing by activity type might change or be removed in a future release. - string workflow_activity_type = 6; - // Reason to pause the activity. - string reason = 7; + string reason = 6; } // Deprecated. Use `PauseActivityExecutionRequest`. @@ -2096,9 +2089,38 @@ message UnpauseActivityRequest { google.protobuf.Duration jitter = 9; } +message UnpauseActivityExecutionRequest { + // Namespace of the workflow which scheduled this activity. + string namespace = 1; + + // If provided, pause a workflow activity (or activities) for the given workflow ID. + // If empty, target a standalone activity. + string workflow_id = 2; + // Pause an activity with this ID. Must be provided for a standalone activity. + // Mutually exclusive with workflow_activity_type. + string activity_id = 3; + // Run ID of the workflow or standalone activity. + string run_id = 4; + + // The identity of the client who initiated this request. + string identity = 5; + + // Providing this flag will also reset the number of attempts. + bool reset_attempts = 7; + + // Providing this flag will also reset the heartbeat details. + bool reset_heartbeat = 8; + + // Reason to pause the activity. + string reason = 9; +} + message UnpauseActivityResponse { } +message UnpauseActivityExecutionResponse { +} + // NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities message ResetActivityRequest { // Namespace of the workflow which scheduled this activity. diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index cbd71e2ba..1148c71b4 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1322,6 +1322,39 @@ service WorkflowService { }; } + // PauseActivity pauses the execution of an activity specified by its ID or type. + // If there are multiple pending activities of the provided type - all of them will be paused + // + // Pausing an activity means: + // - If the activity is currently waiting for a retry or is running and subsequently fails, + // it will not be rescheduled until it is unpaused. + // - If the activity is already paused, calling this method will have no effect. + // - If the activity is running and finishes successfully, the activity will be completed. + // - If the activity is running and finishes with failure: + // * if there is no retry left - the activity will be completed. + // * if there are more retries left - the activity will be paused. + // For long-running activities: + // - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + // - The activity should respond to the cancellation accordingly. + // + // Returns a `NotFound` error if there is no pending activity with the provided ID or type + // This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and + // structured to work well for standalone activities. + rpc PauseActivityExecution (PauseActivityExecutionRequest) returns (PauseActivityExecutionResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/activity-pause" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activity-pause" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "workflow:{execution.workflow_id}" + }; + } + // UnpauseActivity unpauses the execution of an activity specified by its ID or type. // If there are multiple pending activities of the provided type - all of them will be unpaused. // @@ -1352,6 +1385,36 @@ service WorkflowService { }; } + // UnpauseActivity unpauses the execution of an activity specified by its ID or type. + // If there are multiple pending activities of the provided type - all of them will be unpaused. + // + // If activity is not paused, this call will have no effect. + // If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + // Once the activity is unpaused, all timeout timers will be regenerated. + // + // Flags: + // 'jitter': the activity will be scheduled at a random time within the jitter duration. + // 'reset_attempts': the number of attempts will be reset. + // 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + // + // Returns a `NotFound` error if there is no pending activity with the provided ID or type + // This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and + // structured to work well for standalone activities. + rpc UnpauseActivityExecution (UnpauseActivityExecutionRequest) returns (UnpauseActivityExecutionResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/activity-unpause" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activity-unpause" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "workflow:{execution.workflow_id}" + }; + } + // ResetActivity resets the execution of an activity specified by its ID or type. // If there are multiple pending activities of the provided type - all of them will be reset. // From bb45124bc048ed67fe153cd21f30c2149d37240b Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Mon, 23 Mar 2026 15:51:50 -0600 Subject: [PATCH 03/11] openapi specs --- openapi/openapiv2.json | 232 +++++++++++++++++++++++++++++++++++- openapi/openapiv3.yaml | 258 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 489 insertions(+), 1 deletion(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index ddbc48c61..184dc857d 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -967,6 +967,47 @@ ] } }, + "/api/v1/namespaces/{namespace}/activity-pause": { + "post": { + "summary": "PauseActivity pauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be paused", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and\nstructured to work well for standalone activities.", + "operationId": "PauseActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/activity-resolve-as-canceled": { "post": { "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", @@ -1007,6 +1048,47 @@ ] } }, + "/api/v1/namespaces/{namespace}/activity-unpause": { + "post": { + "summary": "UnpauseActivity unpauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be unpaused.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and\nstructured to work well for standalone activities.", + "operationId": "UnpauseActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/archived-workflows": { "get": { "summary": "ListArchivedWorkflowExecutions is a visibility API to list archived workflow executions in a specific namespace.", @@ -5537,6 +5619,47 @@ ] } }, + "/namespaces/{namespace}/activity-pause": { + "post": { + "summary": "PauseActivity pauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be paused", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and\nstructured to work well for standalone activities.", + "operationId": "PauseActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/activity-resolve-as-canceled": { "post": { "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", @@ -5577,6 +5700,47 @@ ] } }, + "/namespaces/{namespace}/activity-unpause": { + "post": { + "summary": "UnpauseActivity unpauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be unpaused.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and\nstructured to work well for standalone activities.", + "operationId": "UnpauseActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/archived-workflows": { "get": { "summary": "ListArchivedWorkflowExecutions is a visibility API to list archived workflow executions in a specific namespace.", @@ -9229,6 +9393,32 @@ "type": "string", "description": "Reason to pause the activity." } + }, + "description": "Deprecated. Use `PauseActivityExecutionRequest`." + }, + "WorkflowServicePauseActivityExecutionBody": { + "type": "object", + "properties": { + "workflowId": { + "type": "string", + "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity." + }, + "activityId": { + "type": "string", + "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type." + }, + "runId": { + "type": "string", + "description": "Run ID of the workflow or standalone activity." + }, + "identity": { + "type": "string", + "description": "The identity of the client who initiated this request." + }, + "reason": { + "type": "string", + "description": "Reason to pause the activity." + } } }, "WorkflowServicePauseWorkflowExecutionBody": { @@ -10291,6 +10481,39 @@ } } }, + "WorkflowServiceUnpauseActivityExecutionBody": { + "type": "object", + "properties": { + "workflowId": { + "type": "string", + "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity." + }, + "activityId": { + "type": "string", + "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type." + }, + "runId": { + "type": "string", + "description": "Run ID of the workflow or standalone activity." + }, + "identity": { + "type": "string", + "description": "The identity of the client who initiated this request." + }, + "resetAttempts": { + "type": "boolean", + "description": "Providing this flag will also reset the number of attempts." + }, + "resetHeartbeat": { + "type": "boolean", + "description": "Providing this flag will also reset the heartbeat details." + }, + "reason": { + "type": "string", + "description": "Reason to pause the activity." + } + } + }, "WorkflowServiceUnpauseWorkflowExecutionBody": { "type": "object", "properties": { @@ -14202,9 +14425,13 @@ "v1PatchScheduleResponse": { "type": "object" }, - "v1PauseActivityResponse": { + "v1PauseActivityExecutionResponse": { "type": "object" }, + "v1PauseActivityResponse": { + "type": "object", + "description": "Deprecated. Use `PauseActivityExecutionRequest`." + }, "v1PauseWorkflowExecutionResponse": { "type": "object", "description": "Response to a successful PauseWorkflowExecution request." @@ -16402,6 +16629,9 @@ } } }, + "v1UnpauseActivityExecutionResponse": { + "type": "object" + }, "v1UnpauseActivityResponse": { "type": "object" }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index cd503dccd..7bcfbee41 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -891,6 +891,56 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activity-pause: + post: + tags: + - WorkflowService + description: |- + PauseActivity pauses the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be paused + + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + - The activity should respond to the cancellation accordingly. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type + This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and + structured to work well for standalone activities. + operationId: PauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activity-resolve-as-canceled: post: tags: @@ -927,6 +977,53 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activity-unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivity unpauses the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be unpaused. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Flags: + 'jitter': the activity will be scheduled at a random time within the jitter duration. + 'reset_attempts': the number of attempts will be reset. + 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type + This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and + structured to work well for standalone activities. + operationId: UnpauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/archived-workflows: get: tags: @@ -4982,6 +5079,56 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activity-pause: + post: + tags: + - WorkflowService + description: |- + PauseActivity pauses the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be paused + + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + - The activity should respond to the cancellation accordingly. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type + This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and + structured to work well for standalone activities. + operationId: PauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/activity-resolve-as-canceled: post: tags: @@ -5018,6 +5165,53 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activity-unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivity unpauses the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be unpaused. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Flags: + 'jitter': the activity will be scheduled at a random time within the jitter duration. + 'reset_attempts': the number of attempts will be reset. + 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type + This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and + structured to work well for standalone activities. + operationId: UnpauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/archived-workflows: get: tags: @@ -11191,6 +11385,34 @@ components: PatchScheduleResponse: type: object properties: {} + PauseActivityExecutionRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity. + workflowId: + type: string + description: |- + If provided, pause a workflow activity (or activities) for the given workflow ID. + If empty, target a standalone activity. + activityId: + type: string + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request. + reason: + type: string + description: Reason to pause the activity. + PauseActivityExecutionResponse: + type: object + properties: {} PauseActivityRequest: type: object properties: @@ -11215,9 +11437,11 @@ components: reason: type: string description: Reason to pause the activity. + description: Deprecated. Use `PauseActivityExecutionRequest`. PauseActivityResponse: type: object properties: {} + description: Deprecated. Use `PauseActivityExecutionRequest`. PauseInfo_Manual: type: object properties: @@ -14552,6 +14776,40 @@ components: applied: type: boolean description: True is the rule was applied, based on the rule conditions (predicate/visibility_query). + UnpauseActivityExecutionRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity. + workflowId: + type: string + description: |- + If provided, pause a workflow activity (or activities) for the given workflow ID. + If empty, target a standalone activity. + activityId: + type: string + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request. + resetAttempts: + type: boolean + description: Providing this flag will also reset the number of attempts. + resetHeartbeat: + type: boolean + description: Providing this flag will also reset the heartbeat details. + reason: + type: string + description: Reason to pause the activity. + UnpauseActivityExecutionResponse: + type: object + properties: {} UnpauseActivityRequest: type: object properties: From 8ceb74d0c08ba04f8ae433b9a85316c994523585 Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Mon, 23 Mar 2026 16:22:27 -0600 Subject: [PATCH 04/11] Update and Reset --- .../workflowservice/v1/request_response.proto | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 9b94b0fe3..92891179d 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2005,11 +2005,47 @@ message UpdateActivityOptionsRequest { bool restore_original = 8; } +// NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions +message UpdateActivityExecutionOptionsRequest { + // Namespace of the workflow which scheduled this activity + string namespace = 1; + + // If provided, pause a workflow activity (or activities) for the given workflow ID. + // If empty, target a standalone activity. + string workflow_id = 2; + // Pause an activity with this ID. Must be provided for a standalone activity. + // Mutually exclusive with workflow_activity_type. + string activity_id = 3; + // Run ID of the workflow or standalone activity. + string run_id = 4; + + // The identity of the client who initiated this request + string identity = 5; + + // Activity options. Partial updates are accepted and controlled by update_mask + temporal.api.activity.v1.ActivityOptions activity_options = 6; + + // Controls which fields from `activity_options` will be applied + google.protobuf.FieldMask update_mask = 7; + + // If set, the activity options will be restored to the default. + // Default options are then options activity was created with. + // They are part of the first SCHEDULE event. + // This flag cannot be combined with any other option; if you supply + // restore_original together with other options, the request will be rejected. + bool restore_original = 8; +} + message UpdateActivityOptionsResponse { // Activity options after an update temporal.api.activity.v1.ActivityOptions activity_options = 1; } +message UpdateActivityExecutionOptionsResponse { + // Activity options after an update + temporal.api.activity.v1.ActivityOptions activity_options = 1; +} + // Deprecated. Use `PauseActivityExecutionRequest`. message PauseActivityRequest { // Namespace of the workflow which scheduled this activity. @@ -2156,12 +2192,48 @@ message ResetActivityRequest { // Default options are then options activity was created with. // They are part of the first SCHEDULE event. bool restore_original_options = 9; +} +// NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities +message ResetActivityExecutionRequest { + // Namespace of the workflow which scheduled this activity. + string namespace = 1; + + // If provided, pause a workflow activity (or activities) for the given workflow ID. + // If empty, target a standalone activity. + string workflow_id = 2; + // Pause an activity with this ID. Must be provided for a standalone activity. + // Mutually exclusive with workflow_activity_type. + string activity_id = 3; + // Run ID of the workflow or standalone activity. + string run_id = 4; + + // The identity of the client who initiated this request. + string identity = 5; + + // Indicates that activity should reset heartbeat details. + // This flag will be applied only to the new instance of the activity. + bool reset_heartbeat = 6; + + // If activity is paused, it will remain paused after reset + bool keep_paused = 7; + + // If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration. + // (unless it is paused and keep_paused is set) + google.protobuf.Duration jitter = 8; + + // If set, the activity options will be restored to the defaults. + // Default options are then options activity was created with. + // They are part of the first SCHEDULE event. + bool restore_original_options = 9; } message ResetActivityResponse { } +message ResetActivityExecutionResponse { +} + // Keep the parameters in sync with: // - temporal.api.batch.v1.BatchOperationUpdateWorkflowExecutionOptions. // - temporal.api.workflow.v1.PostResetOperation.UpdateWorkflowOptions. From 10d73903e8779a43844e4a6273de37ab5b84b576 Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Tue, 24 Mar 2026 16:15:36 -0600 Subject: [PATCH 05/11] Add UpdateOptions and Reset --- openapi/openapiv2.json | 366 ++++++++++++-- openapi/openapiv3.yaml | 458 +++++++++++++++--- temporal/api/workflowservice/v1/service.proto | 171 ++++--- 3 files changed, 820 insertions(+), 175 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 184dc857d..25cdf6b5b 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -716,6 +716,54 @@ ] } }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/reset": { + "post": { + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ResetActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", @@ -809,6 +857,53 @@ ] } }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/update-options": { + "post": { + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/activity-complete": { "post": { "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", @@ -967,16 +1062,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activity-pause": { + "/api/v1/namespaces/{namespace}/activity-resolve-as-canceled": { "post": { - "summary": "PauseActivity pauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be paused", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and\nstructured to work well for standalone activities.", - "operationId": "PauseActivityExecution2", + "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", + "description": "For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", + "operationId": "RespondActivityTaskCanceled2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledResponse" } }, "default": { @@ -989,7 +1084,6 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" @@ -999,7 +1093,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledBody" } } ], @@ -1008,16 +1102,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activity-resolve-as-canceled": { + "/api/v1/namespaces/{namespace}/activity/{activityId}/pause": { "post": { - "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", - "description": "For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", - "operationId": "RespondActivityTaskCanceled2", + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledResponse" + "$ref": "#/definitions/v1PauseActivityExecutionResponse" } }, "default": { @@ -1030,6 +1124,14 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -1039,7 +1141,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledBody" + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" } } ], @@ -1048,10 +1150,10 @@ ] } }, - "/api/v1/namespaces/{namespace}/activity-unpause": { + "/api/v1/namespaces/{namespace}/activity/{activityId}/unpause": { "post": { - "summary": "UnpauseActivity unpauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be unpaused.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and\nstructured to work well for standalone activities.", + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", "operationId": "UnpauseActivityExecution2", "responses": { "200": { @@ -1075,6 +1177,13 @@ "required": true, "type": "string" }, + { + "name": "activityId", + "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", @@ -5368,6 +5477,54 @@ ] } }, + "/namespaces/{namespace}/activities/{activityId}/reset": { + "post": { + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ResetActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", @@ -5461,6 +5618,53 @@ ] } }, + "/namespaces/{namespace}/activities/{activityId}/update-options": { + "post": { + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/activity-complete": { "post": { "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", @@ -5619,16 +5823,16 @@ ] } }, - "/namespaces/{namespace}/activity-pause": { + "/namespaces/{namespace}/activity-resolve-as-canceled": { "post": { - "summary": "PauseActivity pauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be paused", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and\nstructured to work well for standalone activities.", - "operationId": "PauseActivityExecution", + "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", + "description": "For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", + "operationId": "RespondActivityTaskCanceled", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledResponse" } }, "default": { @@ -5641,7 +5845,6 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" @@ -5651,7 +5854,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledBody" } } ], @@ -5660,16 +5863,16 @@ ] } }, - "/namespaces/{namespace}/activity-resolve-as-canceled": { + "/namespaces/{namespace}/activity/{activityId}/pause": { "post": { - "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", - "description": "For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", - "operationId": "RespondActivityTaskCanceled", + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledResponse" + "$ref": "#/definitions/v1PauseActivityExecutionResponse" } }, "default": { @@ -5682,6 +5885,14 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -5691,7 +5902,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledBody" + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" } } ], @@ -5700,10 +5911,10 @@ ] } }, - "/namespaces/{namespace}/activity-unpause": { + "/namespaces/{namespace}/activity/{activityId}/unpause": { "post": { - "summary": "UnpauseActivity unpauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be unpaused.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and\nstructured to work well for standalone activities.", + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", "operationId": "UnpauseActivityExecution", "responses": { "200": { @@ -5727,6 +5938,13 @@ "required": true, "type": "string" }, + { + "name": "activityId", + "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", @@ -9403,10 +9621,6 @@ "type": "string", "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity." }, - "activityId": { - "type": "string", - "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type." - }, "runId": { "type": "string", "description": "Run ID of the workflow or standalone activity." @@ -9639,6 +9853,40 @@ }, "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities" }, + "WorkflowServiceResetActivityExecutionBody": { + "type": "object", + "properties": { + "workflowId": { + "type": "string", + "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity." + }, + "runId": { + "type": "string", + "description": "Run ID of the workflow or standalone activity." + }, + "identity": { + "type": "string", + "description": "The identity of the client who initiated this request." + }, + "resetHeartbeat": { + "type": "boolean", + "description": "Indicates that activity should reset heartbeat details.\nThis flag will be applied only to the new instance of the activity." + }, + "keepPaused": { + "type": "boolean", + "title": "If activity is paused, it will remain paused after reset" + }, + "jitter": { + "type": "string", + "title": "If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.\n(unless it is paused and keep_paused is set)" + }, + "restoreOriginalOptions": { + "type": "boolean", + "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event." + } + }, + "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities" + }, "WorkflowServiceResetWorkflowExecutionBody": { "type": "object", "properties": { @@ -10488,10 +10736,6 @@ "type": "string", "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity." }, - "activityId": { - "type": "string", - "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type." - }, "runId": { "type": "string", "description": "Run ID of the workflow or standalone activity." @@ -10535,6 +10779,36 @@ } } }, + "WorkflowServiceUpdateActivityExecutionOptionsBody": { + "type": "object", + "properties": { + "workflowId": { + "type": "string", + "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity." + }, + "runId": { + "type": "string", + "description": "Run ID of the workflow or standalone activity." + }, + "identity": { + "type": "string", + "title": "The identity of the client who initiated this request" + }, + "activityOptions": { + "$ref": "#/definitions/v1ActivityOptions", + "title": "Activity options. Partial updates are accepted and controlled by update_mask" + }, + "updateMask": { + "type": "string", + "title": "Controls which fields from `activity_options` will be applied" + }, + "restoreOriginal": { + "type": "boolean", + "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." + } + }, + "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions" + }, "WorkflowServiceUpdateActivityOptionsBody": { "type": "object", "properties": { @@ -15212,6 +15486,9 @@ }, "description": "RequestIdInfo contains details of a request ID." }, + "v1ResetActivityExecutionResponse": { + "type": "object" + }, "v1ResetActivityResponse": { "type": "object" }, @@ -16639,6 +16916,15 @@ "type": "object", "description": "Response to a successful UnpauseWorkflowExecution request." }, + "v1UpdateActivityExecutionOptionsResponse": { + "type": "object", + "properties": { + "activityOptions": { + "$ref": "#/definitions/v1ActivityOptions", + "title": "Activity options after an update" + } + } + }, "v1UpdateActivityOptionsResponse": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 7bcfbee41..20ff57a87 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -661,6 +661,63 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/reset: + post: + tags: + - WorkflowService + description: |- + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag), + + Flags: + + 'jitter': the activity will be scheduled at a random time within the jitter duration. + If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided. + 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset. + 'keep_paused': if the activity is paused, it will remain paused. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: post: tags: @@ -744,6 +801,48 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/update-options: + post: + tags: + - WorkflowService + description: |- + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activity-complete: post: tags: @@ -891,34 +990,20 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activity-pause: + /api/v1/namespaces/{namespace}/activity-resolve-as-canceled: post: tags: - WorkflowService description: |- - PauseActivity pauses the execution of an activity specified by its ID or type. - If there are multiple pending activities of the provided type - all of them will be paused - - Pausing an activity means: - - If the activity is currently waiting for a retry or is running and subsequently fails, - it will not be rescheduled until it is unpaused. - - If the activity is already paused, calling this method will have no effect. - - If the activity is running and finishes successfully, the activity will be completed. - - If the activity is running and finishes with failure: - * if there is no retry left - the activity will be completed. - * if there are more retries left - the activity will be paused. - For long-running activities: - - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. - - The activity should respond to the cancellation accordingly. + RespondActivityTaskFailed is called by workers when processing an activity task fails. - Returns a `NotFound` error if there is no pending activity with the provided ID or type - This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and - structured to work well for standalone activities. - operationId: PauseActivityExecution + For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history + and a new workflow task created for the workflow. Fails with `NotFound` if the task token is + no longer valid due to activity timeout, already being completed, or never having existed. + operationId: RespondActivityTaskCanceled parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity. required: true schema: type: string @@ -926,7 +1011,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityExecutionRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledRequest' required: true responses: "200": @@ -934,27 +1019,47 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityExecutionResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activity-resolve-as-canceled: + /api/v1/namespaces/{namespace}/activity/{activityId}/pause: post: tags: - WorkflowService description: |- - RespondActivityTaskFailed is called by workers when processing an activity task fails. + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity - For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history - and a new workflow task created for the workflow. Fails with `NotFound` if the task token is - no longer valid due to activity timeout, already being completed, or never having existed. - operationId: RespondActivityTaskCanceled + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + - The activity should respond to the cancellation accordingly. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution parameters: - name: namespace in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. required: true schema: type: string @@ -962,7 +1067,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledRequest' + $ref: '#/components/schemas/PauseActivityExecutionRequest' required: true responses: "200": @@ -970,20 +1075,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledResponse' + $ref: '#/components/schemas/PauseActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activity-unpause: + /api/v1/namespaces/{namespace}/activity/{activityId}/unpause: post: tags: - WorkflowService description: |- - UnpauseActivity unpauses the execution of an activity specified by its ID or type. - If there are multiple pending activities of the provided type - all of them will be unpaused. + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. If activity is not paused, this call will have no effect. If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). @@ -994,9 +1099,7 @@ paths: 'reset_attempts': the number of attempts will be reset. 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. - Returns a `NotFound` error if there is no pending activity with the provided ID or type - This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and - structured to work well for standalone activities. + Returns a `NotFound` error if there is no pending activity with the provided ID operationId: UnpauseActivityExecution parameters: - name: namespace @@ -1005,6 +1108,14 @@ paths: required: true schema: type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string requestBody: content: application/json: @@ -4849,6 +4960,63 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/reset: + post: + tags: + - WorkflowService + description: |- + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag), + + Flags: + + 'jitter': the activity will be scheduled at a random time within the jitter duration. + If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided. + 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset. + 'keep_paused': if the activity is paused, it will remain paused. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: post: tags: @@ -4932,6 +5100,48 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/update-options: + post: + tags: + - WorkflowService + description: |- + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/activity-complete: post: tags: @@ -5079,34 +5289,20 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activity-pause: + /namespaces/{namespace}/activity-resolve-as-canceled: post: tags: - WorkflowService description: |- - PauseActivity pauses the execution of an activity specified by its ID or type. - If there are multiple pending activities of the provided type - all of them will be paused - - Pausing an activity means: - - If the activity is currently waiting for a retry or is running and subsequently fails, - it will not be rescheduled until it is unpaused. - - If the activity is already paused, calling this method will have no effect. - - If the activity is running and finishes successfully, the activity will be completed. - - If the activity is running and finishes with failure: - * if there is no retry left - the activity will be completed. - * if there are more retries left - the activity will be paused. - For long-running activities: - - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. - - The activity should respond to the cancellation accordingly. + RespondActivityTaskFailed is called by workers when processing an activity task fails. - Returns a `NotFound` error if there is no pending activity with the provided ID or type - This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and - structured to work well for standalone activities. - operationId: PauseActivityExecution + For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history + and a new workflow task created for the workflow. Fails with `NotFound` if the task token is + no longer valid due to activity timeout, already being completed, or never having existed. + operationId: RespondActivityTaskCanceled parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity. required: true schema: type: string @@ -5114,7 +5310,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityExecutionRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledRequest' required: true responses: "200": @@ -5122,27 +5318,47 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityExecutionResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activity-resolve-as-canceled: + /namespaces/{namespace}/activity/{activityId}/pause: post: tags: - WorkflowService description: |- - RespondActivityTaskFailed is called by workers when processing an activity task fails. + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity - For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history - and a new workflow task created for the workflow. Fails with `NotFound` if the task token is - no longer valid due to activity timeout, already being completed, or never having existed. - operationId: RespondActivityTaskCanceled + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + - The activity should respond to the cancellation accordingly. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution parameters: - name: namespace in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. required: true schema: type: string @@ -5150,7 +5366,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledRequest' + $ref: '#/components/schemas/PauseActivityExecutionRequest' required: true responses: "200": @@ -5158,20 +5374,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledResponse' + $ref: '#/components/schemas/PauseActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activity-unpause: + /namespaces/{namespace}/activity/{activityId}/unpause: post: tags: - WorkflowService description: |- - UnpauseActivity unpauses the execution of an activity specified by its ID or type. - If there are multiple pending activities of the provided type - all of them will be unpaused. + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. If activity is not paused, this call will have no effect. If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). @@ -5182,9 +5398,7 @@ paths: 'reset_attempts': the number of attempts will be reset. 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. - Returns a `NotFound` error if there is no pending activity with the provided ID or type - This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and - structured to work well for standalone activities. + Returns a `NotFound` error if there is no pending activity with the provided ID operationId: UnpauseActivityExecution parameters: - name: namespace @@ -5193,6 +5407,14 @@ paths: required: true schema: type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string requestBody: content: application/json: @@ -12497,6 +12719,52 @@ components: Indicate if the request is still buffered. If so, the event ID is not known and its value will be an invalid event ID. description: RequestIdInfo contains details of a request ID. + ResetActivityExecutionRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity. + workflowId: + type: string + description: |- + If provided, pause a workflow activity (or activities) for the given workflow ID. + If empty, target a standalone activity. + activityId: + type: string + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request. + resetHeartbeat: + type: boolean + description: |- + Indicates that activity should reset heartbeat details. + This flag will be applied only to the new instance of the activity. + keepPaused: + type: boolean + description: If activity is paused, it will remain paused after reset + jitter: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration. + (unless it is paused and keep_paused is set) + restoreOriginalOptions: + type: boolean + description: |- + If set, the activity options will be restored to the defaults. + Default options are then options activity was created with. + They are part of the first SCHEDULE event. + description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities' + ResetActivityExecutionResponse: + type: object + properties: {} ResetActivityRequest: type: object properties: @@ -14870,6 +15138,52 @@ components: type: object properties: {} description: Response to a successful UnpauseWorkflowExecution request. + UpdateActivityExecutionOptionsRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity + workflowId: + type: string + description: |- + If provided, pause a workflow activity (or activities) for the given workflow ID. + If empty, target a standalone activity. + activityId: + type: string + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request + activityOptions: + allOf: + - $ref: '#/components/schemas/ActivityOptions' + description: Activity options. Partial updates are accepted and controlled by update_mask + updateMask: + type: string + description: Controls which fields from `activity_options` will be applied + format: field-mask + restoreOriginal: + type: boolean + description: |- + If set, the activity options will be restored to the default. + Default options are then options activity was created with. + They are part of the first SCHEDULE event. + This flag cannot be combined with any other option; if you supply + restore_original together with other options, the request will be rejected. + description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions' + UpdateActivityExecutionOptionsResponse: + type: object + properties: + activityOptions: + allOf: + - $ref: '#/components/schemas/ActivityOptions' + description: Activity options after an update UpdateActivityOptionsRequest: type: object properties: diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 748ff49a7..891ce1712 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1322,39 +1322,6 @@ service WorkflowService { }; } - // PauseActivity pauses the execution of an activity specified by its ID or type. - // If there are multiple pending activities of the provided type - all of them will be paused - // - // Pausing an activity means: - // - If the activity is currently waiting for a retry or is running and subsequently fails, - // it will not be rescheduled until it is unpaused. - // - If the activity is already paused, calling this method will have no effect. - // - If the activity is running and finishes successfully, the activity will be completed. - // - If the activity is running and finishes with failure: - // * if there is no retry left - the activity will be completed. - // * if there are more retries left - the activity will be paused. - // For long-running activities: - // - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. - // - The activity should respond to the cancellation accordingly. - // - // Returns a `NotFound` error if there is no pending activity with the provided ID or type - // This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and - // structured to work well for standalone activities. - rpc PauseActivityExecution (PauseActivityExecutionRequest) returns (PauseActivityExecutionResponse) { - option (google.api.http) = { - post: "/namespaces/{namespace}/activity-pause" - body: "*" - additional_bindings { - post: "/api/v1/namespaces/{namespace}/activity-pause" - body: "*" - } - }; - option (temporal.api.protometa.v1.request_header) = { - header: "temporal-resource-id" - value: "workflow:{execution.workflow_id}" - }; - } - // UnpauseActivity unpauses the execution of an activity specified by its ID or type. // If there are multiple pending activities of the provided type - all of them will be unpaused. // @@ -1385,36 +1352,6 @@ service WorkflowService { }; } - // UnpauseActivity unpauses the execution of an activity specified by its ID or type. - // If there are multiple pending activities of the provided type - all of them will be unpaused. - // - // If activity is not paused, this call will have no effect. - // If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). - // Once the activity is unpaused, all timeout timers will be regenerated. - // - // Flags: - // 'jitter': the activity will be scheduled at a random time within the jitter duration. - // 'reset_attempts': the number of attempts will be reset. - // 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. - // - // Returns a `NotFound` error if there is no pending activity with the provided ID or type - // This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and - // structured to work well for standalone activities. - rpc UnpauseActivityExecution (UnpauseActivityExecutionRequest) returns (UnpauseActivityExecutionResponse) { - option (google.api.http) = { - post: "/namespaces/{namespace}/activity-unpause" - body: "*" - additional_bindings { - post: "/api/v1/namespaces/{namespace}/activity-unpause" - body: "*" - } - }; - option (temporal.api.protometa.v1.request_header) = { - header: "temporal-resource-id" - value: "workflow:{execution.workflow_id}" - }; - } - // ResetActivity resets the execution of an activity specified by its ID or type. // If there are multiple pending activities of the provided type - all of them will be reset. // @@ -1747,4 +1684,112 @@ service WorkflowService { // (-- api-linter: core::0127::http-annotation=disabled // aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) rpc DeleteActivityExecution (DeleteActivityExecutionRequest) returns (DeleteActivityExecutionResponse) {} + + // PauseActivityExecution pauses the execution of an activity specified by its ID. + // This API can be used to target a workflow activity or a standalone activity + // + // Pausing an activity means: + // - If the activity is currently waiting for a retry or is running and subsequently fails, + // it will not be rescheduled until it is unpaused. + // - If the activity is already paused, calling this method will have no effect. + // - If the activity is running and finishes successfully, the activity will be completed. + // - If the activity is running and finishes with failure: + // * if there is no retry left - the activity will be completed. + // * if there are more retries left - the activity will be paused. + // For long-running activities: + // - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + // - The activity should respond to the cancellation accordingly. + // + // Returns a `NotFound` error if there is no pending activity with the provided ID + rpc PauseActivityExecution (PauseActivityExecutionRequest) returns (PauseActivityExecutionResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/activity/{activity_id}/pause" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activity/{activity_id}/pause" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "workflow:{execution.workflow_id}" + }; + } + + // ResetActivityExecution resets the execution of an activity specified by its ID. + // This API can be used to target a workflow activity or a standalone activity. + // + // Resetting an activity means: + // * number of attempts will be reset to 0. + // * activity timeouts will be reset. + // * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + // it will be scheduled immediately (* see 'jitter' flag), + // + // Flags: + // + // 'jitter': the activity will be scheduled at a random time within the jitter duration. + // If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided. + // 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset. + // 'keep_paused': if the activity is paused, it will remain paused. + // + // Returns a `NotFound` error if there is no pending activity with the provided ID or type. + rpc ResetActivityExecution (ResetActivityExecutionRequest) returns (ResetActivityExecutionResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/activities/{activity_id}/reset" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/reset" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "workflow:{execution.workflow_id}" + }; + } + + // UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + // This API can be used to target a workflow activity or a standalone activity. + // + // If activity is not paused, this call will have no effect. + // If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + // Once the activity is unpaused, all timeout timers will be regenerated. + // + // Flags: + // 'jitter': the activity will be scheduled at a random time within the jitter duration. + // 'reset_attempts': the number of attempts will be reset. + // 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + // + // Returns a `NotFound` error if there is no pending activity with the provided ID + rpc UnpauseActivityExecution (UnpauseActivityExecutionRequest) returns (UnpauseActivityExecutionResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/activity/{activity_id}/unpause" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activity/{activity_id}/unpause" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "workflow:{execution.workflow_id}" + }; + } + + // UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + // This API can be used to target a workflow activity or a standalone activity. + rpc UpdateActivityExecutionOptions (UpdateActivityExecutionOptionsRequest) returns (UpdateActivityExecutionOptionsResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/activities/{activity_id}/update-options" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/update-options" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "workflow:{execution.workflow_id}" + }; + } } From 4abdad86ede7a189cccb490c620ac57f120c4591 Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Tue, 24 Mar 2026 17:17:20 -0600 Subject: [PATCH 06/11] consistency checks --- openapi/openapiv2.json | 382 +++++++------- openapi/openapiv3.yaml | 464 +++++++++--------- .../workflowservice/v1/request_response.proto | 27 +- temporal/api/workflowservice/v1/service.proto | 16 +- 4 files changed, 450 insertions(+), 439 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 25cdf6b5b..4f4a37fcb 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -716,16 +716,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/reset": { + "/api/v1/namespaces/{namespace}/activities/{activityId}/pause": { "post": { - "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", - "operationId": "ResetActivityExecution2", + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetActivityExecutionResponse" + "$ref": "#/definitions/v1PauseActivityExecutionResponse" } }, "default": { @@ -755,7 +755,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" } } ], @@ -764,15 +764,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { + "/api/v1/namespaces/{namespace}/activities/{activityId}/reset": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById2", + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1ResetActivityExecutionResponse" } }, "default": { @@ -785,14 +786,14 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -802,7 +803,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" } } ], @@ -811,16 +812,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/terminate": { + "/api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", - "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", - "operationId": "TerminateActivityExecution2", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -833,12 +833,14 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -848,7 +850,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -857,15 +859,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/update-options": { + "/api/v1/namespaces/{namespace}/activities/{activityId}/terminate": { "post": { - "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "operationId": "UpdateActivityExecutionOptions2", + "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", + "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", + "operationId": "TerminateActivityExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + "$ref": "#/definitions/v1TerminateActivityExecutionResponse" } }, "default": { @@ -878,14 +881,12 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -895,7 +896,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" } } ], @@ -904,16 +905,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activity-complete": { + "/api/v1/namespaces/{namespace}/activities/{activityId}/unpause": { "post": { - "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", - "description": "For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", - "operationId": "RespondActivityTaskCompleted2", + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCompletedResponse" + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" } }, "default": { @@ -926,6 +927,14 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -935,7 +944,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" } } ], @@ -944,15 +953,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/activity-count": { - "get": { - "summary": "CountActivityExecutions is a visibility API to count activity executions in a specific namespace.", - "operationId": "CountActivityExecutions2", + "/api/v1/namespaces/{namespace}/activities/{activityId}/update-options": { + "post": { + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1CountActivityExecutionsResponse" + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" } }, "default": { @@ -965,16 +974,25 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { - "name": "query", - "description": "Visibility query, see https://docs.temporal.io/list-filter for the syntax.", - "in": "query", - "required": false, + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } } ], "tags": [ @@ -982,16 +1000,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activity-fail": { + "/api/v1/namespaces/{namespace}/activity-complete": { "post": { - "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", - "description": "This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and\na new workflow task created for the workflow. Fails with `NotFound` if the task token is no\nlonger valid due to activity timeout, already being completed, or never having existed.", - "operationId": "RespondActivityTaskFailed2", + "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", + "description": "For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", + "operationId": "RespondActivityTaskCompleted2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedResponse" + "$ref": "#/definitions/v1RespondActivityTaskCompletedResponse" } }, "default": { @@ -1013,7 +1031,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedBody" } } ], @@ -1022,16 +1040,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/activity-heartbeat": { - "post": { - "summary": "RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.", - "description": "If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,\nthen the current attempt times out. Depending on RetryPolicy, this may trigger a retry or\ntime out the activity.\n\nFor workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow\nhistory. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations,\nin that event, the SDK should request cancellation of the activity.\n\nThe request may contain response `details` which will be persisted by the server and may be\nused by the activity to checkpoint progress. The `cancel_requested` field in the response\nindicates whether cancellation has been requested for the activity.", - "operationId": "RecordActivityTaskHeartbeat2", + "/api/v1/namespaces/{namespace}/activity-count": { + "get": { + "summary": "CountActivityExecutions is a visibility API to count activity executions in a specific namespace.", + "operationId": "CountActivityExecutions2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatResponse" + "$ref": "#/definitions/v1CountActivityExecutionsResponse" } }, "default": { @@ -1049,12 +1066,11 @@ "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatBody" - } + "name": "query", + "description": "Visibility query, see https://docs.temporal.io/list-filter for the syntax.", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -1062,16 +1078,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activity-resolve-as-canceled": { + "/api/v1/namespaces/{namespace}/activity-fail": { "post": { "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", - "description": "For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", - "operationId": "RespondActivityTaskCanceled2", + "description": "This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and\na new workflow task created for the workflow. Fails with `NotFound` if the task token is no\nlonger valid due to activity timeout, already being completed, or never having existed.", + "operationId": "RespondActivityTaskFailed2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledResponse" + "$ref": "#/definitions/v1RespondActivityTaskFailedResponse" } }, "default": { @@ -1093,7 +1109,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedBody" } } ], @@ -1102,16 +1118,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activity/{activityId}/pause": { + "/api/v1/namespaces/{namespace}/activity-heartbeat": { "post": { - "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "PauseActivityExecution2", + "summary": "RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.", + "description": "If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,\nthen the current attempt times out. Depending on RetryPolicy, this may trigger a retry or\ntime out the activity.\n\nFor workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow\nhistory. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations,\nin that event, the SDK should request cancellation of the activity.\n\nThe request may contain response `details` which will be persisted by the server and may be\nused by the activity to checkpoint progress. The `cancel_requested` field in the response\nindicates whether cancellation has been requested for the activity.", + "operationId": "RecordActivityTaskHeartbeat2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityExecutionResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatResponse" } }, "default": { @@ -1124,14 +1140,6 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -1141,7 +1149,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatBody" } } ], @@ -1150,16 +1158,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activity/{activityId}/unpause": { + "/api/v1/namespaces/{namespace}/activity-resolve-as-canceled": { "post": { - "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "UnpauseActivityExecution2", + "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", + "description": "For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", + "operationId": "RespondActivityTaskCanceled2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledResponse" } }, "default": { @@ -1172,14 +1180,6 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -1189,7 +1189,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledBody" } } ], @@ -5477,16 +5477,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/reset": { + "/namespaces/{namespace}/activities/{activityId}/pause": { "post": { - "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", - "operationId": "ResetActivityExecution", + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetActivityExecutionResponse" + "$ref": "#/definitions/v1PauseActivityExecutionResponse" } }, "default": { @@ -5516,7 +5516,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" } } ], @@ -5525,15 +5525,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { + "/namespaces/{namespace}/activities/{activityId}/reset": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById", + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1ResetActivityExecutionResponse" } }, "default": { @@ -5546,14 +5547,14 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -5563,7 +5564,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" } } ], @@ -5572,16 +5573,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/terminate": { + "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", - "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", - "operationId": "TerminateActivityExecution", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -5594,12 +5594,14 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -5609,7 +5611,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -5618,15 +5620,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/update-options": { + "/namespaces/{namespace}/activities/{activityId}/terminate": { "post": { - "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "operationId": "UpdateActivityExecutionOptions", + "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", + "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", + "operationId": "TerminateActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + "$ref": "#/definitions/v1TerminateActivityExecutionResponse" } }, "default": { @@ -5639,14 +5642,12 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -5656,7 +5657,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" } } ], @@ -5665,16 +5666,16 @@ ] } }, - "/namespaces/{namespace}/activity-complete": { + "/namespaces/{namespace}/activities/{activityId}/unpause": { "post": { - "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", - "description": "For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", - "operationId": "RespondActivityTaskCompleted", + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCompletedResponse" + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" } }, "default": { @@ -5687,6 +5688,14 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -5696,7 +5705,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" } } ], @@ -5705,15 +5714,15 @@ ] } }, - "/namespaces/{namespace}/activity-count": { - "get": { - "summary": "CountActivityExecutions is a visibility API to count activity executions in a specific namespace.", - "operationId": "CountActivityExecutions", + "/namespaces/{namespace}/activities/{activityId}/update-options": { + "post": { + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1CountActivityExecutionsResponse" + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" } }, "default": { @@ -5726,16 +5735,25 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { - "name": "query", - "description": "Visibility query, see https://docs.temporal.io/list-filter for the syntax.", - "in": "query", - "required": false, + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } } ], "tags": [ @@ -5743,16 +5761,16 @@ ] } }, - "/namespaces/{namespace}/activity-fail": { + "/namespaces/{namespace}/activity-complete": { "post": { - "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", - "description": "This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and\na new workflow task created for the workflow. Fails with `NotFound` if the task token is no\nlonger valid due to activity timeout, already being completed, or never having existed.", - "operationId": "RespondActivityTaskFailed", + "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", + "description": "For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", + "operationId": "RespondActivityTaskCompleted", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedResponse" + "$ref": "#/definitions/v1RespondActivityTaskCompletedResponse" } }, "default": { @@ -5774,7 +5792,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedBody" } } ], @@ -5783,16 +5801,15 @@ ] } }, - "/namespaces/{namespace}/activity-heartbeat": { - "post": { - "summary": "RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.", - "description": "If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,\nthen the current attempt times out. Depending on RetryPolicy, this may trigger a retry or\ntime out the activity.\n\nFor workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow\nhistory. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations,\nin that event, the SDK should request cancellation of the activity.\n\nThe request may contain response `details` which will be persisted by the server and may be\nused by the activity to checkpoint progress. The `cancel_requested` field in the response\nindicates whether cancellation has been requested for the activity.", - "operationId": "RecordActivityTaskHeartbeat", + "/namespaces/{namespace}/activity-count": { + "get": { + "summary": "CountActivityExecutions is a visibility API to count activity executions in a specific namespace.", + "operationId": "CountActivityExecutions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatResponse" + "$ref": "#/definitions/v1CountActivityExecutionsResponse" } }, "default": { @@ -5810,12 +5827,11 @@ "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatBody" - } + "name": "query", + "description": "Visibility query, see https://docs.temporal.io/list-filter for the syntax.", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -5823,16 +5839,16 @@ ] } }, - "/namespaces/{namespace}/activity-resolve-as-canceled": { + "/namespaces/{namespace}/activity-fail": { "post": { "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", - "description": "For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", - "operationId": "RespondActivityTaskCanceled", + "description": "This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and\na new workflow task created for the workflow. Fails with `NotFound` if the task token is no\nlonger valid due to activity timeout, already being completed, or never having existed.", + "operationId": "RespondActivityTaskFailed", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledResponse" + "$ref": "#/definitions/v1RespondActivityTaskFailedResponse" } }, "default": { @@ -5854,7 +5870,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedBody" } } ], @@ -5863,16 +5879,16 @@ ] } }, - "/namespaces/{namespace}/activity/{activityId}/pause": { + "/namespaces/{namespace}/activity-heartbeat": { "post": { - "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "PauseActivityExecution", + "summary": "RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.", + "description": "If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,\nthen the current attempt times out. Depending on RetryPolicy, this may trigger a retry or\ntime out the activity.\n\nFor workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow\nhistory. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations,\nin that event, the SDK should request cancellation of the activity.\n\nThe request may contain response `details` which will be persisted by the server and may be\nused by the activity to checkpoint progress. The `cancel_requested` field in the response\nindicates whether cancellation has been requested for the activity.", + "operationId": "RecordActivityTaskHeartbeat", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityExecutionResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatResponse" } }, "default": { @@ -5885,14 +5901,6 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -5902,7 +5910,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatBody" } } ], @@ -5911,16 +5919,16 @@ ] } }, - "/namespaces/{namespace}/activity/{activityId}/unpause": { + "/namespaces/{namespace}/activity-resolve-as-canceled": { "post": { - "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "UnpauseActivityExecution", + "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", + "description": "For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", + "operationId": "RespondActivityTaskCanceled", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledResponse" } }, "default": { @@ -5933,14 +5941,6 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "activityId", - "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -5950,7 +5950,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledBody" } } ], @@ -9858,7 +9858,7 @@ "properties": { "workflowId": { "type": "string", - "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity." + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity." }, "runId": { "type": "string", @@ -10734,7 +10734,7 @@ "properties": { "workflowId": { "type": "string", - "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity." + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity." }, "runId": { "type": "string", @@ -10754,7 +10754,11 @@ }, "reason": { "type": "string", - "description": "Reason to pause the activity." + "description": "Reason to unpause the activity." + }, + "jitter": { + "type": "string", + "description": "If set, the activity will start at a random time within the specified jitter duration." } } }, @@ -10784,7 +10788,7 @@ "properties": { "workflowId": { "type": "string", - "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity." + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity." }, "runId": { "type": "string", @@ -14704,7 +14708,7 @@ }, "v1PauseActivityResponse": { "type": "object", - "description": "Deprecated. Use `PauseActivityExecutionRequest`." + "description": "Deprecated. Use `PauseActivityExecutionResponse`." }, "v1PauseWorkflowExecutionResponse": { "type": "object", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 20ff57a87..d8b88c73f 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -661,6 +661,62 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/pause: + post: + tags: + - WorkflowService + description: |- + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity + + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + - The activity should respond to the cancellation accordingly. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activities/{activityId}/reset: post: tags: @@ -694,7 +750,7 @@ paths: - name: activityId in: path description: |- - Pause an activity with this ID. Must be provided for a standalone activity. + The ID of the activity to target. Must be provided for a standalone activity. Mutually exclusive with workflow_activity_type. required: true schema: @@ -801,6 +857,59 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Flags: + 'jitter': the activity will be scheduled at a random time within the jitter duration. + 'reset_attempts': the number of attempts will be reset. + 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activities/{activityId}/update-options: post: tags: @@ -819,7 +928,7 @@ paths: - name: activityId in: path description: |- - Pause an activity with this ID. Must be provided for a standalone activity. + The ID of the activity to target. Must be provided for a standalone activity. Mutually exclusive with workflow_activity_type. required: true schema: @@ -1026,115 +1135,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activity/{activityId}/pause: - post: - tags: - - WorkflowService - description: |- - PauseActivityExecution pauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity - - Pausing an activity means: - - If the activity is currently waiting for a retry or is running and subsequently fails, - it will not be rescheduled until it is unpaused. - - If the activity is already paused, calling this method will have no effect. - - If the activity is running and finishes successfully, the activity will be completed. - - If the activity is running and finishes with failure: - * if there is no retry left - the activity will be completed. - * if there are more retries left - the activity will be paused. - For long-running activities: - - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. - - The activity should respond to the cancellation accordingly. - - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: PauseActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: |- - Pause an activity with this ID. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activity/{activityId}/unpause: - post: - tags: - - WorkflowService - description: |- - UnpauseActivityExecution unpauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - If activity is not paused, this call will have no effect. - If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). - Once the activity is unpaused, all timeout timers will be regenerated. - - Flags: - 'jitter': the activity will be scheduled at a random time within the jitter duration. - 'reset_attempts': the number of attempts will be reset. - 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. - - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: UnpauseActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: |- - Pause an activity with this ID. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/archived-workflows: get: tags: @@ -4960,6 +4960,62 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/pause: + post: + tags: + - WorkflowService + description: |- + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity + + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + - The activity should respond to the cancellation accordingly. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/activities/{activityId}/reset: post: tags: @@ -4993,7 +5049,7 @@ paths: - name: activityId in: path description: |- - Pause an activity with this ID. Must be provided for a standalone activity. + The ID of the activity to target. Must be provided for a standalone activity. Mutually exclusive with workflow_activity_type. required: true schema: @@ -5100,6 +5156,59 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Flags: + 'jitter': the activity will be scheduled at a random time within the jitter duration. + 'reset_attempts': the number of attempts will be reset. + 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/activities/{activityId}/update-options: post: tags: @@ -5118,7 +5227,7 @@ paths: - name: activityId in: path description: |- - Pause an activity with this ID. Must be provided for a standalone activity. + The ID of the activity to target. Must be provided for a standalone activity. Mutually exclusive with workflow_activity_type. required: true schema: @@ -5325,115 +5434,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activity/{activityId}/pause: - post: - tags: - - WorkflowService - description: |- - PauseActivityExecution pauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity - - Pausing an activity means: - - If the activity is currently waiting for a retry or is running and subsequently fails, - it will not be rescheduled until it is unpaused. - - If the activity is already paused, calling this method will have no effect. - - If the activity is running and finishes successfully, the activity will be completed. - - If the activity is running and finishes with failure: - * if there is no retry left - the activity will be completed. - * if there are more retries left - the activity will be paused. - For long-running activities: - - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. - - The activity should respond to the cancellation accordingly. - - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: PauseActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: |- - Pause an activity with this ID. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PauseActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activity/{activityId}/unpause: - post: - tags: - - WorkflowService - description: |- - UnpauseActivityExecution unpauses the execution of an activity specified by its ID. - This API can be used to target a workflow activity or a standalone activity. - - If activity is not paused, this call will have no effect. - If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). - Once the activity is unpaused, all timeout timers will be regenerated. - - Flags: - 'jitter': the activity will be scheduled at a random time within the jitter duration. - 'reset_attempts': the number of attempts will be reset. - 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. - - Returns a `NotFound` error if there is no pending activity with the provided ID - operationId: UnpauseActivityExecution - parameters: - - name: namespace - in: path - description: Namespace of the workflow which scheduled this activity. - required: true - schema: - type: string - - name: activityId - in: path - description: |- - Pause an activity with this ID. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityExecutionResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /namespaces/{namespace}/archived-workflows: get: tags: @@ -11663,7 +11663,7 @@ components: PauseActivityResponse: type: object properties: {} - description: Deprecated. Use `PauseActivityExecutionRequest`. + description: Deprecated. Use `PauseActivityExecutionResponse`. PauseInfo_Manual: type: object properties: @@ -12728,12 +12728,12 @@ components: workflowId: type: string description: |- - If provided, pause a workflow activity (or activities) for the given workflow ID. + If provided, targets a workflow activity for the given workflow ID. If empty, target a standalone activity. activityId: type: string description: |- - Pause an activity with this ID. Must be provided for a standalone activity. + The ID of the activity to target. Must be provided for a standalone activity. Mutually exclusive with workflow_activity_type. runId: type: string @@ -15053,12 +15053,12 @@ components: workflowId: type: string description: |- - If provided, pause a workflow activity (or activities) for the given workflow ID. + If provided, targets a workflow activity for the given workflow ID. If empty, target a standalone activity. activityId: type: string description: |- - Pause an activity with this ID. Must be provided for a standalone activity. + The ID of the activity to target. Must be provided for a standalone activity. Mutually exclusive with workflow_activity_type. runId: type: string @@ -15074,7 +15074,11 @@ components: description: Providing this flag will also reset the heartbeat details. reason: type: string - description: Reason to pause the activity. + description: Reason to unpause the activity. + jitter: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: If set, the activity will start at a random time within the specified jitter duration. UnpauseActivityExecutionResponse: type: object properties: {} @@ -15147,12 +15151,12 @@ components: workflowId: type: string description: |- - If provided, pause a workflow activity (or activities) for the given workflow ID. + If provided, targets a workflow activity for the given workflow ID. If empty, target a standalone activity. activityId: type: string description: |- - Pause an activity with this ID. Must be provided for a standalone activity. + The ID of the activity to target. Must be provided for a standalone activity. Mutually exclusive with workflow_activity_type. runId: type: string diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 92891179d..63dcff35a 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2010,10 +2010,10 @@ message UpdateActivityExecutionOptionsRequest { // Namespace of the workflow which scheduled this activity string namespace = 1; - // If provided, pause a workflow activity (or activities) for the given workflow ID. + // If provided, targets a workflow activity for the given workflow ID. // If empty, target a standalone activity. string workflow_id = 2; - // Pause an activity with this ID. Must be provided for a standalone activity. + // The ID of the activity to target. Must be provided for a standalone activity. // Mutually exclusive with workflow_activity_type. string activity_id = 3; // Run ID of the workflow or standalone activity. @@ -2089,7 +2089,7 @@ message PauseActivityExecutionRequest { string reason = 6; } -// Deprecated. Use `PauseActivityExecutionRequest`. +// Deprecated. Use `PauseActivityExecutionResponse`. message PauseActivityResponse { } @@ -2129,10 +2129,10 @@ message UnpauseActivityExecutionRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; - // If provided, pause a workflow activity (or activities) for the given workflow ID. + // If provided, targets a workflow activity for the given workflow ID. // If empty, target a standalone activity. string workflow_id = 2; - // Pause an activity with this ID. Must be provided for a standalone activity. + // The ID of the activity to target. Must be provided for a standalone activity. // Mutually exclusive with workflow_activity_type. string activity_id = 3; // Run ID of the workflow or standalone activity. @@ -2142,13 +2142,16 @@ message UnpauseActivityExecutionRequest { string identity = 5; // Providing this flag will also reset the number of attempts. - bool reset_attempts = 7; + bool reset_attempts = 6; // Providing this flag will also reset the heartbeat details. - bool reset_heartbeat = 8; + bool reset_heartbeat = 7; - // Reason to pause the activity. - string reason = 9; + // Reason to unpause the activity. + string reason = 8; + + // If set, the activity will start at a random time within the specified jitter duration. + google.protobuf.Duration jitter = 9; } message UnpauseActivityResponse { @@ -2198,11 +2201,11 @@ message ResetActivityRequest { message ResetActivityExecutionRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; - - // If provided, pause a workflow activity (or activities) for the given workflow ID. + + // If provided, targets a workflow activity for the given workflow ID. // If empty, target a standalone activity. string workflow_id = 2; - // Pause an activity with this ID. Must be provided for a standalone activity. + // The ID of the activity to target. Must be provided for a standalone activity. // Mutually exclusive with workflow_activity_type. string activity_id = 3; // Run ID of the workflow or standalone activity. diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 891ce1712..17ea2a735 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1703,16 +1703,16 @@ service WorkflowService { // Returns a `NotFound` error if there is no pending activity with the provided ID rpc PauseActivityExecution (PauseActivityExecutionRequest) returns (PauseActivityExecutionResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activity/{activity_id}/pause" + post: "/namespaces/{namespace}/activities/{activity_id}/pause" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activity/{activity_id}/pause" + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/pause" body: "*" } }; option (temporal.api.protometa.v1.request_header) = { header: "temporal-resource-id" - value: "workflow:{execution.workflow_id}" + value: "workflow:{workflow_id}" }; } @@ -1744,7 +1744,7 @@ service WorkflowService { }; option (temporal.api.protometa.v1.request_header) = { header: "temporal-resource-id" - value: "workflow:{execution.workflow_id}" + value: "workflow:{workflow_id}" }; } @@ -1763,16 +1763,16 @@ service WorkflowService { // Returns a `NotFound` error if there is no pending activity with the provided ID rpc UnpauseActivityExecution (UnpauseActivityExecutionRequest) returns (UnpauseActivityExecutionResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activity/{activity_id}/unpause" + post: "/namespaces/{namespace}/activities/{activity_id}/unpause" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activity/{activity_id}/unpause" + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/unpause" body: "*" } }; option (temporal.api.protometa.v1.request_header) = { header: "temporal-resource-id" - value: "workflow:{execution.workflow_id}" + value: "workflow:{workflow_id}" }; } @@ -1789,7 +1789,7 @@ service WorkflowService { }; option (temporal.api.protometa.v1.request_header) = { header: "temporal-resource-id" - value: "workflow:{execution.workflow_id}" + value: "workflow:{workflow_id}" }; } } From 9d4e40117eb7ffbad8f444cfc3d0e6fbe5fe3fe3 Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Wed, 25 Mar 2026 10:41:13 -0600 Subject: [PATCH 07/11] missing workflow http endpoint, fix header --- openapi/openapiv2.json | 454 ++++++++++++++++- openapi/openapiv3.yaml | 480 ++++++++++++++++++ temporal/api/workflowservice/v1/service.proto | 48 +- 3 files changed, 962 insertions(+), 20 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 4f4a37fcb..6c2cc611e 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -4110,6 +4110,116 @@ ] } }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { + "post": { + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution4", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { + "post": { + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution4", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ResetActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { "post": { "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", @@ -4164,6 +4274,115 @@ ] } }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause": { + "post": { + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution4", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options": { + "post": { + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions4", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/workflows/{workflowId}/pause": { "post": { "summary": "Note: This is an experimental API and the behavior may change in a future release.\nPauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in\n- The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history\n- No new workflow tasks or activity tasks are dispatched.\n - Any workflow task currently executing on the worker will be allowed to complete.\n - Any activity task currently executing will be paused.\n- All server-side events will continue to be processed by the server.\n- Queries & Updates on a paused workflow will be rejected.", @@ -8801,6 +9020,116 @@ ] } }, + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { + "post": { + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution3", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { + "post": { + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution3", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ResetActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { "post": { "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", @@ -8855,6 +9184,115 @@ ] } }, + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause": { + "post": { + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution3", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options": { + "post": { + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions3", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/workflows/{workflowId}/pause": { "post": { "summary": "Note: This is an experimental API and the behavior may change in a future release.\nPauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in\n- The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history\n- No new workflow tasks or activity tasks are dispatched.\n - Any workflow task currently executing on the worker will be allowed to complete.\n - Any activity task currently executing will be paused.\n- All server-side events will continue to be processed by the server.\n- Queries & Updates on a paused workflow will be rejected.", @@ -9617,10 +10055,6 @@ "WorkflowServicePauseActivityExecutionBody": { "type": "object", "properties": { - "workflowId": { - "type": "string", - "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity." - }, "runId": { "type": "string", "description": "Run ID of the workflow or standalone activity." @@ -9856,10 +10290,6 @@ "WorkflowServiceResetActivityExecutionBody": { "type": "object", "properties": { - "workflowId": { - "type": "string", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity." - }, "runId": { "type": "string", "description": "Run ID of the workflow or standalone activity." @@ -10732,10 +11162,6 @@ "WorkflowServiceUnpauseActivityExecutionBody": { "type": "object", "properties": { - "workflowId": { - "type": "string", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity." - }, "runId": { "type": "string", "description": "Run ID of the workflow or standalone activity." @@ -10786,10 +11212,6 @@ "WorkflowServiceUpdateActivityExecutionOptionsBody": { "type": "object", "properties": { - "workflowId": { - "type": "string", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity." - }, "runId": { "type": "string", "description": "Run ID of the workflow or standalone activity." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index d8b88c73f..bd820e9b6 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -3457,6 +3457,135 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: + post: + tags: + - WorkflowService + description: |- + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity + + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + - The activity should respond to the cancellation accordingly. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: workflowId + in: path + description: |- + If provided, pause a workflow activity (or activities) for the given workflow ID. + If empty, target a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: + post: + tags: + - WorkflowService + description: |- + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag), + + Flags: + + 'jitter': the activity will be scheduled at a random time within the jitter duration. + If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided. + 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset. + 'keep_paused': if the activity is paused, it will remain paused. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: workflowId + in: path + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: post: tags: @@ -3506,6 +3635,117 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Flags: + 'jitter': the activity will be scheduled at a random time within the jitter duration. + 'reset_attempts': the number of attempts will be reset. + 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: workflowId + in: path + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options: + post: + tags: + - WorkflowService + description: |- + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workflows/{workflowId}/pause: post: tags: @@ -7698,6 +7938,135 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: + post: + tags: + - WorkflowService + description: |- + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity + + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + - The activity should respond to the cancellation accordingly. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: workflowId + in: path + description: |- + If provided, pause a workflow activity (or activities) for the given workflow ID. + If empty, target a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: + post: + tags: + - WorkflowService + description: |- + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag), + + Flags: + + 'jitter': the activity will be scheduled at a random time within the jitter duration. + If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided. + 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset. + 'keep_paused': if the activity is paused, it will remain paused. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: workflowId + in: path + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: post: tags: @@ -7747,6 +8116,117 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Flags: + 'jitter': the activity will be scheduled at a random time within the jitter duration. + 'reset_attempts': the number of attempts will be reset. + 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: workflowId + in: path + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options: + post: + tags: + - WorkflowService + description: |- + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/workflows/{workflowId}/pause: post: tags: diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 17ea2a735..663ed2a99 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1703,16 +1703,26 @@ service WorkflowService { // Returns a `NotFound` error if there is no pending activity with the provided ID rpc PauseActivityExecution (PauseActivityExecutionRequest) returns (PauseActivityExecutionResponse) { option (google.api.http) = { + // Standalone activity post: "/namespaces/{namespace}/activities/{activity_id}/pause" body: "*" additional_bindings { post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/pause" body: "*" } + // Workflow activity + additional_bindings { + 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: "*" + } }; option (temporal.api.protometa.v1.request_header) = { header: "temporal-resource-id" - value: "workflow:{workflow_id}" + value: "{resource_id}" }; } @@ -1735,16 +1745,26 @@ service WorkflowService { // Returns a `NotFound` error if there is no pending activity with the provided ID or type. rpc ResetActivityExecution (ResetActivityExecutionRequest) returns (ResetActivityExecutionResponse) { option (google.api.http) = { + // Standalone activity post: "/namespaces/{namespace}/activities/{activity_id}/reset" body: "*" additional_bindings { post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/reset" body: "*" } + // Workflow activity + additional_bindings { + 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: "*" + } }; option (temporal.api.protometa.v1.request_header) = { header: "temporal-resource-id" - value: "workflow:{workflow_id}" + value: "{resource_id}" }; } @@ -1763,16 +1783,26 @@ service WorkflowService { // Returns a `NotFound` error if there is no pending activity with the provided ID rpc UnpauseActivityExecution (UnpauseActivityExecutionRequest) returns (UnpauseActivityExecutionResponse) { option (google.api.http) = { + // Standalone activity post: "/namespaces/{namespace}/activities/{activity_id}/unpause" body: "*" additional_bindings { post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/unpause" body: "*" } + // Workflow activity + additional_bindings { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/unpause" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/unpause" + body: "*" + } }; option (temporal.api.protometa.v1.request_header) = { header: "temporal-resource-id" - value: "workflow:{workflow_id}" + value: "{resource_id}" }; } @@ -1780,16 +1810,26 @@ service WorkflowService { // This API can be used to target a workflow activity or a standalone activity. rpc UpdateActivityExecutionOptions (UpdateActivityExecutionOptionsRequest) returns (UpdateActivityExecutionOptionsResponse) { option (google.api.http) = { + // Standalone activity post: "/namespaces/{namespace}/activities/{activity_id}/update-options" body: "*" additional_bindings { post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/update-options" body: "*" } + // Workflow activity + additional_bindings { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/update-options" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/update-options" + body: "*" + } }; option (temporal.api.protometa.v1.request_header) = { header: "temporal-resource-id" - value: "workflow:{workflow_id}" + value: "{resource_id}" }; } } From 108da5c88a829d0713414d513077304a424d495d Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Wed, 25 Mar 2026 11:37:55 -0600 Subject: [PATCH 08/11] remove batch related comment --- openapi/openapiv2.json | 6 ++---- openapi/openapiv3.yaml | 2 -- temporal/api/workflowservice/v1/request_response.proto | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 6c2cc611e..85f75a05d 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10314,8 +10314,7 @@ "type": "boolean", "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event." } - }, - "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities" + } }, "WorkflowServiceResetWorkflowExecutionBody": { "type": "object", @@ -11232,8 +11231,7 @@ "type": "boolean", "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." } - }, - "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions" + } }, "WorkflowServiceUpdateActivityOptionsBody": { "type": "object", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index bd820e9b6..52e7b6438 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -13241,7 +13241,6 @@ components: If set, the activity options will be restored to the defaults. Default options are then options activity was created with. They are part of the first SCHEDULE event. - description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities' ResetActivityExecutionResponse: type: object properties: {} @@ -15660,7 +15659,6 @@ components: They are part of the first SCHEDULE event. This flag cannot be combined with any other option; if you supply restore_original together with other options, the request will be rejected. - description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions' UpdateActivityExecutionOptionsResponse: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 63dcff35a..eb0a6e92a 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2005,7 +2005,6 @@ message UpdateActivityOptionsRequest { bool restore_original = 8; } -// NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions message UpdateActivityExecutionOptionsRequest { // Namespace of the workflow which scheduled this activity string namespace = 1; @@ -2197,7 +2196,6 @@ message ResetActivityRequest { bool restore_original_options = 9; } -// NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities message ResetActivityExecutionRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; From 9126f27c75cf0d31cf100f6c36b1afeb1ea8b5dc Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Wed, 25 Mar 2026 13:52:56 -0600 Subject: [PATCH 09/11] add deprecation notices --- openapi/openapiv2.json | 16 ++++++++++------ openapi/openapiv3.yaml | 12 ++++++++++-- .../workflowservice/v1/request_response.proto | 6 ++++++ 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 85f75a05d..27e686d2e 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10285,7 +10285,7 @@ "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event." } }, - "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities" + "description": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities\nDeprecated. Use `ResetActivityExecutionRequest`." }, "WorkflowServiceResetActivityExecutionBody": { "type": "object", @@ -11156,7 +11156,8 @@ "type": "string", "description": "If set, the activity will start at a random time within the specified jitter duration." } - } + }, + "description": "Deprecated. Use `UnpauseActivityExecutionRequest`." }, "WorkflowServiceUnpauseActivityExecutionBody": { "type": "object", @@ -11269,7 +11270,7 @@ "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." } }, - "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions" + "description": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions\nDeprecated. Use `UpdateActivityExecutionOptionsRequest`." }, "WorkflowServiceUpdateNamespaceBody": { "type": "object", @@ -15914,7 +15915,8 @@ "type": "object" }, "v1ResetActivityResponse": { - "type": "object" + "type": "object", + "description": "Deprecated. Use `ResetActivityExecutionRequest`." }, "v1ResetOptions": { "type": "object", @@ -17334,7 +17336,8 @@ "type": "object" }, "v1UnpauseActivityResponse": { - "type": "object" + "type": "object", + "description": "Deprecated. Use `UnpauseActivityExecutionResponse`." }, "v1UnpauseWorkflowExecutionResponse": { "type": "object", @@ -17356,7 +17359,8 @@ "$ref": "#/definitions/v1ActivityOptions", "title": "Activity options after an update" } - } + }, + "description": "Deprecated. Use `UpdateActivityExecutionOptionsResponse`." }, "v1UpdateAdmittedEventOrigin": { "type": "string", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 52e7b6438..5f5c87e1e 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -13286,10 +13286,13 @@ components: If set, the activity options will be restored to the defaults. Default options are then options activity was created with. They are part of the first SCHEDULE event. - description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities' + description: |- + NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities + Deprecated. Use `ResetActivityExecutionRequest`. ResetActivityResponse: type: object properties: {} + description: Deprecated. Use `ResetActivityExecutionRequest`. ResetOptions: type: object properties: @@ -15593,9 +15596,11 @@ components: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: If set, the activity will start at a random time within the specified jitter duration. + description: Deprecated. Use `UnpauseActivityExecutionRequest`. UnpauseActivityResponse: type: object properties: {} + description: Deprecated. Use `UnpauseActivityExecutionResponse`. UnpauseWorkflowExecutionRequest: type: object properties: @@ -15704,7 +15709,9 @@ components: They are part of the first SCHEDULE event. This flag cannot be combined with any other option; if you supply restore_original together with other options, the request will be rejected. - description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions' + description: |- + NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions + Deprecated. Use `UpdateActivityExecutionOptionsRequest`. UpdateActivityOptionsResponse: type: object properties: @@ -15712,6 +15719,7 @@ components: allOf: - $ref: '#/components/schemas/ActivityOptions' description: Activity options after an update + description: Deprecated. Use `UpdateActivityExecutionOptionsResponse`. UpdateDeploymentMetadata: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index eb0a6e92a..bae5ed54d 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1972,6 +1972,7 @@ message ExecuteMultiOperationResponse { } // NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions +// Deprecated. Use `UpdateActivityExecutionOptionsRequest`. message UpdateActivityOptionsRequest { // Namespace of the workflow which scheduled this activity string namespace = 1; @@ -2035,6 +2036,7 @@ message UpdateActivityExecutionOptionsRequest { bool restore_original = 8; } +// Deprecated. Use `UpdateActivityExecutionOptionsResponse`. message UpdateActivityOptionsResponse { // Activity options after an update temporal.api.activity.v1.ActivityOptions activity_options = 1; @@ -2095,6 +2097,7 @@ message PauseActivityResponse { message PauseActivityExecutionResponse { } +// Deprecated. Use `UnpauseActivityExecutionRequest`. message UnpauseActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -2153,6 +2156,7 @@ message UnpauseActivityExecutionRequest { google.protobuf.Duration jitter = 9; } +// Deprecated. Use `UnpauseActivityExecutionResponse`. message UnpauseActivityResponse { } @@ -2160,6 +2164,7 @@ message UnpauseActivityExecutionResponse { } // NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities +// Deprecated. Use `ResetActivityExecutionRequest`. message ResetActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -2229,6 +2234,7 @@ message ResetActivityExecutionRequest { bool restore_original_options = 9; } +// Deprecated. Use `ResetActivityExecutionRequest`. message ResetActivityResponse { } From 5c130f0c7bfa128138ff7f6f81081af0aa11f6cc Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Wed, 25 Mar 2026 19:27:26 -0600 Subject: [PATCH 10/11] add resource id to requests --- openapi/openapiv2.json | 16 ++++++++++++++++ openapi/openapiv3.yaml | 12 ++++++++++++ .../workflowservice/v1/request_response.proto | 12 ++++++++++++ 3 files changed, 40 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 27e686d2e..26843d743 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10066,6 +10066,10 @@ "reason": { "type": "string", "description": "Reason to pause the activity." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." } } }, @@ -10313,6 +10317,10 @@ "restoreOriginalOptions": { "type": "boolean", "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." } } }, @@ -11185,6 +11193,10 @@ "jitter": { "type": "string", "description": "If set, the activity will start at a random time within the specified jitter duration." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." } } }, @@ -11231,6 +11243,10 @@ "restoreOriginal": { "type": "boolean", "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 5f5c87e1e..ba5f23a72 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -12112,6 +12112,9 @@ components: reason: type: string description: Reason to pause the activity. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. PauseActivityExecutionResponse: type: object properties: {} @@ -13241,6 +13244,9 @@ components: If set, the activity options will be restored to the defaults. Default options are then options activity was created with. They are part of the first SCHEDULE event. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. ResetActivityExecutionResponse: type: object properties: {} @@ -15561,6 +15567,9 @@ components: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: If set, the activity will start at a random time within the specified jitter duration. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. UnpauseActivityExecutionResponse: type: object properties: {} @@ -15664,6 +15673,9 @@ components: They are part of the first SCHEDULE event. This flag cannot be combined with any other option; if you supply restore_original together with other options, the request will be rejected. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. UpdateActivityExecutionOptionsResponse: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index bae5ed54d..9e573ff29 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2034,6 +2034,9 @@ message UpdateActivityExecutionOptionsRequest { // This flag cannot be combined with any other option; if you supply // restore_original together with other options, the request will be rejected. bool restore_original = 8; + + // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + string resource_id = 9; } // Deprecated. Use `UpdateActivityExecutionOptionsResponse`. @@ -2088,6 +2091,9 @@ message PauseActivityExecutionRequest { // Reason to pause the activity. string reason = 6; + + // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + string resource_id = 7; } // Deprecated. Use `PauseActivityExecutionResponse`. @@ -2154,6 +2160,9 @@ message UnpauseActivityExecutionRequest { // If set, the activity will start at a random time within the specified jitter duration. google.protobuf.Duration jitter = 9; + + // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + string resource_id = 10; } // Deprecated. Use `UnpauseActivityExecutionResponse`. @@ -2232,6 +2241,9 @@ message ResetActivityExecutionRequest { // Default options are then options activity was created with. // They are part of the first SCHEDULE event. bool restore_original_options = 9; + + // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + string resource_id = 10; } // Deprecated. Use `ResetActivityExecutionRequest`. From dbacbd9decdc9c8c67b2282fe45844295abbe67c Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Fri, 10 Apr 2026 16:55:35 -0600 Subject: [PATCH 11/11] addressing dans comments --- openapi/openapiv2.json | 272 +++++++++--------- openapi/openapiv3.yaml | 104 +++---- .../workflowservice/v1/request_response.proto | 20 +- 3 files changed, 176 insertions(+), 220 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 32a59ef69..4b1edee80 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -745,7 +745,7 @@ }, { "name": "activityId", - "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -793,7 +793,7 @@ }, { "name": "activityId", - "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -934,7 +934,7 @@ }, { "name": "activityId", - "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -981,7 +981,7 @@ }, { "name": "activityId", - "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -4337,14 +4337,14 @@ }, { "name": "workflowId", - "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity.", + "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -4392,14 +4392,14 @@ }, { "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -4501,14 +4501,14 @@ }, { "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -4555,14 +4555,14 @@ }, { "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -5923,7 +5923,7 @@ }, { "name": "activityId", - "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -5971,7 +5971,7 @@ }, { "name": "activityId", - "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -6112,7 +6112,7 @@ }, { "name": "activityId", - "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -6159,7 +6159,7 @@ }, { "name": "activityId", - "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -9445,14 +9445,14 @@ }, { "name": "workflowId", - "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity.", + "description": "If provided, pause a workflow activity (or activities) for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -9500,14 +9500,14 @@ }, { "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -9609,14 +9609,14 @@ }, { "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -9663,14 +9663,14 @@ }, { "name": "workflowId", - "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, targets a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -10150,7 +10150,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1Link" + "$ref": "#/definitions/apiCommonV1Link" }, "description": "Links to be associated with the WorkflowExecutionSignaled event." } @@ -12098,7 +12098,7 @@ "description": "The time when the last attempt completed." }, "lastAttemptFailure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "The last attempt's failure, if any." }, "nextAttemptScheduleTime": { @@ -12113,6 +12113,85 @@ }, "description": "Common callback information. Specific CallbackInfo messages should embed this and may include additional fields." }, + "apiCommonV1Link": { + "type": "object", + "properties": { + "workflowEvent": { + "$ref": "#/definitions/LinkWorkflowEvent" + }, + "batchJob": { + "$ref": "#/definitions/LinkBatchJob" + }, + "activity": { + "$ref": "#/definitions/LinkActivity" + } + }, + "description": "Link can be associated with history events. It might contain information about an external entity\nrelated to the history event. For example, workflow A makes a Nexus call that starts workflow B:\nin this case, a history event in workflow A could contain a Link to the workflow started event in\nworkflow B, and vice-versa." + }, + "apiFailureV1Failure": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "source": { + "type": "string", + "description": "The source this Failure originated in, e.g. TypeScriptSDK / JavaSDK\nIn some SDKs this is used to rehydrate the stack trace into an exception object." + }, + "stackTrace": { + "type": "string" + }, + "encodedAttributes": { + "$ref": "#/definitions/v1Payload", + "description": "Alternative way to supply `message` and `stack_trace` and possibly other attributes, used for encryption of\nerrors originating in user code which might contain sensitive information.\nThe `encoded_attributes` Payload could represent any serializable object, e.g. JSON object or a `Failure` proto\nmessage.\n\nSDK authors:\n- The SDK should provide a default `encodeFailureAttributes` and `decodeFailureAttributes` implementation that:\n - Uses a JSON object to represent `{ message, stack_trace }`.\n - Overwrites the original message with \"Encoded failure\" to indicate that more information could be extracted.\n - Overwrites the original stack_trace with an empty string.\n - The resulting JSON object is converted to Payload using the default PayloadConverter and should be processed\n by the user-provided PayloadCodec\n\n- If there's demand, we could allow overriding the default SDK implementation to encode other opaque Failure attributes." + }, + "cause": { + "$ref": "#/definitions/apiFailureV1Failure" + }, + "applicationFailureInfo": { + "$ref": "#/definitions/v1ApplicationFailureInfo" + }, + "timeoutFailureInfo": { + "$ref": "#/definitions/v1TimeoutFailureInfo" + }, + "canceledFailureInfo": { + "$ref": "#/definitions/v1CanceledFailureInfo" + }, + "terminatedFailureInfo": { + "$ref": "#/definitions/v1TerminatedFailureInfo" + }, + "serverFailureInfo": { + "$ref": "#/definitions/v1ServerFailureInfo" + }, + "resetWorkflowFailureInfo": { + "$ref": "#/definitions/v1ResetWorkflowFailureInfo" + }, + "activityFailureInfo": { + "$ref": "#/definitions/v1ActivityFailureInfo" + }, + "childWorkflowExecutionFailureInfo": { + "$ref": "#/definitions/v1ChildWorkflowExecutionFailureInfo" + }, + "nexusOperationExecutionFailureInfo": { + "$ref": "#/definitions/v1NexusOperationFailureInfo" + }, + "nexusHandlerFailureInfo": { + "$ref": "#/definitions/v1NexusHandlerFailureInfo" + } + } + }, + "apiUpdateV1Request": { + "type": "object", + "properties": { + "meta": { + "$ref": "#/definitions/v1Meta" + }, + "input": { + "$ref": "#/definitions/v1Input" + } + }, + "description": "The client request that triggers a Workflow Update." + }, "apiWorkflowV1CallbackInfo": { "type": "object", "properties": { @@ -12143,7 +12222,7 @@ "description": "The time when the last attempt completed." }, "lastAttemptFailure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "The last attempt's failure, if any." }, "nextAttemptScheduleTime": { @@ -12280,7 +12359,7 @@ "description": "Time when the activity transitioned to a closed state." }, "lastFailure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "Failure details from the last failed attempt." }, "lastWorkerIdentity": { @@ -12336,7 +12415,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1Link" + "$ref": "#/definitions/apiCommonV1Link" }, "description": "Links to related entities, such as the entity that started this activity." } @@ -12405,7 +12484,7 @@ "description": "The result if the activity completed successfully." }, "failure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "The failure if the activity completed unsuccessfully." } }, @@ -12595,7 +12674,7 @@ "type": "object", "properties": { "failure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "title": "Failure details" }, "scheduledEventId": { @@ -12697,7 +12776,7 @@ "title": "Starting at 1, the number of times this task has been attempted" }, "lastFailure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "Will be set to the most recent failure details, if this task has previously failed and then\nbeen retried." }, "workerVersion": { @@ -12715,7 +12794,7 @@ "type": "object", "properties": { "failure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "If this activity had failed, was retried, and then timed out, that failure is stored as the\n`cause` in here." }, "scheduledEventId": { @@ -13175,7 +13254,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1Link" + "$ref": "#/definitions/apiCommonV1Link" }, "description": "Links associated with the callback. It can be used to link to underlying resources of the\ncallback." } @@ -13283,7 +13362,7 @@ "type": "object", "properties": { "failure": { - "$ref": "#/definitions/v1Failure" + "$ref": "#/definitions/apiFailureV1Failure" }, "namespace": { "type": "string", @@ -14379,58 +14458,6 @@ }, "title": "Represents a historical replication status of a Namespace" }, - "v1Failure": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "source": { - "type": "string", - "description": "The source this Failure originated in, e.g. TypeScriptSDK / JavaSDK\nIn some SDKs this is used to rehydrate the stack trace into an exception object." - }, - "stackTrace": { - "type": "string" - }, - "encodedAttributes": { - "$ref": "#/definitions/v1Payload", - "description": "Alternative way to supply `message` and `stack_trace` and possibly other attributes, used for encryption of\nerrors originating in user code which might contain sensitive information.\nThe `encoded_attributes` Payload could represent any serializable object, e.g. JSON object or a `Failure` proto\nmessage.\n\nSDK authors:\n- The SDK should provide a default `encodeFailureAttributes` and `decodeFailureAttributes` implementation that:\n - Uses a JSON object to represent `{ message, stack_trace }`.\n - Overwrites the original message with \"Encoded failure\" to indicate that more information could be extracted.\n - Overwrites the original stack_trace with an empty string.\n - The resulting JSON object is converted to Payload using the default PayloadConverter and should be processed\n by the user-provided PayloadCodec\n\n- If there's demand, we could allow overriding the default SDK implementation to encode other opaque Failure attributes." - }, - "cause": { - "$ref": "#/definitions/v1Failure" - }, - "applicationFailureInfo": { - "$ref": "#/definitions/v1ApplicationFailureInfo" - }, - "timeoutFailureInfo": { - "$ref": "#/definitions/v1TimeoutFailureInfo" - }, - "canceledFailureInfo": { - "$ref": "#/definitions/v1CanceledFailureInfo" - }, - "terminatedFailureInfo": { - "$ref": "#/definitions/v1TerminatedFailureInfo" - }, - "serverFailureInfo": { - "$ref": "#/definitions/v1ServerFailureInfo" - }, - "resetWorkflowFailureInfo": { - "$ref": "#/definitions/v1ResetWorkflowFailureInfo" - }, - "activityFailureInfo": { - "$ref": "#/definitions/v1ActivityFailureInfo" - }, - "childWorkflowExecutionFailureInfo": { - "$ref": "#/definitions/v1ChildWorkflowExecutionFailureInfo" - }, - "nexusOperationExecutionFailureInfo": { - "$ref": "#/definitions/v1NexusOperationFailureInfo" - }, - "nexusHandlerFailureInfo": { - "$ref": "#/definitions/v1NexusHandlerFailureInfo" - } - } - }, "v1FetchWorkerConfigResponse": { "type": "object", "properties": { @@ -14735,7 +14762,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1Link" + "$ref": "#/definitions/apiCommonV1Link" }, "description": "Links to related entities, such as the entity that started this event's workflow." }, @@ -14997,21 +15024,6 @@ }, "description": "IntervalSpec matches times that can be expressed as:\nepoch + n * interval + phase\nwhere n is an integer.\nphase defaults to zero if missing. interval is required.\nBoth interval and phase must be non-negative and are truncated to the nearest\nsecond before any calculations.\nFor example, an interval of 1 hour with phase of zero would match every hour,\non the hour. The same interval but a phase of 19 minutes would match every\nxx:19:00. An interval of 28 days with phase zero would match\n2022-02-17T00:00:00Z (among other times). The same interval with a phase of 3\ndays, 5 hours, and 23 minutes would match 2022-02-20T05:23:00Z instead." }, - "v1Link": { - "type": "object", - "properties": { - "workflowEvent": { - "$ref": "#/definitions/LinkWorkflowEvent" - }, - "batchJob": { - "$ref": "#/definitions/LinkBatchJob" - }, - "activity": { - "$ref": "#/definitions/LinkActivity" - } - }, - "description": "Link can be associated with history events. It might contain information about an external entity\nrelated to the history event. For example, workflow A makes a Nexus call that starts workflow B:\nin this case, a history event in workflow A could contain a Link to the workflow started event in\nworkflow B, and vice-versa." - }, "v1ListActivityExecutionsResponse": { "type": "object", "properties": { @@ -15264,7 +15276,7 @@ "$ref": "#/definitions/v1Header" }, "failure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "Some uses of markers, like a local activity, could \"fail\". If they did that is recorded here." } } @@ -15602,7 +15614,7 @@ "description": "The `WORKFLOW_TASK_COMPLETED` event that the corresponding RequestCancelNexusOperation command was reported\nwith." }, "failure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "Failure details. A NexusOperationFailureInfo wrapping a CanceledFailureInfo." }, "scheduledEventId": { @@ -15636,7 +15648,7 @@ "description": "The ID of the `NEXUS_OPERATION_SCHEDULED` event. Uniquely identifies this operation." }, "failure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "Cancellation details." }, "requestId": { @@ -15668,7 +15680,7 @@ "description": "The time when the last attempt completed." }, "lastAttemptFailure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "The last attempt's failure, if any." }, "nextAttemptScheduleTime": { @@ -15725,7 +15737,7 @@ "description": "The ID of the `NEXUS_OPERATION_SCHEDULED` event. Uniquely identifies this operation." }, "failure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "Failure details. A NexusOperationFailureInfo wrapping an ApplicationFailureInfo." }, "requestId": { @@ -15852,7 +15864,7 @@ "description": "The ID of the `NEXUS_OPERATION_SCHEDULED` event. Uniquely identifies this operation." }, "failure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "Failure details. A NexusOperationFailureInfo wrapping a CanceledFailureInfo." }, "requestId": { @@ -15887,7 +15899,7 @@ "$ref": "#/definitions/v1Payloads" }, "failure": { - "$ref": "#/definitions/v1Failure" + "$ref": "#/definitions/apiFailureV1Failure" } }, "description": "The outcome of a Workflow Update: success or failure." @@ -15974,7 +15986,7 @@ "format": "date-time" }, "lastFailure": { - "$ref": "#/definitions/v1Failure" + "$ref": "#/definitions/apiFailureV1Failure" }, "lastWorkerIdentity": { "type": "string" @@ -16112,7 +16124,7 @@ "description": "The time when the last attempt completed." }, "lastAttemptFailure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "The last attempt's failure, if any." }, "nextAttemptScheduleTime": { @@ -16593,18 +16605,6 @@ ], "default": "REPLICATION_STATE_UNSPECIFIED" }, - "v1Request": { - "type": "object", - "properties": { - "meta": { - "$ref": "#/definitions/v1Meta" - }, - "input": { - "$ref": "#/definitions/v1Input" - } - }, - "description": "The client request that triggers a Workflow Update." - }, "v1RequestCancelActivityExecutionResponse": { "type": "object" }, @@ -16857,7 +16857,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1Failure" + "$ref": "#/definitions/apiFailureV1Failure" }, "title": "Server validation failures could include\nlast_heartbeat_details payload is too large, request failure is too large" } @@ -16870,7 +16870,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1Failure" + "$ref": "#/definitions/apiFailureV1Failure" }, "title": "Server validation failures could include\nlast_heartbeat_details payload is too large, request failure is too large" } @@ -17508,7 +17508,7 @@ "description": "If true, a new activity was started." }, "link": { - "$ref": "#/definitions/v1Link", + "$ref": "#/definitions/apiCommonV1Link", "description": "Link to the started activity." } } @@ -17657,7 +17657,7 @@ "description": "When `request_eager_execution` is set on the `StartWorkflowExecutionRequest`, the server - if supported - will\nreturn the first workflow task to be eagerly executed.\nThe caller is expected to have a worker available to process the task." }, "link": { - "$ref": "#/definitions/v1Link", + "$ref": "#/definitions/apiCommonV1Link", "description": "Link to the workflow event." } } @@ -19115,7 +19115,7 @@ "$ref": "#/definitions/v1ContinueAsNewInitiator" }, "failure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "Deprecated. If a workflow's retry policy would cause a new run to start when the current one\nhas failed, this field would be populated with that failure. Now (when supported by server\nand sdk) the final event will be `WORKFLOW_EXECUTION_FAILED` with `new_execution_run_id` set." }, "lastCompletionResult": { @@ -19190,7 +19190,7 @@ "type": "object", "properties": { "failure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "title": "Serialized result of workflow failure (ex: An exception thrown, or error returned)" }, "retryState": { @@ -19479,7 +19479,7 @@ "$ref": "#/definitions/v1ContinueAsNewInitiator" }, "continuedFailure": { - "$ref": "#/definitions/v1Failure" + "$ref": "#/definitions/apiFailureV1Failure" }, "lastCompletionResult": { "$ref": "#/definitions/v1Payloads" @@ -19688,7 +19688,7 @@ "description": "The event ID used to sequence the original request message." }, "acceptedRequest": { - "$ref": "#/definitions/v1Request", + "$ref": "#/definitions/apiUpdateV1Request", "description": "The message payload of the original request message that initiated this\nupdate." } } @@ -19697,7 +19697,7 @@ "type": "object", "properties": { "request": { - "$ref": "#/definitions/v1Request", + "$ref": "#/definitions/apiUpdateV1Request", "description": "The update request associated with this event." }, "origin": { @@ -19741,11 +19741,11 @@ "description": "The event ID used to sequence the original request message." }, "rejectedRequest": { - "$ref": "#/definitions/v1Request", + "$ref": "#/definitions/apiUpdateV1Request", "description": "The message payload of the original request message that initiated this\nupdate." }, "failure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "description": "The cause of rejection." } } @@ -20081,7 +20081,7 @@ "$ref": "#/definitions/v1WorkflowTaskFailedCause" }, "failure": { - "$ref": "#/definitions/v1Failure", + "$ref": "#/definitions/apiFailureV1Failure", "title": "The failure details" }, "identity": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index f34bf0b23..c678d4a7b 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -692,9 +692,7 @@ paths: type: string - name: activityId in: path - description: |- - Pause an activity with this ID. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -749,9 +747,7 @@ paths: type: string - name: activityId in: path - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -885,9 +881,7 @@ paths: type: string - name: activityId in: path - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -927,9 +921,7 @@ paths: type: string - name: activityId in: path - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -3658,15 +3650,13 @@ paths: in: path description: |- If provided, pause a workflow activity (or activities) for the given workflow ID. - If empty, target a standalone activity. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: |- - Pause an activity with this ID. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -3723,15 +3713,13 @@ paths: in: path description: |- If provided, targets a workflow activity for the given workflow ID. - If empty, target a standalone activity. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -3833,15 +3821,13 @@ paths: in: path description: |- If provided, targets a workflow activity for the given workflow ID. - If empty, target a standalone activity. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -3883,15 +3869,13 @@ paths: in: path description: |- If provided, targets a workflow activity for the given workflow ID. - If empty, target a standalone activity. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -5399,9 +5383,7 @@ paths: type: string - name: activityId in: path - description: |- - Pause an activity with this ID. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -5456,9 +5438,7 @@ paths: type: string - name: activityId in: path - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -5592,9 +5572,7 @@ paths: type: string - name: activityId in: path - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -5634,9 +5612,7 @@ paths: type: string - name: activityId in: path - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -8307,15 +8283,13 @@ paths: in: path description: |- If provided, pause a workflow activity (or activities) for the given workflow ID. - If empty, target a standalone activity. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: |- - Pause an activity with this ID. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -8372,15 +8346,13 @@ paths: in: path description: |- If provided, targets a workflow activity for the given workflow ID. - If empty, target a standalone activity. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -8482,15 +8454,13 @@ paths: in: path description: |- If provided, targets a workflow activity for the given workflow ID. - If empty, target a standalone activity. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -8532,15 +8502,13 @@ paths: in: path description: |- If provided, targets a workflow activity for the given workflow ID. - If empty, target a standalone activity. + If empty, targets a standalone activity. required: true schema: type: string - name: activityId in: path - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. required: true schema: type: string @@ -12670,12 +12638,10 @@ components: type: string description: |- If provided, pause a workflow activity (or activities) for the given workflow ID. - If empty, target a standalone activity. + If empty, targets a standalone activity. activityId: type: string - description: |- - Pause an activity with this ID. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. runId: type: string description: Run ID of the workflow or standalone activity. @@ -13786,12 +13752,10 @@ components: type: string description: |- If provided, targets a workflow activity for the given workflow ID. - If empty, target a standalone activity. + If empty, targets a standalone activity. activityId: type: string - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. runId: type: string description: Run ID of the workflow or standalone activity. @@ -16183,12 +16147,10 @@ components: type: string description: |- If provided, targets a workflow activity for the given workflow ID. - If empty, target a standalone activity. + If empty, targets a standalone activity. activityId: type: string - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. runId: type: string description: Run ID of the workflow or standalone activity. @@ -16286,12 +16248,10 @@ components: type: string description: |- If provided, targets a workflow activity for the given workflow ID. - If empty, target a standalone activity. + If empty, targets a standalone activity. activityId: type: string - description: |- - The ID of the activity to target. Must be provided for a standalone activity. - Mutually exclusive with workflow_activity_type. + description: The ID of the activity to target. runId: type: string description: Run ID of the workflow or standalone activity. diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 079eb1a1f..54b4ef86b 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2042,10 +2042,9 @@ message UpdateActivityExecutionOptionsRequest { string namespace = 1; // If provided, targets a workflow activity for the given workflow ID. - // If empty, target a standalone activity. + // If empty, targets a standalone activity. string workflow_id = 2; - // The ID of the activity to target. Must be provided for a standalone activity. - // Mutually exclusive with workflow_activity_type. + // The ID of the activity to target. string activity_id = 3; // Run ID of the workflow or standalone activity. string run_id = 4; @@ -2109,10 +2108,9 @@ message PauseActivityExecutionRequest { string namespace = 1; // If provided, pause a workflow activity (or activities) for the given workflow ID. - // If empty, target a standalone activity. + // If empty, targets a standalone activity. string workflow_id = 2; - // Pause an activity with this ID. Must be provided for a standalone activity. - // Mutually exclusive with workflow_activity_type. + // The ID of the activity to target. string activity_id = 3; // Run ID of the workflow or standalone activity. string run_id = 4; @@ -2169,10 +2167,9 @@ message UnpauseActivityExecutionRequest { string namespace = 1; // If provided, targets a workflow activity for the given workflow ID. - // If empty, target a standalone activity. + // If empty, targets a standalone activity. string workflow_id = 2; - // The ID of the activity to target. Must be provided for a standalone activity. - // Mutually exclusive with workflow_activity_type. + // The ID of the activity to target. string activity_id = 3; // Run ID of the workflow or standalone activity. string run_id = 4; @@ -2246,10 +2243,9 @@ message ResetActivityExecutionRequest { string namespace = 1; // If provided, targets a workflow activity for the given workflow ID. - // If empty, target a standalone activity. + // If empty, targets a standalone activity. string workflow_id = 2; - // The ID of the activity to target. Must be provided for a standalone activity. - // Mutually exclusive with workflow_activity_type. + // The ID of the activity to target. string activity_id = 3; // Run ID of the workflow or standalone activity. string run_id = 4;