diff --git a/client/src/raw.rs b/client/src/raw.rs index 95f88c4af..2aedec4dc 100644 --- a/client/src/raw.rs +++ b/client/src/raw.rs @@ -1320,6 +1320,135 @@ proxier! { r.extensions_mut().insert(labels); } ); + ( + describe_worker, + DescribeWorkerRequest, + DescribeWorkerResponse, + |r| { + let labels = namespaced_request!(r); + r.extensions_mut().insert(labels); + } + ); + ( + set_worker_deployment_manager, + SetWorkerDeploymentManagerRequest, + SetWorkerDeploymentManagerResponse, + |r| { + let labels = namespaced_request!(r); + r.extensions_mut().insert(labels); + } + ); + ( + start_activity_execution, + StartActivityExecutionRequest, + StartActivityExecutionResponse, + |r| { + let mut labels = namespaced_request!(r); + if let Some(ref options) = r.get_ref().options { + labels.task_q(options.task_queue.clone()); + } + r.extensions_mut().insert(labels); + } + ); + ( + describe_activity_execution, + DescribeActivityExecutionRequest, + DescribeActivityExecutionResponse, + |r| { + let labels = namespaced_request!(r); + r.extensions_mut().insert(labels); + } + ); + ( + list_activity_executions, + ListActivityExecutionsRequest, + ListActivityExecutionsResponse, + |r| { + let labels = namespaced_request!(r); + r.extensions_mut().insert(labels); + } + ); + ( + count_activity_executions, + CountActivityExecutionsRequest, + CountActivityExecutionsResponse, + |r| { + let labels = namespaced_request!(r); + r.extensions_mut().insert(labels); + } + ); + ( + get_activity_execution_result, + GetActivityExecutionResultRequest, + GetActivityExecutionResultResponse, + |r| { + let labels = namespaced_request!(r); + r.extensions_mut().insert(labels); + } + ); + ( + request_cancel_activity_execution, + RequestCancelActivityExecutionRequest, + RequestCancelActivityExecutionResponse, + |r| { + let labels = namespaced_request!(r); + r.extensions_mut().insert(labels); + } + ); + ( + terminate_activity_execution, + TerminateActivityExecutionRequest, + TerminateActivityExecutionResponse, + |r| { + let labels = namespaced_request!(r); + r.extensions_mut().insert(labels); + } + ); + ( + delete_activity_execution, + DeleteActivityExecutionRequest, + DeleteActivityExecutionResponse, + |r| { + let labels = namespaced_request!(r); + r.extensions_mut().insert(labels); + } + ); + ( + pause_activity_execution, + PauseActivityExecutionRequest, + PauseActivityExecutionResponse, + |r| { + let labels = namespaced_request!(r); + r.extensions_mut().insert(labels); + } + ); + ( + unpause_activity_execution, + UnpauseActivityExecutionRequest, + UnpauseActivityExecutionResponse, + |r| { + let labels = namespaced_request!(r); + r.extensions_mut().insert(labels); + } + ); + ( + reset_activity_execution, + ResetActivityExecutionRequest, + ResetActivityExecutionResponse, + |r| { + let labels = namespaced_request!(r); + r.extensions_mut().insert(labels); + } + ); + ( + update_activity_execution_options, + UpdateActivityExecutionOptionsRequest, + UpdateActivityExecutionOptionsResponse, + |r| { + let labels = namespaced_request!(r); + r.extensions_mut().insert(labels); + } + ); } proxier! { diff --git a/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json b/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json index 8591cb0be..97c2a1f6c 100644 --- a/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json +++ b/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json @@ -120,6 +120,169 @@ ] } }, + "/api/v1/namespaces/activities/{activityId}/pause": { + "post": { + "summary": "PauseActivityExecution 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", + "operationId": "PauseActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "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/activities/{activityId}/reset": { + "post": { + "summary": "ResetActivityExecution resets 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 reset.", + "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": "activityId", + "description": "Reset an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type and all_workflow_activities.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/activities/{activityId}/unpause": { + "post": { + "summary": "UnpauseActivityExecution 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", + "operationId": "UnpauseActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "activityId", + "description": "Unpause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type and all_workflow_activities.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/activities/{activityId}/update-options": { + "post": { + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be updated.", + "operationId": "UpdateActivityExecutionOptions2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "activityId", + "description": "Update options for an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type and all_workflow_activities.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}": { "get": { "summary": "DescribeNamespace returns the information and configuration for a registered namespace.", @@ -157,6 +320,60 @@ ] } }, + "/api/v1/namespaces/{namespace}/activities": { + "get": { + "summary": "ListActivityExecutions is a visibility API to list activity executions in a specific namespace.", + "operationId": "ListActivityExecutions2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListActivityExecutionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "pageSize", + "description": "Max number of executions to return per page.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "nextPageToken", + "description": "Token returned in ListActivityExecutionsResponse.", + "in": "query", + "required": false, + "type": "string", + "format": "byte" + }, + { + "name": "query", + "description": "Visibility query, see https://docs.temporal.io/list-filter for the syntax.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/activities/cancel": { "post": { "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", @@ -480,7 +697,7 @@ "/api/v1/namespaces/{namespace}/activities/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", + "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\nDeprecated. See PauseActivityExecution.", "operationId": "PauseActivity2", "responses": { "200": { @@ -521,7 +738,7 @@ "/api/v1/namespaces/{namespace}/activities/reset": { "post": { "summary": "ResetActivity resets 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 reset.", - "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.", + "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.\nDeprecated. See ResetActivityExecution.", "operationId": "ResetActivity2", "responses": { "200": { @@ -562,7 +779,7 @@ "/api/v1/namespaces/{namespace}/activities/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", + "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\nDeprecated. See UnpauseActivityExecution.", "operationId": "UnpauseActivity2", "responses": { "200": { @@ -602,7 +819,7 @@ }, "/api/v1/namespaces/{namespace}/activities/update-options": { "post": { - "summary": "UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be updated.", + "summary": "UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be updated.\nDeprecated. See UpdateActivityExecutionOptions.", "operationId": "UpdateActivityOptions2", "responses": { "200": { @@ -640,15 +857,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/archived-workflows": { + "/api/v1/namespaces/{namespace}/activities/{activityId}": { "get": { - "summary": "ListArchivedWorkflowExecutions is a visibility API to list archived workflow executions in a specific namespace.", - "operationId": "ListArchivedWorkflowExecutions2", + "summary": "DescribeActivityExecution returns information about the specified activity execution.\nPass in a long_poll_token to turn this request into a long poll that gets unblocked when the activity makes\nprogress.\nIn case the activity has not made progress by the time the long poll request times out, an empty response is\nreturned and the caller may issue an identical DescribeActivityExecution request to continue polling.", + "operationId": "DescribeActivityExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ListArchivedWorkflowExecutionsResponse" + "$ref": "#/definitions/v1DescribeActivityExecutionResponse" } }, "default": { @@ -666,40 +883,47 @@ "type": "string" }, { - "name": "pageSize", + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "runId", + "description": "Activity run ID, targets the latest run if run_id is empty.", "in": "query", "required": false, - "type": "integer", - "format": "int32" + "type": "string" }, { - "name": "nextPageToken", + "name": "includeInput", + "description": "If true, the activity input is returned in the response.", "in": "query", "required": false, - "type": "string", - "format": "byte" + "type": "boolean" }, { - "name": "query", + "name": "longPollToken", + "description": "If not empty, turns this request into a long poll that is unblocked when the activity state changes from the time\nthe token was returned.\nThis token is returned as part of the `DescribeActivityExecutionResponse`.", "in": "query", "required": false, - "type": "string" + "type": "string", + "format": "byte" } ], "tags": [ "WorkflowService" ] - } - }, - "/api/v1/namespaces/{namespace}/batch-operations": { - "get": { - "summary": "ListBatchOperations returns a list of batch operations", - "operationId": "ListBatchOperations2", + }, + "post": { + "summary": "StartActivityExecution starts a new activity execution.", + "description": "Returns an `ExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace\nunless permitted by the specified ID conflict policy.", + "operationId": "StartActivityExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ListBatchOperationsResponse" + "$ref": "#/definitions/v1StartActivityExecutionResponse" } }, "default": { @@ -712,26 +936,23 @@ "parameters": [ { "name": "namespace", - "description": "Namespace that contains the batch operation", "in": "path", "required": true, "type": "string" }, { - "name": "pageSize", - "description": "List page size", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" + "name": "activityId", + "in": "path", + "required": true, + "type": "string" }, { - "name": "nextPageToken", - "description": "Next page token", - "in": "query", - "required": false, - "type": "string", - "format": "byte" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceStartActivityExecutionBody" + } } ], "tags": [ @@ -739,15 +960,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/batch-operations/{jobId}": { - "get": { - "summary": "DescribeBatchOperation returns the information about a batch operation", - "operationId": "DescribeBatchOperation2", + "/api/v1/namespaces/{namespace}/activities/{activityId}/cancel": { + "post": { + "summary": "RequestCancelActivityExecution requests cancellation of an activity execution.", + "description": "Requesting to cancel an activity does not automatically transition the activity to canceled status. If the\nactivity has a currently running attempt, the activity will only transition to canceled status if the current\nattempt is unsuccessful.\nTODO: Clarify what happens if there are no more allowed retries after the current attempt.\n\nIt returns success if the requested activity is already closed.\nTODO: This ^^ is copied from RequestCancelWorkflowExecution, do we want to preserve this behavior?", + "operationId": "RequestCancelActivityExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1DescribeBatchOperationResponse" + "$ref": "#/definitions/v1RequestCancelActivityExecutionResponse" } }, "default": { @@ -760,26 +982,305 @@ "parameters": [ { "name": "namespace", - "description": "Namespace that contains the batch operation", "in": "path", "required": true, "type": "string" }, { - "name": "jobId", - "description": "Batch job id", + "name": "activityId", "in": "path", "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRequestCancelActivityExecutionBody" + } } ], "tags": [ "WorkflowService" ] - }, - "post": { - "summary": "StartBatchOperation starts a new batch operation", - "operationId": "StartBatchOperation2", + } + }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/result": { + "get": { + "summary": "GetActivityExecutionResult returns the activity result if it is in a terminal status or (optionally) wait for it\nto reach one.", + "operationId": "GetActivityExecutionResult2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetActivityExecutionResultResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "runId", + "description": "Activity run ID, targets the latest run if run_id is empty.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "wait", + "description": "If set, turns this request into a long poll that is unblocked when the activity reaches a terminal status.\nThe wait duration is capped by the request's context deadline or by the maximum enforced long poll interval\nallowed by the server.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/terminate": { + "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 and will be requested to be canceled by the server when it heartbeats.", + "operationId": "TerminateActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1TerminateActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/activity-count": { + "get": { + "summary": "CountActivityExecutions is a visibility API to count of activity executions in a specific namespace.", + "operationId": "CountActivityExecutions2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CountActivityExecutionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "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, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/archived-workflows": { + "get": { + "summary": "ListArchivedWorkflowExecutions is a visibility API to list archived workflow executions in a specific namespace.", + "operationId": "ListArchivedWorkflowExecutions2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListArchivedWorkflowExecutionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "pageSize", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "nextPageToken", + "in": "query", + "required": false, + "type": "string", + "format": "byte" + }, + { + "name": "query", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/batch-operations": { + "get": { + "summary": "ListBatchOperations returns a list of batch operations", + "operationId": "ListBatchOperations2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListBatchOperationsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace that contains the batch operation", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "pageSize", + "description": "List page size", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "nextPageToken", + "description": "Next page token", + "in": "query", + "required": false, + "type": "string", + "format": "byte" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/batch-operations/{jobId}": { + "get": { + "summary": "DescribeBatchOperation returns the information about a batch operation", + "operationId": "DescribeBatchOperation2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeBatchOperationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace that contains the batch operation", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "jobId", + "description": "Batch job id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + }, + "post": { + "summary": "StartBatchOperation starts a new batch operation", + "operationId": "StartBatchOperation2", "responses": { "200": { "description": "A successful response.", @@ -2130,6 +2631,51 @@ ] } }, + "/api/v1/namespaces/{namespace}/worker-deployments/{deploymentName}/set-manager": { + "post": { + "summary": "Set/unset the ManagerIdentity of a Worker Deployment.\nExperimental. This API might significantly change or be removed in a future release.", + "operationId": "SetWorkerDeploymentManager2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1SetWorkerDeploymentManagerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceSetWorkerDeploymentManagerBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/worker-deployments/{deploymentName}/set-ramping-version": { "post": { "summary": "Set/unset the Ramping Version of a Worker Deployment and its ramp percentage. Can be used for\ngradual ramp to unversioned workers too.\nExperimental. This API might significantly change or be removed in a future release.", @@ -2296,6 +2842,45 @@ ] } }, + "/api/v1/namespaces/{namespace}/workers/describe/{workerInstanceKey}": { + "get": { + "summary": "DescribeWorker returns information about the specified worker.", + "operationId": "DescribeWorker2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeWorkerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace this worker belongs to.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workerInstanceKey", + "description": "Worker instance key to describe.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/workers/fetch-config": { "post": { "summary": "FetchWorkerConfig returns the worker configuration for a specific worker.", @@ -2822,7 +3407,7 @@ }, "/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}/history-reverse": { "get": { - "summary": "GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse \norder (starting from last event). Fails with`NotFound` if the specified workflow execution is \nunknown to the service.", + "summary": "GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse\norder (starting from last event). Fails with`NotFound` if the specified workflow execution is\nunknown to the service.", "operationId": "GetWorkflowExecutionHistoryReverse2", "responses": { "200": { @@ -3308,16 +3893,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { "post": { - "summary": "SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if\nit isn't yet started.", - "description": "If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history\nand a workflow task is generated.\n\nIf the workflow is not running or not found, then the workflow is created with\n`WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a\nworkflow task is generated.", - "operationId": "SignalWithStartWorkflowExecution2", + "summary": "PauseActivityExecution 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", + "operationId": "PauseActivityExecution4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1SignalWithStartWorkflowExecutionResponse" + "$ref": "#/definitions/v1PauseActivityExecutionResponse" } }, "default": { @@ -3330,19 +3915,21 @@ "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": "signalName", - "description": "The workflow author-defined name of the signal to send to the workflow", + "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" @@ -3352,7 +3939,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWithStartWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" } } ], @@ -3361,15 +3948,16 @@ ] } }, - "/api/v1/nexus/endpoints": { - "get": { - "summary": "List all Nexus endpoints for the cluster, sorted by ID in ascending order. Set page_token in the request to the\nnext_page_token field of the previous response to get the next page of results. An empty next_page_token\nindicates that there are no more results. During pagination, a newly added service with an ID lexicographically\nearlier than the previous page's last endpoint's ID may be missed.", - "operationId": "ListNexusEndpoints2", + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { + "post": { + "summary": "ResetActivityExecution resets 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 reset.", + "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/v1ListNexusEndpointsResponse" + "$ref": "#/definitions/v1ResetActivityExecutionResponse" } }, "default": { @@ -3381,40 +3969,50 @@ }, "parameters": [ { - "name": "pageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" }, { - "name": "nextPageToken", - "description": "To get the next page, pass in `ListNexusEndpointsResponse.next_page_token` from the previous page's\nresponse, the token will be empty if there's no other page.\nNote: the last page may be empty if the total number of endpoints registered is a multiple of the page size.", - "in": "query", - "required": false, - "type": "string", - "format": "byte" + "name": "workflowId", + "description": "If provided, reset a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity.", + "in": "path", + "required": true, + "type": "string" }, { - "name": "name", - "description": "Name of the incoming endpoint to filter on - optional. Specifying this will result in zero or one results.", - "in": "query", - "required": false, + "name": "activityId", + "description": "Reset an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type and all_workflow_activities.", + "in": "path", + "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + } } ], "tags": [ - "OperatorService" + "WorkflowService" ] - }, + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause": { "post": { - "summary": "Create a Nexus endpoint. This will fail if an endpoint with the same name is already registered with a status of\nALREADY_EXISTS.\nReturns the created endpoint with its initial version. You may use this version for subsequent updates.", - "operationId": "CreateNexusEndpoint2", + "summary": "UnpauseActivityExecution 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", + "operationId": "UnpauseActivityExecution4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1CreateNexusEndpointResponse" + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" } }, "default": { @@ -3425,29 +4023,50 @@ } }, "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "If provided, unpause 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": "Unpause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type and all_workflow_activities.", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/v1CreateNexusEndpointRequest" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" } } ], "tags": [ - "OperatorService" + "WorkflowService" ] } }, - "/api/v1/nexus/endpoints/{id}": { - "get": { - "summary": "Get a registered Nexus endpoint by ID. The returned version can be used for optimistic updates.", - "operationId": "GetNexusEndpoint2", + "/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 or type.\nIf there are multiple pending activities of the provided type - all of them will be updated.", + "operationId": "UpdateActivityExecutionOptions4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1GetNexusEndpointResponse" + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" } }, "default": { @@ -3459,65 +4078,50 @@ }, "parameters": [ { - "name": "id", - "description": "Server-generated unique endpoint ID.", + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" - } - ], - "tags": [ - "OperatorService" - ] - }, - "delete": { - "summary": "Delete an incoming Nexus service by ID.", - "operationId": "DeleteNexusEndpoint2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1DeleteNexusEndpointResponse" - } }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ { - "name": "id", - "description": "Server-generated unique endpoint ID.", + "name": "workflowId", + "description": "If provided, update options for a workflow activity (or activities) for the given workflow ID. If empty, target a\nstandalone activity.", "in": "path", "required": true, "type": "string" }, { - "name": "version", - "description": "Data version for this endpoint. Must match current version.", - "in": "query", - "required": false, - "type": "string", - "format": "int64" + "name": "activityId", + "description": "Update options for an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type and all_workflow_activities.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } } ], "tags": [ - "OperatorService" + "WorkflowService" ] } }, - "/api/v1/nexus/endpoints/{id}/update": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { "post": { - "summary": "Optimistically update a Nexus endpoint based on provided version as obtained via the `GetNexusEndpoint` or\n`ListNexusEndpointResponse` APIs. This will fail with a status of FAILED_PRECONDITION if the version does not\nmatch.\nReturns the updated endpoint with its updated version. You may use this version for subsequent updates. You don't\nneed to increment the version yourself. The server will increment the version for you after each update.", - "operationId": "UpdateNexusEndpoint2", + "summary": "SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if\nit isn't yet started.", + "description": "If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history\nand a workflow task is generated.\n\nIf the workflow is not running or not found, then the workflow is created with\n`WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a\nworkflow task is generated.", + "operationId": "SignalWithStartWorkflowExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateNexusEndpointResponse" + "$ref": "#/definitions/v1SignalWithStartWorkflowExecutionResponse" } }, "default": { @@ -3529,8 +4133,20 @@ }, "parameters": [ { - "name": "id", - "description": "Server-generated unique endpoint ID.", + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "signalName", + "description": "The workflow author-defined name of the signal to send to the workflow", "in": "path", "required": true, "type": "string" @@ -3540,24 +4156,24 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/OperatorServiceUpdateNexusEndpointBody" + "$ref": "#/definitions/WorkflowServiceSignalWithStartWorkflowExecutionBody" } } ], "tags": [ - "OperatorService" + "WorkflowService" ] } }, - "/api/v1/system-info": { + "/api/v1/nexus/endpoints": { "get": { - "summary": "GetSystemInfo returns information about the system.", - "operationId": "GetSystemInfo2", + "summary": "List all Nexus endpoints for the cluster, sorted by ID in ascending order. Set page_token in the request to the\nnext_page_token field of the previous response to get the next page of results. An empty next_page_token\nindicates that there are no more results. During pagination, a newly added service with an ID lexicographically\nearlier than the previous page's last endpoint's ID may be missed.", + "operationId": "ListNexusEndpoints2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1GetSystemInfoResponse" + "$ref": "#/definitions/v1ListNexusEndpointsResponse" } }, "default": { @@ -3567,18 +4183,206 @@ } } }, - "tags": [ - "WorkflowService" - ] - } - }, - "/cluster": { - "get": { - "summary": "GetClusterInfo returns information about temporal cluster", - "operationId": "GetClusterInfo", - "responses": { - "200": { - "description": "A successful response.", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "nextPageToken", + "description": "To get the next page, pass in `ListNexusEndpointsResponse.next_page_token` from the previous page's\nresponse, the token will be empty if there's no other page.\nNote: the last page may be empty if the total number of endpoints registered is a multiple of the page size.", + "in": "query", + "required": false, + "type": "string", + "format": "byte" + }, + { + "name": "name", + "description": "Name of the incoming endpoint to filter on - optional. Specifying this will result in zero or one results.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "OperatorService" + ] + }, + "post": { + "summary": "Create a Nexus endpoint. This will fail if an endpoint with the same name is already registered with a status of\nALREADY_EXISTS.\nReturns the created endpoint with its initial version. You may use this version for subsequent updates.", + "operationId": "CreateNexusEndpoint2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateNexusEndpointResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateNexusEndpointRequest" + } + } + ], + "tags": [ + "OperatorService" + ] + } + }, + "/api/v1/nexus/endpoints/{id}": { + "get": { + "summary": "Get a registered Nexus endpoint by ID. The returned version can be used for optimistic updates.", + "operationId": "GetNexusEndpoint2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetNexusEndpointResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "description": "Server-generated unique endpoint ID.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "OperatorService" + ] + }, + "delete": { + "summary": "Delete an incoming Nexus service by ID.", + "operationId": "DeleteNexusEndpoint2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DeleteNexusEndpointResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "description": "Server-generated unique endpoint ID.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "version", + "description": "Data version for this endpoint. Must match current version.", + "in": "query", + "required": false, + "type": "string", + "format": "int64" + } + ], + "tags": [ + "OperatorService" + ] + } + }, + "/api/v1/nexus/endpoints/{id}/update": { + "post": { + "summary": "Optimistically update a Nexus endpoint based on provided version as obtained via the `GetNexusEndpoint` or\n`ListNexusEndpointResponse` APIs. This will fail with a status of FAILED_PRECONDITION if the version does not\nmatch.\nReturns the updated endpoint with its updated version. You may use this version for subsequent updates. You don't\nneed to increment the version yourself. The server will increment the version for you after each update.", + "operationId": "UpdateNexusEndpoint2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateNexusEndpointResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "description": "Server-generated unique endpoint ID.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/OperatorServiceUpdateNexusEndpointBody" + } + } + ], + "tags": [ + "OperatorService" + ] + } + }, + "/api/v1/system-info": { + "get": { + "summary": "GetSystemInfo returns information about the system.", + "operationId": "GetSystemInfo2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetSystemInfoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "WorkflowService" + ] + } + }, + "/cluster": { + "get": { + "summary": "GetClusterInfo returns information about temporal cluster", + "operationId": "GetClusterInfo", + "responses": { + "200": { + "description": "A successful response.", "schema": { "$ref": "#/definitions/v1GetClusterInfoResponse" } @@ -3896,7 +4700,465 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1DeleteNexusEndpointResponse" + "$ref": "#/definitions/v1DeleteNexusEndpointResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "description": "Server-generated unique endpoint ID.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "version", + "description": "Data version for this endpoint. Must match current version.", + "in": "query", + "required": false, + "type": "string", + "format": "int64" + } + ], + "tags": [ + "OperatorService" + ] + } + }, + "/cluster/nexus/endpoints/{id}/update": { + "post": { + "summary": "Optimistically update a Nexus endpoint based on provided version as obtained via the `GetNexusEndpoint` or\n`ListNexusEndpointResponse` APIs. This will fail with a status of FAILED_PRECONDITION if the version does not\nmatch.\nReturns the updated endpoint with its updated version. You may use this version for subsequent updates. You don't\nneed to increment the version yourself. The server will increment the version for you after each update.", + "operationId": "UpdateNexusEndpoint", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateNexusEndpointResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "description": "Server-generated unique endpoint ID.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/OperatorServiceUpdateNexusEndpointBody" + } + } + ], + "tags": [ + "OperatorService" + ] + } + }, + "/namespaces/activities/{activityId}/pause": { + "post": { + "summary": "PauseActivityExecution 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", + "operationId": "PauseActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "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/activities/{activityId}/reset": { + "post": { + "summary": "ResetActivityExecution resets 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 reset.", + "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": "activityId", + "description": "Reset an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type and all_workflow_activities.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/activities/{activityId}/unpause": { + "post": { + "summary": "UnpauseActivityExecution 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", + "operationId": "UnpauseActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "activityId", + "description": "Unpause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type and all_workflow_activities.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/activities/{activityId}/update-options": { + "post": { + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be updated.", + "operationId": "UpdateActivityExecutionOptions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "activityId", + "description": "Update options for an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type and all_workflow_activities.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities": { + "get": { + "summary": "ListActivityExecutions is a visibility API to list activity executions in a specific namespace.", + "operationId": "ListActivityExecutions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListActivityExecutionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "pageSize", + "description": "Max number of executions to return per page.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "nextPageToken", + "description": "Token returned in ListActivityExecutionsResponse.", + "in": "query", + "required": false, + "type": "string", + "format": "byte" + }, + { + "name": "query", + "description": "Visibility query, see https://docs.temporal.io/list-filter for the syntax.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/cancel": { + "post": { + "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", + "description": "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/v1RespondActivityTaskCanceledResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/cancel-by-id": { + "post": { + "summary": "See `RecordActivityTaskCanceled`. 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/v1RespondActivityTaskCanceledByIdResponse" + } + }, + "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/WorkflowServiceRespondActivityTaskCanceledByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/complete": { + "post": { + "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", + "description": "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/v1RespondActivityTaskCompletedResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/complete-by-id": { + "post": { + "summary": "See `RecordActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCompletedById", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" + } + }, + "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/WorkflowServiceRespondActivityTaskCompletedByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/fail": { + "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", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RespondActivityTaskFailedResponse" } }, "default": { @@ -3908,35 +5170,34 @@ }, "parameters": [ { - "name": "id", - "description": "Server-generated unique endpoint ID.", + "name": "namespace", "in": "path", "required": true, "type": "string" }, { - "name": "version", - "description": "Data version for this endpoint. Must match current version.", - "in": "query", - "required": false, - "type": "string", - "format": "int64" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedBody" + } } ], "tags": [ - "OperatorService" + "WorkflowService" ] } }, - "/cluster/nexus/endpoints/{id}/update": { + "/namespaces/{namespace}/activities/fail-by-id": { "post": { - "summary": "Optimistically update a Nexus endpoint based on provided version as obtained via the `GetNexusEndpoint` or\n`ListNexusEndpointResponse` APIs. This will fail with a status of FAILED_PRECONDITION if the version does not\nmatch.\nReturns the updated endpoint with its updated version. You may use this version for subsequent updates. You don't\nneed to increment the version yourself. The server will increment the version for you after each update.", - "operationId": "UpdateNexusEndpoint", + "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskFailedById", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateNexusEndpointResponse" + "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" } }, "default": { @@ -3948,8 +5209,8 @@ }, "parameters": [ { - "name": "id", - "description": "Server-generated unique endpoint ID.", + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" @@ -3959,25 +5220,25 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/OperatorServiceUpdateNexusEndpointBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" } } ], "tags": [ - "OperatorService" + "WorkflowService" ] } }, - "/namespaces/{namespace}/activities/cancel": { + "/namespaces/{namespace}/activities/heartbeat": { "post": { - "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", - "description": "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": "RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.", + "description": "If worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,\nthen it will be marked as timed out and an `ACTIVITY_TASK_TIMED_OUT` event will be written to\nthe workflow history. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in\nsuch situations, in that event, the SDK should request cancellation of the activity.", + "operationId": "RecordActivityTaskHeartbeat", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatResponse" } }, "default": { @@ -3999,7 +5260,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatBody" } } ], @@ -4008,15 +5269,15 @@ ] } }, - "/namespaces/{namespace}/activities/cancel-by-id": { + "/namespaces/{namespace}/activities/heartbeat-by-id": { "post": { - "summary": "See `RecordActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById", + "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RecordActivityTaskHeartbeatById", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" } }, "default": { @@ -4039,7 +5300,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" } } ], @@ -4048,16 +5309,16 @@ ] } }, - "/namespaces/{namespace}/activities/complete": { + "/namespaces/{namespace}/activities/pause": { "post": { - "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", - "description": "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": "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\nDeprecated. See PauseActivityExecution.", + "operationId": "PauseActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCompletedResponse" + "$ref": "#/definitions/v1PauseActivityResponse" } }, "default": { @@ -4070,6 +5331,7 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" @@ -4079,7 +5341,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedBody" + "$ref": "#/definitions/WorkflowServicePauseActivityBody" } } ], @@ -4088,15 +5350,16 @@ ] } }, - "/namespaces/{namespace}/activities/complete-by-id": { + "/namespaces/{namespace}/activities/reset": { "post": { - "summary": "See `RecordActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCompletedById", + "summary": "ResetActivity resets 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 reset.", + "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.\nDeprecated. See ResetActivityExecution.", + "operationId": "ResetActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" + "$ref": "#/definitions/v1ResetActivityResponse" } }, "default": { @@ -4109,7 +5372,7 @@ "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" @@ -4119,7 +5382,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" + "$ref": "#/definitions/WorkflowServiceResetActivityBody" } } ], @@ -4128,16 +5391,16 @@ ] } }, - "/namespaces/{namespace}/activities/fail": { + "/namespaces/{namespace}/activities/unpause": { "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": "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\nDeprecated. See UnpauseActivityExecution.", + "operationId": "UnpauseActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedResponse" + "$ref": "#/definitions/v1UnpauseActivityResponse" } }, "default": { @@ -4150,6 +5413,7 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" @@ -4159,7 +5423,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityBody" } } ], @@ -4168,15 +5432,15 @@ ] } }, - "/namespaces/{namespace}/activities/fail-by-id": { + "/namespaces/{namespace}/activities/update-options": { "post": { - "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskFailedById", + "summary": "UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be updated.\nDeprecated. See UpdateActivityExecutionOptions.", + "operationId": "UpdateActivityOptions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" + "$ref": "#/definitions/v1UpdateActivityOptionsResponse" } }, "default": { @@ -4199,7 +5463,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityOptionsBody" } } ], @@ -4208,16 +5472,15 @@ ] } }, - "/namespaces/{namespace}/activities/heartbeat": { - "post": { - "summary": "RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.", - "description": "If worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,\nthen it will be marked as timed out and an `ACTIVITY_TASK_TIMED_OUT` event will be written to\nthe workflow history. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in\nsuch situations, in that event, the SDK should request cancellation of the activity.", - "operationId": "RecordActivityTaskHeartbeat", + "/namespaces/{namespace}/activities/{activityId}": { + "get": { + "summary": "DescribeActivityExecution returns information about the specified activity execution.\nPass in a long_poll_token to turn this request into a long poll that gets unblocked when the activity makes\nprogress.\nIn case the activity has not made progress by the time the long poll request times out, an empty response is\nreturned and the caller may issue an identical DescribeActivityExecution request to continue polling.", + "operationId": "DescribeActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatResponse" + "$ref": "#/definitions/v1DescribeActivityExecutionResponse" } }, "default": { @@ -4235,28 +5498,47 @@ "type": "string" }, { - "name": "body", - "in": "body", + "name": "activityId", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatBody" - } + "type": "string" + }, + { + "name": "runId", + "description": "Activity run ID, targets the latest run if run_id is empty.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "includeInput", + "description": "If true, the activity input is returned in the response.", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "longPollToken", + "description": "If not empty, turns this request into a long poll that is unblocked when the activity state changes from the time\nthe token was returned.\nThis token is returned as part of the `DescribeActivityExecutionResponse`.", + "in": "query", + "required": false, + "type": "string", + "format": "byte" } ], "tags": [ "WorkflowService" ] - } - }, - "/namespaces/{namespace}/activities/heartbeat-by-id": { + }, "post": { - "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RecordActivityTaskHeartbeatById", + "summary": "StartActivityExecution starts a new activity execution.", + "description": "Returns an `ExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace\nunless permitted by the specified ID conflict policy.", + "operationId": "StartActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + "$ref": "#/definitions/v1StartActivityExecutionResponse" } }, "default": { @@ -4269,7 +5551,12 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", "in": "path", "required": true, "type": "string" @@ -4279,7 +5566,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + "$ref": "#/definitions/WorkflowServiceStartActivityExecutionBody" } } ], @@ -4288,16 +5575,16 @@ ] } }, - "/namespaces/{namespace}/activities/pause": { + "/namespaces/{namespace}/activities/{activityId}/cancel": { "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", - "operationId": "PauseActivity", + "summary": "RequestCancelActivityExecution requests cancellation of an activity execution.", + "description": "Requesting to cancel an activity does not automatically transition the activity to canceled status. If the\nactivity has a currently running attempt, the activity will only transition to canceled status if the current\nattempt is unsuccessful.\nTODO: Clarify what happens if there are no more allowed retries after the current attempt.\n\nIt returns success if the requested activity is already closed.\nTODO: This ^^ is copied from RequestCancelWorkflowExecution, do we want to preserve this behavior?", + "operationId": "RequestCancelActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityResponse" + "$ref": "#/definitions/v1RequestCancelActivityExecutionResponse" } }, "default": { @@ -4310,7 +5597,12 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", "in": "path", "required": true, "type": "string" @@ -4320,7 +5612,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityBody" + "$ref": "#/definitions/WorkflowServiceRequestCancelActivityExecutionBody" } } ], @@ -4329,16 +5621,15 @@ ] } }, - "/namespaces/{namespace}/activities/reset": { - "post": { - "summary": "ResetActivity resets 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 reset.", - "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": "ResetActivity", + "/namespaces/{namespace}/activities/{activityId}/result": { + "get": { + "summary": "GetActivityExecutionResult returns the activity result if it is in a terminal status or (optionally) wait for it\nto reach one.", + "operationId": "GetActivityExecutionResult", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetActivityResponse" + "$ref": "#/definitions/v1GetActivityExecutionResultResponse" } }, "default": { @@ -4351,18 +5642,29 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", + "name": "activityId", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityBody" - } + "type": "string" + }, + { + "name": "runId", + "description": "Activity run ID, targets the latest run if run_id is empty.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "wait", + "description": "If set, turns this request into a long poll that is unblocked when the activity reaches a terminal status.\nThe wait duration is capped by the request's context deadline or by the maximum enforced long poll interval\nallowed by the server.", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -4370,16 +5672,16 @@ ] } }, - "/namespaces/{namespace}/activities/unpause": { + "/namespaces/{namespace}/activities/{activityId}/terminate": { "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", - "operationId": "UnpauseActivity", + "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 and will be requested to be canceled by the server when it heartbeats.", + "operationId": "TerminateActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UnpauseActivityResponse" + "$ref": "#/definitions/v1TerminateActivityExecutionResponse" } }, "default": { @@ -4392,7 +5694,12 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", "in": "path", "required": true, "type": "string" @@ -4402,7 +5709,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityBody" + "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" } } ], @@ -4411,15 +5718,15 @@ ] } }, - "/namespaces/{namespace}/activities/update-options": { - "post": { - "summary": "UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be updated.", - "operationId": "UpdateActivityOptions", + "/namespaces/{namespace}/activity-count": { + "get": { + "summary": "CountActivityExecutions is a visibility API to count of activity executions in a specific namespace.", + "operationId": "CountActivityExecutions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateActivityOptionsResponse" + "$ref": "#/definitions/v1CountActivityExecutionsResponse" } }, "default": { @@ -4432,18 +5739,16 @@ "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/WorkflowServiceUpdateActivityOptionsBody" - } + "name": "query", + "description": "Visibility query, see https://docs.temporal.io/list-filter for the syntax.", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -5790,7 +7095,51 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1DeleteWorkerDeploymentResponse" + "$ref": "#/definitions/v1DeleteWorkerDeploymentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "identity", + "description": "Optional. The identity of the client who initiated this request.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/worker-deployments/{deploymentName}/set-current-version": { + "post": { + "summary": "Set/unset the Current Version of a Worker Deployment. Automatically unsets the Ramping\nVersion if it is the Version being set as Current.\nExperimental. This API might significantly change or be removed in a future release.", + "operationId": "SetWorkerDeploymentCurrentVersion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1SetWorkerDeploymentCurrentVersionResponse" } }, "default": { @@ -5814,11 +7163,12 @@ "type": "string" }, { - "name": "identity", - "description": "Optional. The identity of the client who initiated this request.", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceSetWorkerDeploymentCurrentVersionBody" + } } ], "tags": [ @@ -5826,15 +7176,15 @@ ] } }, - "/namespaces/{namespace}/worker-deployments/{deploymentName}/set-current-version": { + "/namespaces/{namespace}/worker-deployments/{deploymentName}/set-manager": { "post": { - "summary": "Set/unset the Current Version of a Worker Deployment. Automatically unsets the Ramping\nVersion if it is the Version being set as Current.\nExperimental. This API might significantly change or be removed in a future release.", - "operationId": "SetWorkerDeploymentCurrentVersion", + "summary": "Set/unset the ManagerIdentity of a Worker Deployment.\nExperimental. This API might significantly change or be removed in a future release.", + "operationId": "SetWorkerDeploymentManager", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1SetWorkerDeploymentCurrentVersionResponse" + "$ref": "#/definitions/v1SetWorkerDeploymentManagerResponse" } }, "default": { @@ -5862,7 +7212,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceSetWorkerDeploymentCurrentVersionBody" + "$ref": "#/definitions/WorkflowServiceSetWorkerDeploymentManagerBody" } } ], @@ -6037,6 +7387,45 @@ ] } }, + "/namespaces/{namespace}/workers/describe/{workerInstanceKey}": { + "get": { + "summary": "DescribeWorker returns information about the specified worker.", + "operationId": "DescribeWorker", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeWorkerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace this worker belongs to.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workerInstanceKey", + "description": "Worker instance key to describe.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/workers/fetch-config": { "post": { "summary": "FetchWorkerConfig returns the worker configuration for a specific worker.", @@ -6563,7 +7952,7 @@ }, "/namespaces/{namespace}/workflows/{execution.workflowId}/history-reverse": { "get": { - "summary": "GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse \norder (starting from last event). Fails with`NotFound` if the specified workflow execution is \nunknown to the service.", + "summary": "GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse\norder (starting from last event). Fails with`NotFound` if the specified workflow execution is\nunknown to the service.", "operationId": "GetWorkflowExecutionHistoryReverse", "responses": { "200": { @@ -6806,16 +8195,213 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/signal/{signalName}": { + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/signal/{signalName}": { + "post": { + "summary": "SignalWorkflowExecution is used to send a signal to a running workflow execution.", + "description": "This results in a `WORKFLOW_EXECUTION_SIGNALED` event recorded in the history and a workflow\ntask being created for the execution.", + "operationId": "SignalWorkflowExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1SignalWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "signalName", + "description": "The workflow author-defined name of the signal to send to the workflow", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { + "post": { + "summary": "TerminateWorkflowExecution terminates an existing workflow execution by recording a\n`WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the\nexecution instance.", + "operationId": "TerminateWorkflowExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update-options": { + "post": { + "summary": "UpdateWorkflowExecutionOptions partially updates the WorkflowExecutionOptions of an existing workflow execution.", + "operationId": "UpdateWorkflowExecutionOptions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateWorkflowExecutionOptionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "The namespace name of the target Workflow.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { + "post": { + "summary": "Invokes the specified Update function on user Workflow code.", + "operationId": "UpdateWorkflowExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "The namespace name of the target Workflow.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "request.input.name", + "description": "The name of the Update handler to invoke on the target Workflow.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowId}": { "post": { - "summary": "SignalWorkflowExecution is used to send a signal to a running workflow execution.", - "description": "This results in a `WORKFLOW_EXECUTION_SIGNALED` event recorded in the history and a workflow\ntask being created for the execution.", - "operationId": "SignalWorkflowExecution", + "summary": "StartWorkflowExecution starts a new workflow execution.", + "description": "It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and\nalso schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an\ninstance already exists with same workflow id.", + "operationId": "StartWorkflowExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1SignalWorkflowExecutionResponse" + "$ref": "#/definitions/v1StartWorkflowExecutionResponse" } }, "default": { @@ -6833,14 +8419,7 @@ "type": "string" }, { - "name": "workflowExecution.workflowId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "signalName", - "description": "The workflow author-defined name of the signal to send to the workflow", + "name": "workflowId", "in": "path", "required": true, "type": "string" @@ -6850,7 +8429,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" } } ], @@ -6859,15 +8438,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { "post": { - "summary": "TerminateWorkflowExecution terminates an existing workflow execution by recording a\n`WORKFLOW_EXECUTION_TERMINATED` event in the history and immediately terminating the\nexecution instance.", - "operationId": "TerminateWorkflowExecution", + "summary": "PauseActivityExecution 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", + "operationId": "PauseActivityExecution3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" + "$ref": "#/definitions/v1PauseActivityExecutionResponse" } }, "default": { @@ -6880,12 +8460,21 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { - "name": "workflowExecution.workflowId", + "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" @@ -6895,7 +8484,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" } } ], @@ -6904,15 +8493,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update-options": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { "post": { - "summary": "UpdateWorkflowExecutionOptions partially updates the WorkflowExecutionOptions of an existing workflow execution.", - "operationId": "UpdateWorkflowExecutionOptions", + "summary": "ResetActivityExecution resets 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 reset.", + "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/v1UpdateWorkflowExecutionOptionsResponse" + "$ref": "#/definitions/v1ResetActivityExecutionResponse" } }, "default": { @@ -6925,13 +8515,21 @@ "parameters": [ { "name": "namespace", - "description": "The namespace name of the target Workflow.", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "workflowId", + "description": "If provided, reset 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": "Reset an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type and all_workflow_activities.", "in": "path", "required": true, "type": "string" @@ -6941,7 +8539,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionOptionsBody" + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" } } ], @@ -6950,15 +8548,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause": { "post": { - "summary": "Invokes the specified Update function on user Workflow code.", - "operationId": "UpdateWorkflowExecution", + "summary": "UnpauseActivityExecution 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", + "operationId": "UnpauseActivityExecution3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" } }, "default": { @@ -6971,20 +8570,21 @@ "parameters": [ { "name": "namespace", - "description": "The namespace name of the target Workflow.", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { - "name": "workflowExecution.workflowId", + "name": "workflowId", + "description": "If provided, unpause a workflow activity (or activities) for the given workflow ID.\nIf empty, target a standalone activity.", "in": "path", "required": true, "type": "string" }, { - "name": "request.input.name", - "description": "The name of the Update handler to invoke on the target Workflow.", + "name": "activityId", + "description": "Unpause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type and all_workflow_activities.", "in": "path", "required": true, "type": "string" @@ -6994,7 +8594,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" } } ], @@ -7003,16 +8603,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options": { "post": { - "summary": "StartWorkflowExecution starts a new workflow execution.", - "description": "It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and\nalso schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an\ninstance already exists with same workflow id.", - "operationId": "StartWorkflowExecution", + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be updated.", + "operationId": "UpdateActivityExecutionOptions3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1StartWorkflowExecutionResponse" + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" } }, "default": { @@ -7025,12 +8624,21 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", + "description": "If provided, update options for a workflow activity (or activities) for the given workflow ID. If empty, target a\nstandalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Update options for an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type and all_workflow_activities.", "in": "path", "required": true, "type": "string" @@ -7040,7 +8648,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" } } ], @@ -7166,22 +8774,6 @@ } } }, - "CountWorkflowExecutionsResponseAggregationGroup": { - "type": "object", - "properties": { - "groupValues": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1Payload" - } - }, - "count": { - "type": "string", - "format": "int64" - } - } - }, "DeploymentInfoTaskQueueInfo": { "type": "object", "properties": { @@ -7271,6 +8863,21 @@ } } }, + "LinkActivity": { + "type": "object", + "properties": { + "namespace": { + "type": "string" + }, + "activityId": { + "type": "string" + }, + "runId": { + "type": "string" + } + }, + "description": "A link to an activity." + }, "LinkBatchJob": { "type": "object", "properties": { @@ -7341,19 +8948,6 @@ } } }, - "PauseInfoManual": { - "type": "object", - "properties": { - "identity": { - "type": "string", - "description": "The identity of the actor that paused the activity." - }, - "reason": { - "type": "string", - "description": "Reason for pausing the activity." - } - } - }, "PauseInfoRule": { "type": "object", "properties": { @@ -7371,24 +8965,6 @@ } } }, - "PendingActivityInfoPauseInfo": { - "type": "object", - "properties": { - "pauseTime": { - "type": "string", - "format": "date-time", - "description": "The time when the activity was paused." - }, - "manual": { - "$ref": "#/definitions/PauseInfoManual", - "title": "activity was paused by the manual intervention" - }, - "rule": { - "$ref": "#/definitions/PauseInfoRule", - "title": "activity was paused by the rule" - } - } - }, "PostResetOperationSignalWorkflow": { "type": "object", "properties": { @@ -7861,7 +9437,29 @@ }, "type": { "type": "string", - "description": "Pause all running activities of this type." + "description": "Pause all running activities of this type.\nNote: Experimental - the behavior of pause by activity type might change in a future release." + }, + "reason": { + "type": "string", + "description": "Reason to pause the activity." + } + }, + "description": "Deprecated. See PauseActivityExecutionRequest." + }, + "WorkflowServicePauseActivityExecutionBody": { + "type": "object", + "properties": { + "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." + }, + "workflowActivityType": { + "type": "string", + "description": "Pause all pending activities of this type.\nOnly available if workflow_id is provided.\nMutually exclusive with activity_id.\n\nNote: Experimental - the behavior of pausing by activity type might change or be removed in a future release." }, "reason": { "type": "string", @@ -7924,11 +9522,11 @@ "properties": { "workflowId": { "type": "string", - "title": "Id of the workflow which scheduled this activity" + "title": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity" }, "runId": { "type": "string", - "title": "Run Id of the workflow which scheduled this activity" + "description": "For a workflow activity - the run ID of the workflow which scheduled this activity.\nFor a standalone activity - the run ID of the activity." }, "activityId": { "type": "string", @@ -7960,6 +9558,27 @@ } } }, + "WorkflowServiceRequestCancelActivityExecutionBody": { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "Activity run ID, targets the latest run if run_id is empty." + }, + "identity": { + "type": "string", + "description": "The identity of the worker/client." + }, + "requestId": { + "type": "string", + "description": "Used to de-dupe cancellation requests." + }, + "reason": { + "type": "string", + "description": "Reason for requesting the cancellation, recorded and available via the DescribeActivityExecution API.\nNot propagated to a worker if an activity attempt is currently running." + } + } + }, "WorkflowServiceRequestCancelWorkflowExecutionBody": { "type": "object", "properties": { @@ -8038,7 +9657,45 @@ "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. See ResetActivityExecutionRequest." + }, + "WorkflowServiceResetActivityExecutionBody": { + "type": "object", + "properties": { + "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." + }, + "workflowActivityType": { + "type": "string", + "description": "Reset all pending workflow activities of this type.\nOnly available if workflow_id is provided.\nMutually exclusive with activity_id and all_workflow_activities.\n\nNote: Experimental - the behavior of resetting by activity type may change or be removed in a future release." + }, + "allWorkflowActivities": { + "type": "boolean", + "description": "Reset all pending workflow activities.\nOnly available if workflow_id is provided.\nMutually exclusive with activity_id and workflow_activity_type.\n\nNote: Experimental - the behavior of resetting all activities may change or be removed in a future release." + }, + "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 originally created with.\nFor workflow activities the original options are restored from first ActivityTaskScheduled event." + } + }, + "title": "TODO: update batch\nNOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities" }, "WorkflowServiceResetWorkflowExecutionBody": { "type": "object", @@ -8125,11 +9782,11 @@ "properties": { "workflowId": { "type": "string", - "title": "Id of the workflow which scheduled this activity" + "title": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity" }, "runId": { "type": "string", - "title": "Run Id of the workflow which scheduled this activity" + "description": "For a workflow activity - the run ID of the workflow which scheduled this activity.\nFor a standalone activity - the run ID of the activity." }, "activityId": { "type": "string", @@ -8184,11 +9841,11 @@ "properties": { "workflowId": { "type": "string", - "title": "Id of the workflow which scheduled this activity" + "title": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity" }, "runId": { "type": "string", - "title": "Run Id of the workflow which scheduled this activity" + "description": "For a workflow activity - the run ID of the workflow which scheduled this activity.\nFor a standalone activity - the run ID of the activity." }, "activityId": { "type": "string", @@ -8243,11 +9900,11 @@ "properties": { "workflowId": { "type": "string", - "title": "Id of the workflow which scheduled this activity" + "title": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity" }, "runId": { "type": "string", - "title": "Run Id of the workflow which scheduled this activity" + "description": "For a workflow activity - the run ID of the workflow which scheduled this activity.\nFor a standalone activity - the run ID of the activity." }, "activityId": { "type": "string", @@ -8314,10 +9971,37 @@ "ignoreMissingTaskQueues": { "type": "boolean", "description": "Optional. By default this request would be rejected if not all the expected Task Queues are\nbeing polled by the new Version, to protect against accidental removal of Task Queues, or\nworker health issues. Pass `true` here to bypass this protection.\nThe set of expected Task Queues is the set of all the Task Queues that were ever poller by\nthe existing Current Version of the Deployment, with the following exclusions:\n - Task Queues that are not used anymore (inferred by having empty backlog and a task\n add_rate of 0.)\n - Task Queues that are moved to another Worker Deployment (inferred by the Task Queue\n having a different Current Version than the Current Version of this deployment.)\nWARNING: Do not set this flag unless you are sure that the missing task queue pollers are not\nneeded. If the request is unexpectedly rejected due to missing pollers, then that means the\npollers have not reached to the server yet. Only set this if you expect those pollers to\nnever arrive." + }, + "allowNoPollers": { + "type": "boolean", + "description": "Optional. By default this request will be rejected if no pollers have been seen for the proposed\nCurrent Version, in order to protect users from routing tasks to pollers that do not exist, leading\nto possible timeouts. Pass `true` here to bypass this protection." } }, "description": "Set/unset the Current Version of a Worker Deployment." }, + "WorkflowServiceSetWorkerDeploymentManagerBody": { + "type": "object", + "properties": { + "managerIdentity": { + "type": "string", + "description": "Arbitrary value for `manager_identity`.\nEmpty will unset the field." + }, + "self": { + "type": "boolean", + "description": "True will set `manager_identity` to `identity`." + }, + "conflictToken": { + "type": "string", + "format": "byte", + "description": "Optional. This can be the value of conflict_token from a Describe, or another Worker\nDeployment API. Passing a non-nil conflict token will cause this request to fail if the\nDeployment's configuration has been modified between the API call that generated the\ntoken and this one." + }, + "identity": { + "type": "string", + "description": "Required. The identity of the client who initiated this request." + } + }, + "description": "Update the ManagerIdentity of a Worker Deployment." + }, "WorkflowServiceSetWorkerDeploymentRampingVersionBody": { "type": "object", "properties": { @@ -8346,6 +10030,10 @@ "ignoreMissingTaskQueues": { "type": "boolean", "description": "Optional. By default this request would be rejected if not all the expected Task Queues are\nbeing polled by the new Version, to protect against accidental removal of Task Queues, or\nworker health issues. Pass `true` here to bypass this protection.\nThe set of expected Task Queues equals to all the Task Queues ever polled from the existing\nCurrent Version of the Deployment, with the following exclusions:\n - Task Queues that are not used anymore (inferred by having empty backlog and a task\n add_rate of 0.)\n - Task Queues that are moved to another Worker Deployment (inferred by the Task Queue\n having a different Current Version than the Current Version of this deployment.)\nWARNING: Do not set this flag unless you are sure that the missing task queue poller are not\nneeded. If the request is unexpectedly rejected due to missing pollers, then that means the\npollers have not reached to the server yet. Only set this if you expect those pollers to\nnever arrive.\nNote: this check only happens when the ramping version is about to change, not every time\nthat the percentage changes. Also note that the check is against the deployment's Current\nVersion, not the previous Ramping Version." + }, + "allowNoPollers": { + "type": "boolean", + "description": "Optional. By default this request will be rejected if no pollers have been seen for the proposed\nCurrent Version, in order to protect users from routing tasks to pollers that do not exist, leading\nto possible timeouts. Pass `true` here to bypass this protection." } }, "description": "Set/unset the Ramping Version of a Worker Deployment and its ramp percentage." @@ -8467,13 +10155,81 @@ "type": "string", "title": "Used to de-dupe sent signals" }, - "control": { - "type": "string", - "description": "Deprecated." + "control": { + "type": "string", + "description": "Deprecated." + }, + "header": { + "$ref": "#/definitions/v1Header", + "description": "Headers that are passed with the signal to the processing workflow.\nThese can include things like auth or tracing tokens." + }, + "links": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apicommonv1Link" + }, + "description": "Links to be associated with the WorkflowExecutionSignaled event." + } + }, + "description": "Keep the parameters in sync with:\n - temporal.api.batch.v1.BatchOperationSignal.\n - temporal.api.workflow.v1.PostResetOperation.SignalWorkflow." + }, + "WorkflowServiceStartActivityExecutionBody": { + "type": "object", + "properties": { + "identity": { + "type": "string", + "title": "The identity of the client who initiated this request" + }, + "requestId": { + "type": "string", + "description": "A unique identifier for this start request. Typically UUIDv4." + }, + "activityType": { + "$ref": "#/definitions/v1ActivityType" + }, + "options": { + "$ref": "#/definitions/v1ActivityOptions" + }, + "input": { + "$ref": "#/definitions/v1Payloads", + "description": "Serialized arguments to the activity. These are passed as arguments to the activity function." + }, + "idReusePolicy": { + "$ref": "#/definitions/v1IdReusePolicy", + "description": "Defines whether to allow re-using the activity id from a previously *closed* activity.\nThe default policy is ID_REUSE_POLICY_ALLOW_DUPLICATE." + }, + "idConflictPolicy": { + "$ref": "#/definitions/v1IdConflictPolicy", + "description": "Defines how to resolve an activity id conflict with a *running* activity.\nThe default policy is ID_CONFLICT_POLICY_FAIL." + }, + "memo": { + "$ref": "#/definitions/v1Memo", + "description": "Arbitrary structured data that can be attached to the activity execution and made available via the list and\ndescribe APIs." + }, + "searchAttributes": { + "$ref": "#/definitions/v1SearchAttributes", + "description": "Search attributes for indexing." }, "header": { "$ref": "#/definitions/v1Header", - "description": "Headers that are passed with the signal to the processing workflow.\nThese can include things like auth or tracing tokens." + "description": "Header for context propagation and tracing purposes." + }, + "requestEagerExecution": { + "type": "boolean", + "description": "Request to get the first activity task inline in the response bypassing matching service and worker polling.\nIf set to `true` the caller is expected to have a worker available and capable of processing the task.\nThe returned task will be marked as started and is expected to be completed by the specified\n`schedule_to_close_timeout`." + }, + "completionCallbacks": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Callback" + }, + "description": "Callbacks to be called by the server when this activity reaches a terminal status.\nCallback addresses must be whitelisted in the server's dynamic configuration." + }, + "userMetadata": { + "$ref": "#/definitions/v1UserMetadata", + "description": "Metadata for use by user interfaces to display the fixed as-of-start summary and details of the activity." }, "links": { "type": "array", @@ -8481,10 +10237,17 @@ "type": "object", "$ref": "#/definitions/apicommonv1Link" }, - "description": "Links to be associated with the WorkflowExecutionSignaled event." + "description": "Links to be associated with the activity." + }, + "onConflictOptions": { + "$ref": "#/definitions/apiactivityv1OnConflictOptions", + "description": "Defines actions to be done to the existing running activity when ID_CONFLICT_POLICY_USE_EXISTING is used. If not\nset or empty, it won't do anything to the existing running activity." + }, + "priority": { + "$ref": "#/definitions/v1Priority", + "title": "Priority metadata" } - }, - "description": "Keep the parameters in sync with:\n - temporal.api.batch.v1.BatchOperationSignal.\n - temporal.api.workflow.v1.PostResetOperation.SignalWorkflow." + } }, "WorkflowServiceStartBatchOperationBody": { "type": "object", @@ -8637,7 +10400,7 @@ "description": "If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.\nTo unset the override after the workflow is running, use UpdateWorkflowExecutionOptions." }, "onConflictOptions": { - "$ref": "#/definitions/v1OnConflictOptions", + "$ref": "#/definitions/apiworkflowv1OnConflictOptions", "description": "Defines actions to be done to the existing running workflow when the conflict policy\nWORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING is used. If not set (ie., nil value) or set to a\nempty object (ie., all options with default value), it won't do anything to the existing\nrunning workflow. If set, it will add a history event to the running workflow." }, "priority": { @@ -8659,6 +10422,23 @@ } } }, + "WorkflowServiceTerminateActivityExecutionBody": { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "Activity run ID, targets the latest run if run_id is empty." + }, + "reason": { + "type": "string", + "description": "Reason for requesting the termination, recorded in in the activity's result failure outcome." + }, + "identity": { + "type": "string", + "description": "The identity of the worker/client." + } + } + }, "WorkflowServiceTerminateWorkflowExecutionBody": { "type": "object", "properties": { @@ -8756,7 +10536,76 @@ "type": "string", "description": "If set, the activity will start at a random time within the specified jitter duration." } - } + }, + "description": "Deprecated. See UnpauseActivityExecutionRequest." + }, + "WorkflowServiceUnpauseActivityExecutionBody": { + "type": "object", + "properties": { + "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." + }, + "workflowActivityType": { + "type": "string", + "description": "Unpause all currently paused workflow activities of this type.\nOnly available if workflow_id is provided.\nMutually exclusive with activity_id and all_workflow_activities.\n\nNote: Experimental - the behavior of unpausing by activity type may change or be removed in a future release." + }, + "allWorkflowActivities": { + "type": "boolean", + "description": "Unpause all paused workflow activities.\nOnly available if workflow_id is provided.\nMutually exclusive with activity_id and workflow_activity_type.\n\nNote: Experimental - the behavior of unpausing all activities may change or be removed in a future release." + }, + "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." + }, + "jitter": { + "type": "string", + "description": "If set, the activity will start at a random time within the specified jitter duration." + } + }, + "title": "TODO: update batch" + }, + "WorkflowServiceUpdateActivityExecutionOptionsBody": { + "type": "object", + "properties": { + "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" + }, + "workflowActivityType": { + "type": "string", + "description": "Update all pending workflow activities of this type.\nOnly available if workflow_id is provided.\nMutually exclusive with activity_id and all_workflow_activities.\n\nNote: Experimental - the behavior of updating by activity type may change or be removed in a future release." + }, + "allWorkflowActivities": { + "type": "boolean", + "description": "Update all pending workflow activities.\nOnly available if workflow_id is provided.\nMutually exclusive with activity_id and workflow_activity_type.\n\nNote: Experimental - the behavior of updating all activities may change or be removed in a future release." + }, + "activityOptions": { + "$ref": "#/definitions/v1ActivityOptions", + "description": "Activity options. Partial updates are accepted and controlled by update_mask\nMutually exclusive with restore_original." + }, + "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 defaults.\nDefault options are then options activity was originally created with.\nFor workflow activities the original options are restored from first ActivityTaskScheduled event.\nMutually exclusive with activity_options." + } + }, + "title": "TODO: update batch\nNOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions" }, "WorkflowServiceUpdateActivityOptionsBody": { "type": "object", @@ -8794,7 +10643,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", @@ -8992,6 +10841,24 @@ }, "description": "Keep the parameters in sync with:\n - temporal.api.batch.v1.BatchOperationUpdateWorkflowExecutionOptions.\n - temporal.api.workflow.v1.PostResetOperation.UpdateWorkflowOptions." }, + "apiactivityv1OnConflictOptions": { + "type": "object", + "properties": { + "attachRequestId": { + "type": "boolean", + "description": "Attaches the request ID to the running workflow." + }, + "attachCompletionCallbacks": { + "type": "boolean", + "description": "Attaches the completion callbacks to the running workflow." + }, + "attachLinks": { + "type": "boolean", + "description": "Attaches the links to the WorkflowExecutionOptionsUpdatedEvent history event." + } + }, + "description": "When StartActivityExecution uses the ID_CONFLICT_POLICY_USE_EXISTING and there is already an existing running\nactivity, OnConflictOptions defines actions to be taken on the existing running activity, updating its state." + }, "apicommonv1Link": { "type": "object", "properties": { @@ -9000,6 +10867,9 @@ }, "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." @@ -9136,6 +11006,24 @@ }, "description": "The client request that triggers a Workflow Update." }, + "apiworkflowv1OnConflictOptions": { + "type": "object", + "properties": { + "attachRequestId": { + "type": "boolean", + "description": "Attaches the request ID to the running workflow." + }, + "attachCompletionCallbacks": { + "type": "boolean", + "description": "Attaches the completion callbacks to the running workflow." + }, + "attachLinks": { + "type": "boolean", + "description": "Attaches the links to the WorkflowExecutionOptionsUpdatedEvent history event." + } + }, + "description": "When StartWorkflowExecution uses the conflict policy WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING and\nthere is already an existing running workflow, OnConflictOptions defines actions to be taken on\nthe existing running workflow. In this case, it will create a WorkflowExecutionOptionsUpdatedEvent\nhistory event in the running workflow with the changes requested in this object." + }, "protobufAny": { "type": "object", "properties": { @@ -9166,6 +11054,185 @@ } } }, + "v1ActivityExecutionInfo": { + "type": "object", + "properties": { + "activityId": { + "type": "string", + "description": "Unique identifier of this activity within its namespace along with run ID (below)." + }, + "runId": { + "type": "string" + }, + "activityType": { + "$ref": "#/definitions/v1ActivityType", + "description": "The type of the activity, a string that maps to a registered activity on a worker." + }, + "status": { + "$ref": "#/definitions/v1ActivityExecutionStatus", + "description": "A general status for this activity, indicates whether it is currently running or in one of the terminal statuses." + }, + "runState": { + "$ref": "#/definitions/v1PendingActivityState", + "description": "More detailed breakdown of ACTIVITY_EXECUTION_STATUS_RUNNING." + }, + "heartbeatDetails": { + "$ref": "#/definitions/v1Payloads", + "description": "Details provided in the last recorded activity heartbeat." + }, + "lastHeartbeatTime": { + "type": "string", + "format": "date-time", + "description": "Time the last heartbeat was recorded." + }, + "lastStartedTime": { + "type": "string", + "format": "date-time", + "description": "Time the last attempt was started." + }, + "attempt": { + "type": "integer", + "format": "int32", + "description": "The attempt this activity is currently on.\nIncremented each time a new attempt is started.\nTODO: Confirm if this is on scheduled or started." + }, + "maximumAttempts": { + "type": "integer", + "format": "int32" + }, + "scheduledTime": { + "type": "string", + "format": "date-time", + "description": "Time the activity was originally scheduled via a StartActivityExecution request." + }, + "expirationTime": { + "type": "string", + "format": "date-time", + "description": "Scheduled time + schedule to close timeout." + }, + "lastFailure": { + "$ref": "#/definitions/apifailurev1Failure", + "description": "Failure details from the last failed attempt." + }, + "lastWorkerIdentity": { + "type": "string" + }, + "currentRetryInterval": { + "type": "string", + "description": "Time from the last attempt failure to the next activity retry.\nIf the activity is currently running, this represents the next retry interval in case the attempt fails.\nIf activity is currently backing off between attempt, this represents the current retry interval.\nIf there is no next retry allowed, this field will be null.\nThis interval is typically calculated from the specified retry policy, but may be modified if an activity fails\nwith a retryable application failure specifying a retry delay." + }, + "lastAttemptCompleteTime": { + "type": "string", + "format": "date-time", + "description": "The time when the last activity attempt completed. If activity has not been completed yet, it will be null." + }, + "nextAttemptScheduleTime": { + "type": "string", + "format": "date-time", + "description": "The time when the next activity attempt will be scheduled.\nIf activity is currently scheduled or started, this field will be null." + }, + "lastDeploymentVersion": { + "$ref": "#/definitions/v1WorkerDeploymentVersion", + "description": "The Worker Deployment Version this activity was dispatched to most recently.\nIf nil, the activity has not yet been dispatched or was last dispatched to an unversioned worker." + }, + "priority": { + "$ref": "#/definitions/v1Priority", + "description": "Priority metadata." + }, + "activityOptions": { + "$ref": "#/definitions/v1ActivityOptions", + "description": "Current activity options. May be different from the one used to start the activity." + }, + "input": { + "$ref": "#/definitions/v1Payloads", + "description": "Serialized activity input, passed as arguments to the activity function." + }, + "stateTransitionCount": { + "type": "string", + "format": "int64", + "description": "Incremented each time the activity's state is mutated in persistence." + }, + "searchAttributes": { + "$ref": "#/definitions/v1SearchAttributes" + }, + "header": { + "$ref": "#/definitions/v1Header" + }, + "eagerExecutionRequested": { + "type": "boolean", + "description": "Whether the activity was started with a request_eager_execution flag set to `true`, indicating that the first\ntask was delivered inline in the start response, bypassing matching." + }, + "completionCallbacks": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Callback" + }, + "description": "Callbacks to be called by the server when this activity reaches a terminal status.\nCallback addresses must be whitelisted in the server's dynamic configuration." + }, + "userMetadata": { + "$ref": "#/definitions/v1UserMetadata", + "description": "Metadata for use by user interfaces to display the fixed as-of-start summary and details of the activity." + }, + "links": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apicommonv1Link" + }, + "description": "Links to be associated with the activity." + }, + "canceledReason": { + "type": "string", + "description": "Set if activity cancelation was requested." + }, + "pauseInfo": { + "$ref": "#/definitions/v1ActivityExecutionInfoPauseInfo" + } + }, + "description": "Info for a standalone activity." + }, + "v1ActivityExecutionInfoPauseInfo": { + "type": "object", + "properties": { + "pauseTime": { + "type": "string", + "format": "date-time", + "description": "The time when the activity was paused." + }, + "manual": { + "$ref": "#/definitions/v1ActivityExecutionInfoPauseInfoManual", + "description": "The activity was paused by direct API invocation." + } + }, + "title": "TODO: Move this to a common package?" + }, + "v1ActivityExecutionInfoPauseInfoManual": { + "type": "object", + "properties": { + "identity": { + "type": "string", + "description": "The identity of the actor that paused the activity." + }, + "reason": { + "type": "string", + "description": "Reason for pausing the activity." + } + } + }, + "v1ActivityExecutionStatus": { + "type": "string", + "enum": [ + "ACTIVITY_EXECUTION_STATUS_UNSPECIFIED", + "ACTIVITY_EXECUTION_STATUS_RUNNING", + "ACTIVITY_EXECUTION_STATUS_COMPLETED", + "ACTIVITY_EXECUTION_STATUS_FAILED", + "ACTIVITY_EXECUTION_STATUS_CANCELED", + "ACTIVITY_EXECUTION_STATUS_TERMINATED", + "ACTIVITY_EXECUTION_STATUS_TIMED_OUT" + ], + "default": "ACTIVITY_EXECUTION_STATUS_UNSPECIFIED", + "description": "Status of a standalone activity.\nThe status is updated once, when the activity is originally scheduled, and again when the activity reaches a terminal\nstatus.\nTODO: Should this be a common execution status? Seems like the other archetypes will share this status.\n\n - ACTIVITY_EXECUTION_STATUS_RUNNING: The activity is not in a terminal status. This does not necessarily mean that there is a currently running\nattempt. The activity may be backing off between attempts or waiting for a worker to pick it up.\n - ACTIVITY_EXECUTION_STATUS_COMPLETED: The activity completed successfully.\n - ACTIVITY_EXECUTION_STATUS_FAILED: The activity completed with failure.\n - ACTIVITY_EXECUTION_STATUS_CANCELED: The activity completed as canceled.\nRequesting to cancel an activity does not automatically transition the activity to canceled status. If the\nactivity has a currently running attempt, the activity will only transition to canceled status if the current\nattempt is unsuccessful.\nTODO: Clarify what happens if there are no more allowed retries after the current attempt.\n - ACTIVITY_EXECUTION_STATUS_TERMINATED: The activity was terminated. Termination does not reach the worker and the activity code cannot react to it.\nA terminated activity may have a running attempt and will be requested to be canceled by the server when it\nheartbeats.\n - ACTIVITY_EXECUTION_STATUS_TIMED_OUT: The activity has timed out by reaching the specified shedule-to-start or schedule-to-close timeouts.\nTODO: Clarify if there are other conditions where the activity can end up in timed out status." + }, "v1ActivityFailureInfo": { "type": "object", "properties": { @@ -9191,6 +11258,64 @@ } } }, + "v1ActivityListInfo": { + "type": "object", + "properties": { + "activityId": { + "type": "string", + "description": "For standalone activity - a unique identifier of this activity within its namespace along with run ID (below)." + }, + "runId": { + "type": "string", + "description": "The run ID of the workflow or standalone activity." + }, + "workflowId": { + "type": "string", + "description": "Workflow that contains this activity - only present for workflow activity." + }, + "activityType": { + "$ref": "#/definitions/v1ActivityType", + "description": "The type of the activity, a string that maps to a registered activity on a worker." + }, + "scheduledTime": { + "type": "string", + "format": "date-time", + "title": "Time the activity was originally scheduled via a StartActivityExecution request.\nTODO: Workflows call this schedule_time but it's scheduled_time in PendingActivityInfo, what should we choose for\nconsistency?" + }, + "closeTime": { + "type": "string", + "format": "date-time", + "description": "If the activity is in a terminal status, this field represents the time the activity transitioned to that status." + }, + "status": { + "$ref": "#/definitions/v1ActivityExecutionStatus", + "description": "Only scheduled and terminal statuses appear here. More detailed information in PendingActivityInfo but not\navailable in the list response." + }, + "searchAttributes": { + "$ref": "#/definitions/v1SearchAttributes", + "description": "Search attributes from the start request." + }, + "taskQueue": { + "type": "string", + "description": "The task queue this activity was scheduled on when it was originally started, updated on activity options update." + }, + "stateTransitionCount": { + "type": "string", + "format": "int64", + "description": "Updated on terminal status." + }, + "stateSizeBytes": { + "type": "string", + "format": "int64", + "description": "Updated once on scheduled and once on terminal status." + }, + "executionDuration": { + "type": "string", + "description": "The difference between close time and scheduled time.\nThis field is only populated if the activity is closed." + } + }, + "description": "Limited activity information returned in the list response." + }, "v1ActivityOptions": { "type": "object", "properties": { @@ -9214,7 +11339,8 @@ "description": "Maximum permitted time between successful worker heartbeats." }, "retryPolicy": { - "$ref": "#/definitions/v1RetryPolicy" + "$ref": "#/definitions/v1RetryPolicy", + "description": "The retry policy for the activity. Will never exceed `schedule_to_close_timeout`." } } }, @@ -10481,6 +12607,40 @@ } } }, + "v1CountActivityExecutionsResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64", + "description": "If `query` is not grouping by any field, the count is an approximate number\nof activities that match the query.\nIf `query` is grouping by a field, the count is simply the sum of the counts\nof the groups returned in the response. This number can be smaller than the\ntotal number of activities matching the query." + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1CountActivityExecutionsResponseAggregationGroup" + }, + "description": "Contains the groups if the request is grouping by a field.\nThe list might not be complete, and the counts of each group is approximate." + } + } + }, + "v1CountActivityExecutionsResponseAggregationGroup": { + "type": "object", + "properties": { + "groupValues": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Payload" + } + }, + "count": { + "type": "string", + "format": "int64" + } + } + }, "v1CountWorkflowExecutionsResponse": { "type": "object", "properties": { @@ -10493,12 +12653,28 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/CountWorkflowExecutionsResponseAggregationGroup" + "$ref": "#/definitions/v1CountWorkflowExecutionsResponseAggregationGroup" }, "description": "`groups` contains the groups if the request is grouping by a field.\nThe list might not be complete, and the counts of each group is approximate." } } }, + "v1CountWorkflowExecutionsResponseAggregationGroup": { + "type": "object", + "properties": { + "groupValues": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Payload" + } + }, + "count": { + "type": "string", + "format": "int64" + } + } + }, "v1CreateNexusEndpointRequest": { "type": "object", "properties": { @@ -10551,6 +12727,9 @@ } } }, + "v1DeleteActivityExecutionResponse": { + "type": "object" + }, "v1DeleteNamespaceResponse": { "type": "object", "properties": { @@ -10679,6 +12858,19 @@ "type": "object", "description": "Deprecated." }, + "v1DescribeActivityExecutionResponse": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/v1ActivityExecutionInfo" + }, + "longPollToken": { + "type": "string", + "format": "byte", + "description": "A token that can be passed in via a subsequent `DescribeActivityExecutionRequest` to long poll on the activity\nstate as it makes progress." + } + } + }, "v1DescribeBatchOperationResponse": { "type": "object", "properties": { @@ -10875,6 +13067,14 @@ } } }, + "v1DescribeWorkerResponse": { + "type": "object", + "properties": { + "workerInfo": { + "$ref": "#/definitions/v1WorkerInfo" + } + } + }, "v1DescribeWorkflowExecutionResponse": { "type": "object", "properties": { @@ -11167,6 +13367,23 @@ } } }, + "v1GetActivityExecutionResultResponse": { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "The run ID of the completed activity, may be used in case a run ID was not specified in the request." + }, + "result": { + "$ref": "#/definitions/v1Payloads", + "description": "The result if the activity completed successfully." + }, + "failure": { + "$ref": "#/definitions/apifailurev1Failure", + "description": "The failure if the activity completed unsuccessfully." + } + } + }, "v1GetClusterInfoResponse": { "type": "object", "properties": { @@ -11198,6 +13415,14 @@ }, "visibilityStore": { "type": "string" + }, + "initialFailoverVersion": { + "type": "string", + "format": "int64" + }, + "failoverVersionIncrement": { + "type": "string", + "format": "int64" } }, "description": "GetClusterInfoResponse contains information about Temporal cluster." @@ -11664,6 +13889,28 @@ ], "default": "HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED" }, + "v1IdConflictPolicy": { + "type": "string", + "enum": [ + "ID_CONFLICT_POLICY_UNSPECIFIED", + "ID_CONFLICT_POLICY_FAIL", + "ID_CONFLICT_POLICY_USE_EXISTING", + "ID_CONFLICT_POLICY_TERMINATE_EXISTING" + ], + "default": "ID_CONFLICT_POLICY_UNSPECIFIED", + "description": "Defines what to do when trying to start an execution with the same ID as a *running* execution.\nNote that it is *never* valid to have two actively running instances of the same execution ID.\n\nSee `IdReusePolicy` for handling execution ID duplication with a *closed* execution.\n\n - ID_CONFLICT_POLICY_FAIL: Don't start a new execution; instead return `ExecutionAlreadyStarted` error.\n - ID_CONFLICT_POLICY_USE_EXISTING: Don't start a new execution; instead return a handle for the running execution.\n - ID_CONFLICT_POLICY_TERMINATE_EXISTING: Terminate the running execution before starting a new one." + }, + "v1IdReusePolicy": { + "type": "string", + "enum": [ + "ID_REUSE_POLICY_UNSPECIFIED", + "ID_REUSE_POLICY_ALLOW_DUPLICATE", + "ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY", + "ID_REUSE_POLICY_REJECT_DUPLICATE" + ], + "default": "ID_REUSE_POLICY_UNSPECIFIED", + "description": "Defines whether to allow re-using an ID from a previously *closed* execution.\nIf the request is denied, the server returns an `ExecutionAlreadyStarted` error.\n\nSee `IdConflictPolicy` for handling ID duplication with a *running* execution.\n\n - ID_REUSE_POLICY_ALLOW_DUPLICATE: Always allow starting an execution using the same entity ID.\n - ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY: Allow starting an execution using the same ID, only when the last execution's final state is one of [terminated,\ncancelled, timed out, failed].\n - ID_REUSE_POLICY_REJECT_DUPLICATE: Do not permit re-use of the ID for this execution. Future start requests could potentially change the policy,\nallowing re-use of the ID." + }, "v1IndexedValueType": { "type": "string", "enum": [ @@ -11707,6 +13954,23 @@ }, "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." }, + "v1ListActivityExecutionsResponse": { + "type": "object", + "properties": { + "executions": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ActivityListInfo" + } + }, + "nextPageToken": { + "type": "string", + "format": "byte", + "description": "Token to use to fetch the next page. If empty, there is no next page." + } + } + }, "v1ListArchivedWorkflowExecutionsResponse": { "type": "object", "properties": { @@ -12167,6 +14431,14 @@ "asyncUpdate": { "type": "boolean", "title": "True if the namespace supports async update" + }, + "workerHeartbeats": { + "type": "boolean", + "title": "True if the namespace supports worker heartbeats" + }, + "reportedProblemsSearchAttribute": { + "type": "boolean", + "title": "True if the namespace supports reported problems search attribute" } }, "description": "Namespace capability details. Should contain what features are enabled in a namespace." @@ -12571,24 +14843,6 @@ }, "description": "Nexus operation timed out." }, - "v1OnConflictOptions": { - "type": "object", - "properties": { - "attachRequestId": { - "type": "boolean", - "description": "Attaches the request ID to the running workflow." - }, - "attachCompletionCallbacks": { - "type": "boolean", - "description": "Attaches the completion callbacks to the running workflow." - }, - "attachLinks": { - "type": "boolean", - "description": "Attaches the links to the WorkflowExecutionOptionsUpdatedEvent history event." - } - }, - "description": "When StartWorkflowExecution uses the conflict policy WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING and\nthere is already an existing running workflow, OnConflictOptions defines actions to be taken on\nthe existing running workflow. In this case, it will create a WorkflowExecutionOptionsUpdatedEvent\nhistory event in the running workflow with the changes requested in this object." - }, "v1Outcome": { "type": "object", "properties": { @@ -12616,9 +14870,13 @@ "v1PatchScheduleResponse": { "type": "object" }, - "v1PauseActivityResponse": { + "v1PauseActivityExecutionResponse": { "type": "object" }, + "v1PauseActivityResponse": { + "type": "object", + "description": "Deprecated. See PauseActivityExecutionResponse." + }, "v1Payload": { "description": "Arbitrary payload data in an unconstrained format.\nThis may be activity input parameters, a workflow result, a memo, etc.\n" }, @@ -12728,7 +14986,7 @@ "title": "Priority metadata" }, "pauseInfo": { - "$ref": "#/definitions/PendingActivityInfoPauseInfo" + "$ref": "#/definitions/v1PendingActivityInfoPauseInfo" }, "activityOptions": { "$ref": "#/definitions/v1ActivityOptions", @@ -12736,6 +14994,37 @@ } } }, + "v1PendingActivityInfoPauseInfo": { + "type": "object", + "properties": { + "pauseTime": { + "type": "string", + "format": "date-time", + "description": "The time when the activity was paused." + }, + "manual": { + "$ref": "#/definitions/v1PendingActivityInfoPauseInfoManual", + "title": "activity was paused by the manual intervention" + }, + "rule": { + "$ref": "#/definitions/PauseInfoRule", + "title": "activity was paused by the rule" + } + } + }, + "v1PendingActivityInfoPauseInfoManual": { + "type": "object", + "properties": { + "identity": { + "type": "string", + "description": "The identity of the actor that paused the activity." + }, + "reason": { + "type": "string", + "description": "Reason for pausing the activity." + } + } + }, "v1PendingActivityState": { "type": "string", "enum": [ @@ -12924,7 +15213,7 @@ }, "activityId": { "type": "string", - "description": "The autogenerated or user specified identifier of this activity. Can be used to complete the\nactivity via `RespondActivityTaskCompletedById`. May be re-used as long as the last usage\nhas resolved, but unique IDs for every activity invocation is a good idea." + "description": "The autogenerated or user specified identifier of this activity. Can be used to complete the\nactivity via `RespondActivityTaskCompletedById`. May be re-used as long as the last usage\nhas resolved, but unique IDs for every activity invocation is a good idea.\nNote that only a workflow activity ID may be autogenerated." }, "header": { "$ref": "#/definitions/v1Header", @@ -13154,7 +15443,7 @@ "priorityKey": { "type": "integer", "format": "int32", - "description": "Priority key is a positive integer from 1 to n, where smaller integers\ncorrespond to higher priorities (tasks run sooner). In general, tasks in\na queue should be processed in close to priority order, although small\ndeviations are possible.\n\nThe maximum priority value (minimum priority) is determined by server\nconfiguration, and defaults to 5.\n\nIf priority is not present (or zero), then the effective priority will be\nthe default priority, which is is calculated by (min+max)/2. With the\ndefault max of 5, and min of 1, that comes out to 3." + "description": "Priority key is a positive integer from 1 to n, where smaller integers\ncorrespond to higher priorities (tasks run sooner). In general, tasks in\na queue should be processed in close to priority order, although small\ndeviations are possible.\n\nThe maximum priority value (minimum priority) is determined by server\nconfiguration, and defaults to 5.\n\nIf priority is not present (or zero), then the effective priority will be\nthe default priority, which is calculated by (min+max)/2. With the\ndefault max of 5, and min of 1, that comes out to 3." }, "fairnessKey": { "type": "string", @@ -13424,6 +15713,9 @@ ], "default": "REPLICATION_STATE_UNSPECIFIED" }, + "v1RequestCancelActivityExecutionResponse": { + "type": "object" + }, "v1RequestCancelActivityTaskCommandAttributes": { "type": "object", "properties": { @@ -13556,9 +15848,13 @@ }, "description": "RequestIdInfo contains details of a request ID." }, - "v1ResetActivityResponse": { + "v1ResetActivityExecutionResponse": { "type": "object" }, + "v1ResetActivityResponse": { + "type": "object", + "description": "Deprecated. See ResetActivityExecutionResponse." + }, "v1ResetOptions": { "type": "object", "properties": { @@ -14343,6 +16639,20 @@ } } }, + "v1SetWorkerDeploymentManagerResponse": { + "type": "object", + "properties": { + "conflictToken": { + "type": "string", + "format": "byte", + "description": "This value is returned so that it can be optionally passed to APIs\nthat write to the Worker Deployment state to ensure that the state\ndid not change between this API call and a future write." + }, + "previousManagerIdentity": { + "type": "string", + "description": "What the `manager_identity` field was before this change." + } + } + }, "v1SetWorkerDeploymentRampingVersionResponse": { "type": "object", "properties": { @@ -14507,6 +16817,27 @@ "v1SignalWorkflowExecutionResponse": { "type": "object" }, + "v1StartActivityExecutionResponse": { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "The run ID of the activity that was started - or used (via ID_CONFLICT_POLICY_USE_EXISTING)." + }, + "started": { + "type": "boolean", + "description": "If true, a new activity was started." + }, + "eagerTask": { + "$ref": "#/definitions/v1PollActivityTaskQueueResponse", + "description": "When `request_eager_execution` is set on the `StartActivityExecutionRequest`, the server will return the first\nactivity task to be eagerly executed.\nThe caller is expected to have a worker available to process the task." + }, + "link": { + "$ref": "#/definitions/apicommonv1Link", + "description": "Link to the workflow event." + } + } + }, "v1StartBatchOperationResponse": { "type": "object" }, @@ -14885,7 +17216,7 @@ "description": "If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.\nTo unset the override after the workflow is running, use UpdateWorkflowExecutionOptions." }, "onConflictOptions": { - "$ref": "#/definitions/v1OnConflictOptions", + "$ref": "#/definitions/apiworkflowv1OnConflictOptions", "description": "Defines actions to be done to the existing running workflow when the conflict policy\nWORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING is used. If not set (ie., nil value) or set to a\nempty object (ie., all options with default value), it won't do anything to the existing\nrunning workflow. If set, it will add a history event to the running workflow." }, "priority": { @@ -15257,6 +17588,9 @@ "default": "TASK_REACHABILITY_UNSPECIFIED", "description": "Specifies which category of tasks may reach a worker on a versioned task queue.\nUsed both in a reachability query and its response.\nDeprecated.\n\n - TASK_REACHABILITY_NEW_WORKFLOWS: There's a possiblity for a worker to receive new workflow tasks. Workers should *not* be retired.\n - TASK_REACHABILITY_EXISTING_WORKFLOWS: There's a possiblity for a worker to receive existing workflow and activity tasks from existing workflows. Workers\nshould *not* be retired.\nThis enum value does not distinguish between open and closed workflows.\n - TASK_REACHABILITY_OPEN_WORKFLOWS: There's a possiblity for a worker to receive existing workflow and activity tasks from open workflows. Workers\nshould *not* be retired.\n - TASK_REACHABILITY_CLOSED_WORKFLOWS: There's a possiblity for a worker to receive existing workflow tasks from closed workflows. Workers may be\nretired dependending on application requirements. For example, if there's no need to query closed workflows." }, + "v1TerminateActivityExecutionResponse": { + "type": "object" + }, "v1TerminateWorkflowExecutionResponse": { "type": "object" }, @@ -15387,9 +17721,13 @@ } } }, - "v1UnpauseActivityResponse": { + "v1UnpauseActivityExecutionResponse": { "type": "object" }, + "v1UnpauseActivityResponse": { + "type": "object", + "description": "Deprecated. See UnpauseActivityExecutionResponse." + }, "v1UnsuccessfulOperationError": { "type": "object", "properties": { @@ -15402,7 +17740,7 @@ } } }, - "v1UpdateActivityOptionsResponse": { + "v1UpdateActivityExecutionOptionsResponse": { "type": "object", "properties": { "activityOptions": { @@ -15411,6 +17749,16 @@ } } }, + "v1UpdateActivityOptionsResponse": { + "type": "object", + "properties": { + "activityOptions": { + "$ref": "#/definitions/v1ActivityOptions", + "title": "Activity options after an update" + } + }, + "description": "Deprecated. See UpdateActivityExecutionOptionsResponse." + }, "v1UpdateAdmittedEventOrigin": { "type": "string", "enum": [ @@ -15453,7 +17801,7 @@ "additionalProperties": { "type": "string" }, - "description": "A key-value map for any customized purpose.\nIf data already exists on the namespace, \nthis will merge with the existing key values." + "description": "A key-value map for any customized purpose.\nIf data already exists on the namespace,\nthis will merge with the existing key values." }, "state": { "$ref": "#/definitions/v1NamespaceState", @@ -15812,6 +18160,10 @@ "lastModifierIdentity": { "type": "string", "description": "Identity of the last client who modified the configuration of this Deployment. Set to the\n`identity` value sent by APIs such as `SetWorkerDeploymentCurrentVersion` and\n`SetWorkerDeploymentRampingVersion`." + }, + "managerIdentity": { + "type": "string", + "description": "Identity of the client that has the exclusive right to make changes to this Worker Deployment.\nEmpty by default.\nIf this is set, clients whose identity does not match `manager_identity` will not be able to make changes\nto this Worker Deployment. They can either set their own identity as the manager or unset the field to proceed." } }, "description": "A Worker Deployment (Deployment, for short) represents all workers serving \na shared set of Task Queues. Typically, a Deployment represents one service or \napplication.\nA Deployment contains multiple Deployment Versions, each representing a different \nversion of workers. (see documentation of WorkerDeploymentVersionInfo)\nDeployment records are created in Temporal server automatically when their\nfirst poller arrives to the server.\nExperimental. Worker Deployments are experimental and might significantly change in the future." diff --git a/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml b/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml index 7d587b366..5467c53be 100644 --- a/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml +++ b/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml @@ -93,6 +93,190 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/activities/{activityId}/pause: + post: + tags: + - WorkflowService + description: |- + PauseActivityExecution 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 + operationId: PauseActivityExecution + parameters: + - 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/activities/{activityId}/reset: + post: + tags: + - WorkflowService + description: |- + ResetActivityExecution 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. + + 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: activityId + in: path + description: |- + Reset an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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/activities/{activityId}/unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivityExecution 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 + operationId: UnpauseActivityExecution + parameters: + - name: activityId + in: path + description: |- + Unpause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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/activities/{activityId}/update-options: + post: + tags: + - WorkflowService + description: |- + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID or type. + If there are multiple pending activities of the provided type - all of them will be updated. + operationId: UpdateActivityExecutionOptions + parameters: + - name: activityId + in: path + description: |- + Update options for an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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}: get: tags: @@ -122,6 +306,48 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities: + get: + tags: + - WorkflowService + description: ListActivityExecutions is a visibility API to list activity executions in a specific namespace. + operationId: ListActivityExecutions + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: pageSize + in: query + description: Max number of executions to return per page. + schema: + type: integer + format: int32 + - name: nextPageToken + in: query + description: Token returned in ListActivityExecutionsResponse. + schema: + type: string + format: bytes + - name: query + in: query + description: Visibility query, see https://docs.temporal.io/list-filter for the syntax. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListActivityExecutionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activities/cancel: post: tags: @@ -437,6 +663,7 @@ paths: - The activity should respond to the cancellation accordingly. Returns a `NotFound` error if there is no pending activity with the provided ID or type + Deprecated. See PauseActivityExecution. operationId: PauseActivity parameters: - name: namespace @@ -486,6 +713,7 @@ paths: '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. + Deprecated. See ResetActivityExecution. operationId: ResetActivity parameters: - name: namespace @@ -531,6 +759,7 @@ paths: '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 + Deprecated. See UnpauseActivityExecution. operationId: UnpauseActivity parameters: - name: namespace @@ -565,6 +794,7 @@ paths: description: |- UpdateActivityOptions is called by the client to update the options of an activity by its ID or type. If there are multiple pending activities of the provided type - all of them will be updated. + Deprecated. See UpdateActivityExecutionOptions. operationId: UpdateActivityOptions parameters: - name: namespace @@ -592,134 +822,378 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/archived-workflows: + /api/v1/namespaces/{namespace}/activities/{activityId}: get: tags: - WorkflowService - description: ListArchivedWorkflowExecutions is a visibility API to list archived workflow executions in a specific namespace. - operationId: ListArchivedWorkflowExecutions + description: |- + DescribeActivityExecution returns information about the specified activity execution. + Pass in a long_poll_token to turn this request into a long poll that gets unblocked when the activity makes + progress. + In case the activity has not made progress by the time the long poll request times out, an empty response is + returned and the caller may issue an identical DescribeActivityExecution request to continue polling. + operationId: DescribeActivityExecution parameters: - name: namespace in: path required: true schema: type: string - - name: pageSize - in: query + - name: activityId + in: path + required: true schema: - type: integer - format: int32 - - name: nextPageToken + type: string + - name: runId in: query + description: Activity run ID, targets the latest run if run_id is empty. schema: type: string - format: bytes - - name: query + - name: includeInput + in: query + description: If true, the activity input is returned in the response. + schema: + type: boolean + - name: longPollToken in: query + description: |- + If not empty, turns this request into a long poll that is unblocked when the activity state changes from the time + the token was returned. + This token is returned as part of the `DescribeActivityExecutionResponse`. schema: type: string + format: bytes responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/ListArchivedWorkflowExecutionsResponse' + $ref: '#/components/schemas/DescribeActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/batch-operations: - get: + post: tags: - WorkflowService - description: ListBatchOperations returns a list of batch operations - operationId: ListBatchOperations + description: |- + StartActivityExecution starts a new activity execution. + + Returns an `ExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace + unless permitted by the specified ID conflict policy. + operationId: StartActivityExecution parameters: - name: namespace in: path - description: Namespace that contains the batch operation required: true schema: type: string - - name: pageSize - in: query - description: List page size - schema: - type: integer - format: int32 - - name: nextPageToken - in: query - description: Next page token + - name: activityId + in: path + required: true schema: type: string - format: bytes + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartActivityExecutionRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/ListBatchOperationsResponse' + $ref: '#/components/schemas/StartActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/batch-operations/{jobId}: - get: + /api/v1/namespaces/{namespace}/activities/{activityId}/cancel: + post: tags: - WorkflowService - description: DescribeBatchOperation returns the information about a batch operation - operationId: DescribeBatchOperation + description: "RequestCancelActivityExecution requests cancellation of an activity execution.\n\n Requesting to cancel an activity does not automatically transition the activity to canceled status. If the\n activity has a currently running attempt, the activity will only transition to canceled status if the current\n attempt is unsuccessful.\n TODO: Clarify what happens if there are no more allowed retries after the current attempt.\n \n It returns success if the requested activity is already closed.\n TODO: This ^^ is copied from RequestCancelWorkflowExecution, do we want to preserve this behavior?" + operationId: RequestCancelActivityExecution parameters: - name: namespace in: path - description: Namespace that contains the batch operation required: true schema: type: string - - name: jobId + - name: activityId in: path - description: Batch job id required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequestCancelActivityExecutionRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/DescribeBatchOperationResponse' + $ref: '#/components/schemas/RequestCancelActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - post: + /api/v1/namespaces/{namespace}/activities/{activityId}/result: + get: tags: - WorkflowService - description: StartBatchOperation starts a new batch operation - operationId: StartBatchOperation + description: |- + GetActivityExecutionResult returns the activity result if it is in a terminal status or (optionally) wait for it + to reach one. + operationId: GetActivityExecutionResult parameters: - name: namespace in: path - description: Namespace that contains the batch operation required: true schema: type: string - - name: jobId + - name: activityId in: path - description: Job ID defines the unique ID for the batch job required: true schema: type: string - requestBody: + - name: runId + in: query + description: Activity run ID, targets the latest run if run_id is empty. + schema: + type: string + - name: wait + in: query + description: |- + If set, turns this request into a long poll that is unblocked when the activity reaches a terminal status. + The wait duration is capped by the request's context deadline or by the maximum enforced long poll interval + allowed by the server. + schema: + type: boolean + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetActivityExecutionResultResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/terminate: + post: + tags: + - WorkflowService + description: |- + TerminateActivityExecution terminates an existing activity execution immediately. + + Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a + running attempt and will be requested to be canceled by the server when it heartbeats. + operationId: TerminateActivityExecution + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activityId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activity-count: + get: + tags: + - WorkflowService + description: CountActivityExecutions is a visibility API to count of activity executions in a specific namespace. + operationId: CountActivityExecutions + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: query + in: query + description: Visibility query, see https://docs.temporal.io/list-filter for the syntax. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CountActivityExecutionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/archived-workflows: + get: + tags: + - WorkflowService + description: ListArchivedWorkflowExecutions is a visibility API to list archived workflow executions in a specific namespace. + operationId: ListArchivedWorkflowExecutions + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: pageSize + in: query + schema: + type: integer + format: int32 + - name: nextPageToken + in: query + schema: + type: string + format: bytes + - name: query + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListArchivedWorkflowExecutionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/batch-operations: + get: + tags: + - WorkflowService + description: ListBatchOperations returns a list of batch operations + operationId: ListBatchOperations + parameters: + - name: namespace + in: path + description: Namespace that contains the batch operation + required: true + schema: + type: string + - name: pageSize + in: query + description: List page size + schema: + type: integer + format: int32 + - name: nextPageToken + in: query + description: Next page token + schema: + type: string + format: bytes + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListBatchOperationsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/batch-operations/{jobId}: + get: + tags: + - WorkflowService + description: DescribeBatchOperation returns the information about a batch operation + operationId: DescribeBatchOperation + parameters: + - name: namespace + in: path + description: Namespace that contains the batch operation + required: true + schema: + type: string + - name: jobId + in: path + description: Batch job id + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeBatchOperationResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - WorkflowService + description: StartBatchOperation starts a new batch operation + operationId: StartBatchOperation + parameters: + - name: namespace + in: path + description: Namespace that contains the batch operation + required: true + schema: + type: string + - name: jobId + in: path + description: Job ID defines the unique ID for the batch job + required: true + schema: + type: string + requestBody: content: application/json: schema: @@ -1914,6 +2388,44 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/worker-deployments/{deploymentName}/set-manager: + post: + tags: + - WorkflowService + description: |- + Set/unset the ManagerIdentity of a Worker Deployment. + Experimental. This API might significantly change or be removed in a future release. + operationId: SetWorkerDeploymentManager + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deploymentName + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SetWorkerDeploymentManagerRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SetWorkerDeploymentManagerResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/worker-deployments/{deploymentName}/set-ramping-version: post: tags: @@ -2087,12 +2599,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workers/fetch-config: - post: + /api/v1/namespaces/{namespace}/workers/describe/{workerInstanceKey}: + get: tags: - WorkflowService - description: FetchWorkerConfig returns the worker configuration for a specific worker. - operationId: FetchWorkerConfig + description: DescribeWorker returns information about the specified worker. + operationId: DescribeWorker parameters: - name: namespace in: path @@ -2100,30 +2612,62 @@ paths: required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FetchWorkerConfigRequest' - required: true + - name: workerInstanceKey + in: path + description: Worker instance key to describe. + required: true + schema: + type: string responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/FetchWorkerConfigResponse' + $ref: '#/components/schemas/DescribeWorkerResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workers/heartbeat: + /api/v1/namespaces/{namespace}/workers/fetch-config: post: tags: - WorkflowService - description: WorkerHeartbeat receive heartbeat request from the worker. + description: FetchWorkerConfig returns the worker configuration for a specific worker. + operationId: FetchWorkerConfig + parameters: + - name: namespace + in: path + description: Namespace this worker belongs to. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FetchWorkerConfigRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/FetchWorkerConfigResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workers/heartbeat: + post: + tags: + - WorkflowService + description: WorkerHeartbeat receive heartbeat request from the worker. operationId: RecordWorkerHeartbeat parameters: - name: namespace @@ -2540,7 +3084,10 @@ paths: get: tags: - WorkflowService - description: "GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse \n order (starting from last event). Fails with`NotFound` if the specified workflow execution is \n unknown to the service." + description: |- + GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse + order (starting from last event). Fails with`NotFound` if the specified workflow execution is + unknown to the service. operationId: GetWorkflowExecutionHistoryReverse parameters: - name: namespace @@ -2706,6 +3253,246 @@ 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 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 + 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 or type. + If there are multiple pending activities of the provided type - all of them will be reset. + + 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, reset 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: |- + Reset an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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}/unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivityExecution 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 + 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, unpause 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: |- + Unpause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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 or type. + If there are multiple pending activities of the provided type - all of them will be updated. + 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, update options for 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: |- + Update options for an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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}/signal-with-start/{signalName}: post: tags: @@ -3531,19 +4318,245 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/cancel: + /namespaces/activities/{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 or type. + If there are multiple pending activities of the provided type - all of them will be paused - 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 or type + operationId: PauseActivityExecution parameters: - - name: namespace + - 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/activities/{activityId}/reset: + post: + tags: + - WorkflowService + description: |- + ResetActivityExecution 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. + + 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: activityId + in: path + description: |- + Reset an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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/activities/{activityId}/unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivityExecution 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 + operationId: UnpauseActivityExecution + parameters: + - name: activityId + in: path + description: |- + Unpause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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/activities/{activityId}/update-options: + post: + tags: + - WorkflowService + description: |- + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID or type. + If there are multiple pending activities of the provided type - all of them will be updated. + operationId: UpdateActivityExecutionOptions + parameters: + - name: activityId + in: path + description: |- + Update options for an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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}/activities: + get: + tags: + - WorkflowService + description: ListActivityExecutions is a visibility API to list activity executions in a specific namespace. + operationId: ListActivityExecutions + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: pageSize + in: query + description: Max number of executions to return per page. + schema: + type: integer + format: int32 + - name: nextPageToken + in: query + description: Token returned in ListActivityExecutionsResponse. + schema: + type: string + format: bytes + - name: query + in: query + description: Visibility query, see https://docs.temporal.io/list-filter for the syntax. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListActivityExecutionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/cancel: + post: + tags: + - WorkflowService + description: |- + RespondActivityTaskFailed is called by workers when processing an activity task fails. + + 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 required: true schema: @@ -3846,6 +4859,7 @@ paths: - The activity should respond to the cancellation accordingly. Returns a `NotFound` error if there is no pending activity with the provided ID or type + Deprecated. See PauseActivityExecution. operationId: PauseActivity parameters: - name: namespace @@ -3895,6 +4909,7 @@ paths: '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. + Deprecated. See ResetActivityExecution. operationId: ResetActivity parameters: - name: namespace @@ -3940,6 +4955,7 @@ paths: '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 + Deprecated. See UnpauseActivityExecution. operationId: UnpauseActivity parameters: - name: namespace @@ -3974,6 +4990,7 @@ paths: description: |- UpdateActivityOptions is called by the client to update the options of an activity by its ID or type. If there are multiple pending activities of the provided type - all of them will be updated. + Deprecated. See UpdateActivityExecutionOptions. operationId: UpdateActivityOptions parameters: - name: namespace @@ -4001,67 +5018,44 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/archived-workflows: + /namespaces/{namespace}/activities/{activityId}: get: tags: - WorkflowService - description: ListArchivedWorkflowExecutions is a visibility API to list archived workflow executions in a specific namespace. - operationId: ListArchivedWorkflowExecutions + description: |- + DescribeActivityExecution returns information about the specified activity execution. + Pass in a long_poll_token to turn this request into a long poll that gets unblocked when the activity makes + progress. + In case the activity has not made progress by the time the long poll request times out, an empty response is + returned and the caller may issue an identical DescribeActivityExecution request to continue polling. + operationId: DescribeActivityExecution parameters: - name: namespace in: path required: true schema: type: string - - name: pageSize - in: query - schema: - type: integer - format: int32 - - name: nextPageToken - in: query + - name: activityId + in: path + required: true schema: type: string - format: bytes - - name: query + - name: runId in: query + description: Activity run ID, targets the latest run if run_id is empty. schema: type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListArchivedWorkflowExecutionsResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/batch-operations: - get: - tags: - - WorkflowService - description: ListBatchOperations returns a list of batch operations - operationId: ListBatchOperations - parameters: - - name: namespace - in: path - description: Namespace that contains the batch operation - required: true - schema: - type: string - - name: pageSize + - name: includeInput in: query - description: List page size + description: If true, the activity input is returned in the response. schema: - type: integer - format: int32 - - name: nextPageToken + type: boolean + - name: longPollToken in: query - description: Next page token + description: |- + If not empty, turns this request into a long poll that is unblocked when the activity state changes from the time + the token was returned. + This token is returned as part of the `DescribeActivityExecutionResponse`. schema: type: string format: bytes @@ -4071,60 +5065,66 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListBatchOperationsResponse' + $ref: '#/components/schemas/DescribeActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/batch-operations/{jobId}: - get: + post: tags: - WorkflowService - description: DescribeBatchOperation returns the information about a batch operation - operationId: DescribeBatchOperation + description: |- + StartActivityExecution starts a new activity execution. + + Returns an `ExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace + unless permitted by the specified ID conflict policy. + operationId: StartActivityExecution parameters: - name: namespace in: path - description: Namespace that contains the batch operation required: true schema: type: string - - name: jobId + - name: activityId in: path - description: Batch job id required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartActivityExecutionRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/DescribeBatchOperationResponse' + $ref: '#/components/schemas/StartActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/cancel: post: tags: - WorkflowService - description: StartBatchOperation starts a new batch operation - operationId: StartBatchOperation + description: "RequestCancelActivityExecution requests cancellation of an activity execution.\n\n Requesting to cancel an activity does not automatically transition the activity to canceled status. If the\n activity has a currently running attempt, the activity will only transition to canceled status if the current\n attempt is unsuccessful.\n TODO: Clarify what happens if there are no more allowed retries after the current attempt.\n \n It returns success if the requested activity is already closed.\n TODO: This ^^ is copied from RequestCancelWorkflowExecution, do we want to preserve this behavior?" + operationId: RequestCancelActivityExecution parameters: - name: namespace in: path - description: Namespace that contains the batch operation required: true schema: type: string - - name: jobId + - name: activityId in: path - description: Job ID defines the unique ID for the batch job required: true schema: type: string @@ -4132,7 +5132,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartBatchOperationRequest' + $ref: '#/components/schemas/RequestCancelActivityExecutionRequest' required: true responses: "200": @@ -4140,18 +5140,279 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartBatchOperationResponse' + $ref: '#/components/schemas/RequestCancelActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/batch-operations/{jobId}/stop: - post: + /namespaces/{namespace}/activities/{activityId}/result: + get: tags: - WorkflowService - description: StopBatchOperation stops a batch operation + description: |- + GetActivityExecutionResult returns the activity result if it is in a terminal status or (optionally) wait for it + to reach one. + operationId: GetActivityExecutionResult + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activityId + in: path + required: true + schema: + type: string + - name: runId + in: query + description: Activity run ID, targets the latest run if run_id is empty. + schema: + type: string + - name: wait + in: query + description: |- + If set, turns this request into a long poll that is unblocked when the activity reaches a terminal status. + The wait duration is capped by the request's context deadline or by the maximum enforced long poll interval + allowed by the server. + schema: + type: boolean + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetActivityExecutionResultResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/terminate: + post: + tags: + - WorkflowService + description: |- + TerminateActivityExecution terminates an existing activity execution immediately. + + Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a + running attempt and will be requested to be canceled by the server when it heartbeats. + operationId: TerminateActivityExecution + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activityId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activity-count: + get: + tags: + - WorkflowService + description: CountActivityExecutions is a visibility API to count of activity executions in a specific namespace. + operationId: CountActivityExecutions + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: query + in: query + description: Visibility query, see https://docs.temporal.io/list-filter for the syntax. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CountActivityExecutionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/archived-workflows: + get: + tags: + - WorkflowService + description: ListArchivedWorkflowExecutions is a visibility API to list archived workflow executions in a specific namespace. + operationId: ListArchivedWorkflowExecutions + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: pageSize + in: query + schema: + type: integer + format: int32 + - name: nextPageToken + in: query + schema: + type: string + format: bytes + - name: query + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListArchivedWorkflowExecutionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/batch-operations: + get: + tags: + - WorkflowService + description: ListBatchOperations returns a list of batch operations + operationId: ListBatchOperations + parameters: + - name: namespace + in: path + description: Namespace that contains the batch operation + required: true + schema: + type: string + - name: pageSize + in: query + description: List page size + schema: + type: integer + format: int32 + - name: nextPageToken + in: query + description: Next page token + schema: + type: string + format: bytes + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListBatchOperationsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/batch-operations/{jobId}: + get: + tags: + - WorkflowService + description: DescribeBatchOperation returns the information about a batch operation + operationId: DescribeBatchOperation + parameters: + - name: namespace + in: path + description: Namespace that contains the batch operation + required: true + schema: + type: string + - name: jobId + in: path + description: Batch job id + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeBatchOperationResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - WorkflowService + description: StartBatchOperation starts a new batch operation + operationId: StartBatchOperation + parameters: + - name: namespace + in: path + description: Namespace that contains the batch operation + required: true + schema: + type: string + - name: jobId + in: path + description: Job ID defines the unique ID for the batch job + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartBatchOperationRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StartBatchOperationResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/batch-operations/{jobId}/stop: + post: + tags: + - WorkflowService + description: StopBatchOperation stops a batch operation operationId: StopBatchOperation parameters: - name: namespace @@ -5265,15 +6526,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/worker-deployments/{deploymentName}/set-ramping-version: + /namespaces/{namespace}/worker-deployments/{deploymentName}/set-manager: post: tags: - WorkflowService description: |- - Set/unset the Ramping Version of a Worker Deployment and its ramp percentage. Can be used for - gradual ramp to unversioned workers too. + Set/unset the ManagerIdentity of a Worker Deployment. Experimental. This API might significantly change or be removed in a future release. - operationId: SetWorkerDeploymentRampingVersion + operationId: SetWorkerDeploymentManager parameters: - name: namespace in: path @@ -5289,7 +6549,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SetWorkerDeploymentRampingVersionRequest' + $ref: '#/components/schemas/SetWorkerDeploymentManagerRequest' required: true responses: "200": @@ -5297,26 +6557,65 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SetWorkerDeploymentRampingVersionResponse' + $ref: '#/components/schemas/SetWorkerDeploymentManagerResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/worker-task-reachability: - get: + /namespaces/{namespace}/worker-deployments/{deploymentName}/set-ramping-version: + post: tags: - WorkflowService description: |- - Deprecated. Use `DescribeTaskQueue`. - - Fetches task reachability to determine whether a worker may be retired. - The request may specify task queues to query for or let the server fetch all task queues mapped to the given - build IDs. - - When requesting a large number of task queues or all task queues associated with the given build ids in a - namespace, all task queues will be listed in the response but some of them may not contain reachability + Set/unset the Ramping Version of a Worker Deployment and its ramp percentage. Can be used for + gradual ramp to unversioned workers too. + Experimental. This API might significantly change or be removed in a future release. + operationId: SetWorkerDeploymentRampingVersion + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deploymentName + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SetWorkerDeploymentRampingVersionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SetWorkerDeploymentRampingVersionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/worker-task-reachability: + get: + tags: + - WorkflowService + description: |- + Deprecated. Use `DescribeTaskQueue`. + + Fetches task reachability to determine whether a worker may be retired. + The request may specify task queues to query for or let the server fetch all task queues mapped to the given + build IDs. + + When requesting a large number of task queues or all task queues associated with the given build ids in a + namespace, all task queues will be listed in the response but some of them may not contain reachability information due to a server enforced limit. When reaching the limit, task queues that reachability information could not be retrieved for will be marked with a single TASK_REACHABILITY_UNSPECIFIED entry. The caller may issue another call to get the reachability for those task queues. @@ -5438,6 +6737,38 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workers/describe/{workerInstanceKey}: + get: + tags: + - WorkflowService + description: DescribeWorker returns information about the specified worker. + operationId: DescribeWorker + parameters: + - name: namespace + in: path + description: Namespace this worker belongs to. + required: true + schema: + type: string + - name: workerInstanceKey + in: path + description: Worker instance key to describe. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeWorkerResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/workers/fetch-config: post: tags: @@ -5891,7 +7222,10 @@ paths: get: tags: - WorkflowService - description: "GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse \n order (starting from last event). Fails with`NotFound` if the specified workflow execution is \n unknown to the service." + description: |- + GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse + order (starting from last event). Fails with`NotFound` if the specified workflow execution is + unknown to the service. operationId: GetWorkflowExecutionHistoryReverse parameters: - name: namespace @@ -6057,6 +7391,246 @@ 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 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 + 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 or type. + If there are multiple pending activities of the provided type - all of them will be reset. + + 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, reset 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: |- + Reset an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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}/unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivityExecution 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 + 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, unpause 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: |- + Unpause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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 or type. + If there are multiple pending activities of the provided type - all of them will be updated. + 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, update options for 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: |- + Update options for an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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}/signal-with-start/{signalName}: post: tags: @@ -6378,6 +7952,161 @@ paths: $ref: '#/components/schemas/Status' components: schemas: + ActivityExecutionInfo: + type: object + properties: + activityId: + type: string + description: Unique identifier of this activity within its namespace along with run ID (below). + runId: + type: string + activityType: + allOf: + - $ref: '#/components/schemas/ActivityType' + description: The type of the activity, a string that maps to a registered activity on a worker. + status: + enum: + - ACTIVITY_EXECUTION_STATUS_UNSPECIFIED + - ACTIVITY_EXECUTION_STATUS_RUNNING + - ACTIVITY_EXECUTION_STATUS_COMPLETED + - ACTIVITY_EXECUTION_STATUS_FAILED + - ACTIVITY_EXECUTION_STATUS_CANCELED + - ACTIVITY_EXECUTION_STATUS_TERMINATED + - ACTIVITY_EXECUTION_STATUS_TIMED_OUT + type: string + description: A general status for this activity, indicates whether it is currently running or in one of the terminal statuses. + format: enum + runState: + enum: + - PENDING_ACTIVITY_STATE_UNSPECIFIED + - PENDING_ACTIVITY_STATE_SCHEDULED + - PENDING_ACTIVITY_STATE_STARTED + - PENDING_ACTIVITY_STATE_CANCEL_REQUESTED + - PENDING_ACTIVITY_STATE_PAUSED + - PENDING_ACTIVITY_STATE_PAUSE_REQUESTED + type: string + description: More detailed breakdown of ACTIVITY_EXECUTION_STATUS_RUNNING. + format: enum + heartbeatDetails: + allOf: + - $ref: '#/components/schemas/Payloads' + description: Details provided in the last recorded activity heartbeat. + lastHeartbeatTime: + type: string + description: Time the last heartbeat was recorded. + format: date-time + lastStartedTime: + type: string + description: Time the last attempt was started. + format: date-time + attempt: + type: integer + description: |- + The attempt this activity is currently on. + Incremented each time a new attempt is started. + TODO: Confirm if this is on scheduled or started. + format: int32 + maximumAttempts: + type: integer + format: int32 + scheduledTime: + type: string + description: Time the activity was originally scheduled via a StartActivityExecution request. + format: date-time + expirationTime: + type: string + description: Scheduled time + schedule to close timeout. + format: date-time + lastFailure: + allOf: + - $ref: '#/components/schemas/Failure' + description: Failure details from the last failed attempt. + lastWorkerIdentity: + type: string + currentRetryInterval: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + Time from the last attempt failure to the next activity retry. + If the activity is currently running, this represents the next retry interval in case the attempt fails. + If activity is currently backing off between attempt, this represents the current retry interval. + If there is no next retry allowed, this field will be null. + This interval is typically calculated from the specified retry policy, but may be modified if an activity fails + with a retryable application failure specifying a retry delay. + lastAttemptCompleteTime: + type: string + description: The time when the last activity attempt completed. If activity has not been completed yet, it will be null. + format: date-time + nextAttemptScheduleTime: + type: string + description: |- + The time when the next activity attempt will be scheduled. + If activity is currently scheduled or started, this field will be null. + format: date-time + lastDeploymentVersion: + allOf: + - $ref: '#/components/schemas/WorkerDeploymentVersion' + description: |- + The Worker Deployment Version this activity was dispatched to most recently. + If nil, the activity has not yet been dispatched or was last dispatched to an unversioned worker. + priority: + allOf: + - $ref: '#/components/schemas/Priority' + description: Priority metadata. + activityOptions: + allOf: + - $ref: '#/components/schemas/ActivityOptions' + description: Current activity options. May be different from the one used to start the activity. + input: + allOf: + - $ref: '#/components/schemas/Payloads' + description: Serialized activity input, passed as arguments to the activity function. + stateTransitionCount: + type: string + description: Incremented each time the activity's state is mutated in persistence. + searchAttributes: + $ref: '#/components/schemas/SearchAttributes' + header: + $ref: '#/components/schemas/Header' + eagerExecutionRequested: + type: boolean + description: |- + Whether the activity was started with a request_eager_execution flag set to `true`, indicating that the first + task was delivered inline in the start response, bypassing matching. + completionCallbacks: + type: array + items: + $ref: '#/components/schemas/Callback' + description: |- + Callbacks to be called by the server when this activity reaches a terminal status. + Callback addresses must be whitelisted in the server's dynamic configuration. + userMetadata: + allOf: + - $ref: '#/components/schemas/UserMetadata' + description: Metadata for use by user interfaces to display the fixed as-of-start summary and details of the activity. + links: + type: array + items: + $ref: '#/components/schemas/Link' + description: Links to be associated with the activity. + canceledReason: + type: string + description: Set if activity cancelation was requested. + pauseInfo: + $ref: '#/components/schemas/ActivityExecutionInfo_PauseInfo' + description: Info for a standalone activity. + ActivityExecutionInfo_PauseInfo: + type: object + properties: + pauseTime: + type: string + description: The time when the activity was paused. + format: date-time + manual: + allOf: + - $ref: '#/components/schemas/PauseInfo_Manual' + description: The activity was paused by direct API invocation. + description: 'TODO: Move this to a common package?' ActivityFailureInfo: type: object properties: @@ -6403,6 +8132,67 @@ components: - RETRY_STATE_CANCEL_REQUESTED type: string format: enum + ActivityListInfo: + type: object + properties: + activityId: + type: string + description: For standalone activity - a unique identifier of this activity within its namespace along with run ID (below). + runId: + type: string + description: The run ID of the workflow or standalone activity. + workflowId: + type: string + description: Workflow that contains this activity - only present for workflow activity. + activityType: + allOf: + - $ref: '#/components/schemas/ActivityType' + description: The type of the activity, a string that maps to a registered activity on a worker. + scheduledTime: + type: string + description: |- + Time the activity was originally scheduled via a StartActivityExecution request. + TODO: Workflows call this schedule_time but it's scheduled_time in PendingActivityInfo, what should we choose for + consistency? + format: date-time + closeTime: + type: string + description: If the activity is in a terminal status, this field represents the time the activity transitioned to that status. + format: date-time + status: + enum: + - ACTIVITY_EXECUTION_STATUS_UNSPECIFIED + - ACTIVITY_EXECUTION_STATUS_RUNNING + - ACTIVITY_EXECUTION_STATUS_COMPLETED + - ACTIVITY_EXECUTION_STATUS_FAILED + - ACTIVITY_EXECUTION_STATUS_CANCELED + - ACTIVITY_EXECUTION_STATUS_TERMINATED + - ACTIVITY_EXECUTION_STATUS_TIMED_OUT + type: string + description: |- + Only scheduled and terminal statuses appear here. More detailed information in PendingActivityInfo but not + available in the list response. + format: enum + searchAttributes: + allOf: + - $ref: '#/components/schemas/SearchAttributes' + description: Search attributes from the start request. + taskQueue: + type: string + description: The task queue this activity was scheduled on when it was originally started, updated on activity options update. + stateTransitionCount: + type: string + description: Updated on terminal status. + stateSizeBytes: + type: string + description: Updated once on scheduled and once on terminal status. + executionDuration: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + The difference between close time and scheduled time. + This field is only populated if the activity is closed. + description: Limited activity information returned in the list response. ActivityOptions: type: object properties: @@ -6443,7 +8233,9 @@ components: type: string description: Maximum permitted time between successful worker heartbeats. retryPolicy: - $ref: '#/components/schemas/RetryPolicy' + allOf: + - $ref: '#/components/schemas/RetryPolicy' + description: The retry policy for the activity. Will never exceed `schedule_to_close_timeout`. ActivityPropertiesModifiedExternallyEventAttributes: type: object properties: @@ -7439,6 +9231,33 @@ components: type: string description: Time of the last update. format: date-time + CountActivityExecutionsResponse: + type: object + properties: + count: + type: string + description: |- + If `query` is not grouping by any field, the count is an approximate number + of activities that match the query. + If `query` is grouping by a field, the count is simply the sum of the counts + of the groups returned in the response. This number can be smaller than the + total number of activities matching the query. + groups: + type: array + items: + $ref: '#/components/schemas/CountActivityExecutionsResponse_AggregationGroup' + description: |- + Contains the groups if the request is grouping by a field. + The list might not be complete, and the counts of each group is approximate. + CountActivityExecutionsResponse_AggregationGroup: + type: object + properties: + groupValues: + type: array + items: + $ref: '#/components/schemas/Payload' + count: + type: string CountWorkflowExecutionsResponse: type: object properties: @@ -7688,6 +9507,17 @@ components: Holds information about ongoing transition of a workflow execution from one worker deployment version to another. Experimental. Might change in the future. + DescribeActivityExecutionResponse: + type: object + properties: + info: + $ref: '#/components/schemas/ActivityExecutionInfo' + longPollToken: + type: string + description: |- + A token that can be passed in via a subsequent `DescribeActivityExecutionRequest` to long poll on the activity + state as it makes progress. + format: bytes DescribeBatchOperationResponse: type: object properties: @@ -7921,6 +9751,11 @@ components: Only set if `report_task_queue_stats` is set to true in the request. (-- api-linter: core::0140::prepositions=disabled aip.dev/not-precedent: "by" is used to clarify the key. --) + DescribeWorkerResponse: + type: object + properties: + workerInfo: + $ref: '#/components/schemas/WorkerInfo' DescribeWorkflowExecutionResponse: type: object properties: @@ -8217,6 +10052,20 @@ components: allOf: - $ref: '#/components/schemas/WorkerConfig' description: The worker configuration. + GetActivityExecutionResultResponse: + type: object + properties: + runId: + type: string + description: The run ID of the completed activity, may be used in case a run ID was not specified in the request. + result: + allOf: + - $ref: '#/components/schemas/Payloads' + description: The result if the activity completed successfully. + failure: + allOf: + - $ref: '#/components/schemas/Failure' + description: The failure if the activity completed unsuccessfully. GetClusterInfoResponse: type: object properties: @@ -8242,6 +10091,10 @@ components: type: string visibilityStore: type: string + initialFailoverVersion: + type: string + failoverVersionIncrement: + type: string description: GetClusterInfoResponse contains information about Temporal cluster. GetCurrentDeploymentResponse: type: object @@ -8700,11 +10553,23 @@ components: $ref: '#/components/schemas/Link_WorkflowEvent' batchJob: $ref: '#/components/schemas/Link_BatchJob' + activity: + $ref: '#/components/schemas/Link_Activity' description: |- Link can be associated with history events. It might contain information about an external entity related to the history event. For example, workflow A makes a Nexus call that starts workflow B: in this case, a history event in workflow A could contain a Link to the workflow started event in workflow B, and vice-versa. + Link_Activity: + type: object + properties: + namespace: + type: string + activityId: + type: string + runId: + type: string + description: A link to an activity. Link_BatchJob: type: object properties: @@ -8727,6 +10592,17 @@ components: $ref: '#/components/schemas/WorkflowEvent_EventReference' requestIdRef: $ref: '#/components/schemas/WorkflowEvent_RequestIdReference' + ListActivityExecutionsResponse: + type: object + properties: + executions: + type: array + items: + $ref: '#/components/schemas/ActivityListInfo' + nextPageToken: + type: string + description: Token to use to fetch the next page. If empty, there is no next page. + format: bytes ListArchivedWorkflowExecutionsResponse: type: object properties: @@ -9055,6 +10931,12 @@ components: asyncUpdate: type: boolean description: True if the namespace supports async update + workerHeartbeats: + type: boolean + description: True if the namespace supports worker heartbeats + reportedProblemsSearchAttribute: + type: boolean + description: True if the namespace supports reported problems search attribute description: Namespace capability details. Should contain what features are enabled in a namespace. NamespaceReplicationConfig: type: object @@ -9411,10 +11293,8 @@ components: type: boolean description: Attaches the links to the WorkflowExecutionOptionsUpdatedEvent history event. description: |- - When StartWorkflowExecution uses the conflict policy WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING and - there is already an existing running workflow, OnConflictOptions defines actions to be taken on - the existing running workflow. In this case, it will create a WorkflowExecutionOptionsUpdatedEvent - history event in the running workflow with the changes requested in this object. + When StartActivityExecution uses the ID_CONFLICT_POLICY_USE_EXISTING and there is already an existing running + activity, OnConflictOptions defines actions to be taken on the existing running activity, updating its state. Outcome: type: object properties: @@ -9443,6 +11323,42 @@ 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. + workflowActivityType: + type: string + description: |- + 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. + reason: + type: string + description: Reason to pause the activity. + PauseActivityExecutionResponse: + type: object + properties: {} PauseActivityRequest: type: object properties: @@ -9461,13 +11377,17 @@ components: description: Only the activity with this ID will be paused. type: type: string - description: Pause all running activities of this type. + description: |- + Pause all running activities of this type. + Note: Experimental - the behavior of pause by activity type might change in a future release. reason: type: string description: Reason to pause the activity. + description: Deprecated. See PauseActivityExecutionRequest. PauseActivityResponse: type: object properties: {} + description: Deprecated. See PauseActivityExecutionResponse. PauseInfo_Manual: type: object properties: @@ -9749,6 +11669,100 @@ components: version: type: string description: The version of the plugin, may be empty. + PollActivityTaskQueueResponse: + type: object + properties: + taskToken: + type: string + description: A unique identifier for this task + format: bytes + workflowNamespace: + type: string + description: The namespace the workflow which requested this activity lives in + workflowType: + allOf: + - $ref: '#/components/schemas/WorkflowType' + description: Type of the requesting workflow + workflowExecution: + allOf: + - $ref: '#/components/schemas/WorkflowExecution' + description: Execution info of the requesting workflow + activityType: + $ref: '#/components/schemas/ActivityType' + activityId: + type: string + description: |- + The autogenerated or user specified identifier of this activity. Can be used to complete the + activity via `RespondActivityTaskCompletedById`. May be re-used as long as the last usage + has resolved, but unique IDs for every activity invocation is a good idea. + Note that only a workflow activity ID may be autogenerated. + header: + allOf: + - $ref: '#/components/schemas/Header' + description: |- + Headers specified by the scheduling workflow. Commonly used to propagate contextual info + from the workflow to its activities. For example, tracing contexts. + input: + allOf: + - $ref: '#/components/schemas/Payloads' + description: Arguments to the activity invocation + heartbeatDetails: + allOf: + - $ref: '#/components/schemas/Payloads' + description: |- + Details of the last heartbeat that was recorded for this activity as of the time this task + was delivered. + scheduledTime: + type: string + description: When was this task first scheduled + format: date-time + currentAttemptScheduledTime: + type: string + description: When was this task attempt scheduled + format: date-time + startedTime: + type: string + description: When was this task started (this attempt) + format: date-time + attempt: + type: integer + description: Starting at 1, the number of attempts to perform this activity + format: int32 + scheduleToCloseTimeout: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + First scheduled -> final result reported timeout + + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "to" is used to indicate interval. --) + startToCloseTimeout: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + Current attempt start -> final result reported timeout + + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "to" is used to indicate interval. --) + heartbeatTimeout: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Window within which the activity must report a heartbeat, or be timed out. + retryPolicy: + allOf: + - $ref: '#/components/schemas/RetryPolicy' + description: |- + This is the retry policy the service uses which may be different from the one provided + (or not) during activity scheduling. The service can override the provided one if some + values are not specified or exceed configured system limits. + pollerScalingDecision: + allOf: + - $ref: '#/components/schemas/PollerScalingDecision' + description: Server-advised information the SDK may use to adjust its poller count. + priority: + allOf: + - $ref: '#/components/schemas/Priority' + description: Priority metadata PollWorkflowTaskQueueResponse: type: object properties: @@ -9939,7 +11953,7 @@ components: configuration, and defaults to 5. If priority is not present (or zero), then the effective priority will be - the default priority, which is is calculated by (min+max)/2. With the + the default priority, which is calculated by (min+max)/2. With the default max of 5, and min of 1, that comes out to 3. format: int32 fairnessKey: @@ -10105,10 +12119,12 @@ components: description: Namespace of the workflow which scheduled this activity workflowId: type: string - description: Id of the workflow which scheduled this activity + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity runId: type: string - description: Run Id of the workflow which scheduled this activity + description: |- + For a workflow activity - the run ID of the workflow which scheduled this activity. + For a standalone activity - the run ID of the activity. activityId: type: string description: Id of the activity we're heartbeating @@ -10246,12 +12262,36 @@ components: description: ReleaseInfo contains information about specific version of temporal. Request: type: object - properties: - meta: - $ref: '#/components/schemas/Meta' - input: - $ref: '#/components/schemas/Input' - description: The client request that triggers a Workflow Update. + properties: + meta: + $ref: '#/components/schemas/Meta' + input: + $ref: '#/components/schemas/Input' + description: The client request that triggers a Workflow Update. + RequestCancelActivityExecutionRequest: + type: object + properties: + namespace: + type: string + activityId: + type: string + runId: + type: string + description: Activity run ID, targets the latest run if run_id is empty. + identity: + type: string + description: The identity of the worker/client. + requestId: + type: string + description: Used to de-dupe cancellation requests. + reason: + type: string + description: |- + Reason for requesting the cancellation, recorded and available via the DescribeActivityExecution API. + Not propagated to a worker if an activity attempt is currently running. + RequestCancelActivityExecutionResponse: + type: object + properties: {} RequestCancelExternalWorkflowExecutionFailedEventAttributes: type: object properties: @@ -10416,6 +12456,70 @@ 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, reset a workflow activity (or activities) for the given workflow ID. + If empty, target a standalone activity. + activityId: + type: string + description: |- + Reset an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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. + workflowActivityType: + type: string + description: |- + Reset all pending workflow activities of this type. + Only available if workflow_id is provided. + Mutually exclusive with activity_id and all_workflow_activities. + + Note: Experimental - the behavior of resetting by activity type may change or be removed in a future release. + allWorkflowActivities: + type: boolean + description: |- + Reset all pending workflow activities. + Only available if workflow_id is provided. + Mutually exclusive with activity_id and workflow_activity_type. + + Note: Experimental - the behavior of resetting all activities may change or be removed in a future release. + 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 originally created with. + For workflow activities the original options are restored from first ActivityTaskScheduled event. + description: |- + TODO: update batch + NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities + ResetActivityExecutionResponse: + type: object + properties: {} ResetActivityRequest: type: object properties: @@ -10458,10 +12562,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. See ResetActivityExecutionRequest. ResetActivityResponse: type: object properties: {} + description: Deprecated. See ResetActivityExecutionResponse. ResetOptions: type: object properties: @@ -10623,10 +12730,12 @@ components: description: Namespace of the workflow which scheduled this activity workflowId: type: string - description: Id of the workflow which scheduled this activity + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity runId: type: string - description: Run Id of the workflow which scheduled this activity + description: |- + For a workflow activity - the run ID of the workflow which scheduled this activity. + For a standalone activity - the run ID of the activity. activityId: type: string description: Id of the activity to confirm is cancelled @@ -10690,10 +12799,12 @@ components: description: Namespace of the workflow which scheduled this activity workflowId: type: string - description: Id of the workflow which scheduled this activity + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity runId: type: string - description: Run Id of the workflow which scheduled this activity + description: |- + For a workflow activity - the run ID of the workflow which scheduled this activity. + For a standalone activity - the run ID of the activity. activityId: type: string description: Id of the activity to complete @@ -10753,10 +12864,12 @@ components: description: Namespace of the workflow which scheduled this activity workflowId: type: string - description: Id of the workflow which scheduled this activity + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity runId: type: string - description: Run Id of the workflow which scheduled this activity + description: |- + For a workflow activity - the run ID of the workflow which scheduled this activity. + For a standalone activity - the run ID of the activity. activityId: type: string description: Id of the activity to fail @@ -11347,6 +13460,12 @@ components: needed. If the request is unexpectedly rejected due to missing pollers, then that means the pollers have not reached to the server yet. Only set this if you expect those pollers to never arrive. + allowNoPollers: + type: boolean + description: |- + Optional. By default this request will be rejected if no pollers have been seen for the proposed + Current Version, in order to protect users from routing tasks to pollers that do not exist, leading + to possible timeouts. Pass `true` here to bypass this protection. description: Set/unset the Current Version of a Worker Deployment. SetWorkerDeploymentCurrentVersionResponse: type: object @@ -11365,6 +13484,46 @@ components: allOf: - $ref: '#/components/schemas/WorkerDeploymentVersion' description: The version that was current before executing this operation. + SetWorkerDeploymentManagerRequest: + type: object + properties: + namespace: + type: string + deploymentName: + type: string + managerIdentity: + type: string + description: |- + Arbitrary value for `manager_identity`. + Empty will unset the field. + self: + type: boolean + description: True will set `manager_identity` to `identity`. + conflictToken: + type: string + description: |- + Optional. This can be the value of conflict_token from a Describe, or another Worker + Deployment API. Passing a non-nil conflict token will cause this request to fail if the + Deployment's configuration has been modified between the API call that generated the + token and this one. + format: bytes + identity: + type: string + description: Required. The identity of the client who initiated this request. + description: Update the ManagerIdentity of a Worker Deployment. + SetWorkerDeploymentManagerResponse: + type: object + properties: + conflictToken: + type: string + description: |- + This value is returned so that it can be optionally passed to APIs + that write to the Worker Deployment state to ensure that the state + did not change between this API call and a future write. + format: bytes + previousManagerIdentity: + type: string + description: What the `manager_identity` field was before this change. SetWorkerDeploymentRampingVersionRequest: type: object properties: @@ -11415,6 +13574,12 @@ components: Note: this check only happens when the ramping version is about to change, not every time that the percentage changes. Also note that the check is against the deployment's Current Version, not the previous Ramping Version. + allowNoPollers: + type: boolean + description: |- + Optional. By default this request will be rejected if no pollers have been seen for the proposed + Current Version, in order to protect users from routing tasks to pollers that do not exist, leading + to possible timeouts. Pass `true` here to bypass this protection. description: Set/unset the Ramping Version of a Worker Deployment and its ramp percentage. SetWorkerDeploymentRampingVersionResponse: type: object @@ -11664,6 +13829,116 @@ components: SignalWorkflowExecutionResponse: type: object properties: {} + StartActivityExecutionRequest: + type: object + properties: + namespace: + type: string + identity: + type: string + description: The identity of the client who initiated this request + requestId: + type: string + description: A unique identifier for this start request. Typically UUIDv4. + activityId: + type: string + activityType: + $ref: '#/components/schemas/ActivityType' + options: + $ref: '#/components/schemas/ActivityOptions' + input: + allOf: + - $ref: '#/components/schemas/Payloads' + description: Serialized arguments to the activity. These are passed as arguments to the activity function. + idReusePolicy: + enum: + - ID_REUSE_POLICY_UNSPECIFIED + - ID_REUSE_POLICY_ALLOW_DUPLICATE + - ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY + - ID_REUSE_POLICY_REJECT_DUPLICATE + type: string + description: |- + Defines whether to allow re-using the activity id from a previously *closed* activity. + The default policy is ID_REUSE_POLICY_ALLOW_DUPLICATE. + format: enum + idConflictPolicy: + enum: + - ID_CONFLICT_POLICY_UNSPECIFIED + - ID_CONFLICT_POLICY_FAIL + - ID_CONFLICT_POLICY_USE_EXISTING + - ID_CONFLICT_POLICY_TERMINATE_EXISTING + type: string + description: |- + Defines how to resolve an activity id conflict with a *running* activity. + The default policy is ID_CONFLICT_POLICY_FAIL. + format: enum + memo: + allOf: + - $ref: '#/components/schemas/Memo' + description: |- + Arbitrary structured data that can be attached to the activity execution and made available via the list and + describe APIs. + searchAttributes: + allOf: + - $ref: '#/components/schemas/SearchAttributes' + description: Search attributes for indexing. + header: + allOf: + - $ref: '#/components/schemas/Header' + description: Header for context propagation and tracing purposes. + requestEagerExecution: + type: boolean + description: |- + Request to get the first activity task inline in the response bypassing matching service and worker polling. + If set to `true` the caller is expected to have a worker available and capable of processing the task. + The returned task will be marked as started and is expected to be completed by the specified + `schedule_to_close_timeout`. + completionCallbacks: + type: array + items: + $ref: '#/components/schemas/Callback' + description: |- + Callbacks to be called by the server when this activity reaches a terminal status. + Callback addresses must be whitelisted in the server's dynamic configuration. + userMetadata: + allOf: + - $ref: '#/components/schemas/UserMetadata' + description: Metadata for use by user interfaces to display the fixed as-of-start summary and details of the activity. + links: + type: array + items: + $ref: '#/components/schemas/Link' + description: Links to be associated with the activity. + onConflictOptions: + allOf: + - $ref: '#/components/schemas/OnConflictOptions' + description: |- + Defines actions to be done to the existing running activity when ID_CONFLICT_POLICY_USE_EXISTING is used. If not + set or empty, it won't do anything to the existing running activity. + priority: + allOf: + - $ref: '#/components/schemas/Priority' + description: Priority metadata + StartActivityExecutionResponse: + type: object + properties: + runId: + type: string + description: The run ID of the activity that was started - or used (via ID_CONFLICT_POLICY_USE_EXISTING). + started: + type: boolean + description: If true, a new activity was started. + eagerTask: + allOf: + - $ref: '#/components/schemas/PollActivityTaskQueueResponse' + description: |- + When `request_eager_execution` is set on the `StartActivityExecutionRequest`, the server will return the first + activity task to be eagerly executed. + The caller is expected to have a worker available to process the task. + link: + allOf: + - $ref: '#/components/schemas/Link' + description: Link to the workflow event. StartBatchOperationRequest: type: object properties: @@ -12295,6 +14570,25 @@ components: description: Last time versioning information of this Task Queue changed. format: date-time description: Experimental. Worker Deployments are experimental and might significantly change in the future. + TerminateActivityExecutionRequest: + type: object + properties: + namespace: + type: string + activityId: + type: string + runId: + type: string + description: Activity run ID, targets the latest run if run_id is empty. + reason: + type: string + description: Reason for requesting the termination, recorded in in the activity's result failure outcome. + identity: + type: string + description: The identity of the worker/client. + TerminateActivityExecutionResponse: + type: object + properties: {} TerminateWorkflowExecutionRequest: type: object properties: @@ -12444,6 +14738,58 @@ 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, unpause a workflow activity (or activities) for the given workflow ID. + If empty, target a standalone activity. + activityId: + type: string + description: |- + Unpause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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. + workflowActivityType: + type: string + description: |- + Unpause all currently paused workflow activities of this type. + Only available if workflow_id is provided. + Mutually exclusive with activity_id and all_workflow_activities. + + Note: Experimental - the behavior of unpausing by activity type may change or be removed in a future release. + allWorkflowActivities: + type: boolean + description: |- + Unpause all paused workflow activities. + Only available if workflow_id is provided. + Mutually exclusive with activity_id and workflow_activity_type. + + Note: Experimental - the behavior of unpausing all activities may change or be removed in a future release. + 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. + 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. + description: 'TODO: update batch' + UnpauseActivityExecutionResponse: + type: object + properties: {} UnpauseActivityRequest: type: object properties: @@ -12476,9 +14822,76 @@ 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. See UnpauseActivityExecutionRequest. UnpauseActivityResponse: type: object properties: {} + description: Deprecated. See UnpauseActivityExecutionResponse. + UpdateActivityExecutionOptionsRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity + workflowId: + type: string + description: |- + If provided, update options for a workflow activity (or activities) for the given workflow ID. If empty, target a + standalone activity. + activityId: + type: string + description: |- + Update options for an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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 + workflowActivityType: + type: string + description: |- + Update all pending workflow activities of this type. + Only available if workflow_id is provided. + Mutually exclusive with activity_id and all_workflow_activities. + + Note: Experimental - the behavior of updating by activity type may change or be removed in a future release. + allWorkflowActivities: + type: boolean + description: |- + Update all pending workflow activities. + Only available if workflow_id is provided. + Mutually exclusive with activity_id and workflow_activity_type. + + Note: Experimental - the behavior of updating all activities may change or be removed in a future release. + activityOptions: + allOf: + - $ref: '#/components/schemas/ActivityOptions' + description: |- + Activity options. Partial updates are accepted and controlled by update_mask + Mutually exclusive with restore_original. + 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 defaults. + Default options are then options activity was originally created with. + For workflow activities the original options are restored from first ActivityTaskScheduled event. + Mutually exclusive with activity_options. + description: |- + TODO: update batch + 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: @@ -12517,7 +14930,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: @@ -12525,6 +14940,7 @@ components: allOf: - $ref: '#/components/schemas/ActivityOptions' description: Activity options after an update + description: Deprecated. See UpdateActivityExecutionOptionsResponse. UpdateDeploymentMetadata: type: object properties: @@ -12551,7 +14967,10 @@ components: type: object additionalProperties: type: string - description: "A key-value map for any customized purpose.\n If data already exists on the namespace, \n this will merge with the existing key values." + description: |- + A key-value map for any customized purpose. + If data already exists on the namespace, + this will merge with the existing key values. state: enum: - NAMESPACE_STATE_UNSPECIFIED @@ -13093,6 +15512,13 @@ components: Identity of the last client who modified the configuration of this Deployment. Set to the `identity` value sent by APIs such as `SetWorkerDeploymentCurrentVersion` and `SetWorkerDeploymentRampingVersion`. + managerIdentity: + type: string + description: |- + Identity of the client that has the exclusive right to make changes to this Worker Deployment. + Empty by default. + If this is set, clients whose identity does not match `manager_identity` will not be able to make changes + to this Worker Deployment. They can either set their own identity as the manager or unset the field to proceed. description: "A Worker Deployment (Deployment, for short) represents all workers serving \n a shared set of Task Queues. Typically, a Deployment represents one service or \n application.\n A Deployment contains multiple Deployment Versions, each representing a different \n version of workers. (see documentation of WorkerDeploymentVersionInfo)\n Deployment records are created in Temporal server automatically when their\n first poller arrives to the server.\n Experimental. Worker Deployments are experimental and might significantly change in the future." WorkerDeploymentInfo_WorkerDeploymentVersionSummary: type: object diff --git a/sdk-core-protos/protos/api_upstream/temporal/api/activity/v1/message.proto b/sdk-core-protos/protos/api_upstream/temporal/api/activity/v1/message.proto index e70e814b4..f658863e5 100644 --- a/sdk-core-protos/protos/api_upstream/temporal/api/activity/v1/message.proto +++ b/sdk-core-protos/protos/api_upstream/temporal/api/activity/v1/message.proto @@ -9,10 +9,27 @@ option java_outer_classname = "MessageProto"; option ruby_package = "Temporalio::Api::Activity::V1"; option csharp_namespace = "Temporalio.Api.Activity.V1"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + import "temporal/api/common/v1/message.proto"; +import "temporal/api/deployment/v1/message.proto"; +import "temporal/api/enums/v1/activity.proto"; +import "temporal/api/enums/v1/workflow.proto"; +import "temporal/api/failure/v1/message.proto"; import "temporal/api/taskqueue/v1/message.proto"; +import "temporal/api/sdk/v1/user_metadata.proto"; -import "google/protobuf/duration.proto"; +// When StartActivityExecution uses the ID_CONFLICT_POLICY_USE_EXISTING and there is already an existing running +// activity, OnConflictOptions defines actions to be taken on the existing running activity, updating its state. +message OnConflictOptions { + // Attaches the request ID to the running workflow. + bool attach_request_id = 1; + // Attaches the completion callbacks to the running workflow. + bool attach_completion_callbacks = 2; + // Attaches the links to the WorkflowExecutionOptionsUpdatedEvent history event. + bool attach_links = 3; +} message ActivityOptions { temporal.api.taskqueue.v1.TaskQueue task_queue = 1; @@ -40,6 +57,143 @@ message ActivityOptions { google.protobuf.Duration start_to_close_timeout = 4; // Maximum permitted time between successful worker heartbeats. google.protobuf.Duration heartbeat_timeout = 5; - + // The retry policy for the activity. Will never exceed `schedule_to_close_timeout`. temporal.api.common.v1.RetryPolicy retry_policy = 6; -} \ No newline at end of file +} + +// Info for a standalone activity. +message ActivityExecutionInfo { + // Unique identifier of this activity within its namespace along with run ID (below). + string activity_id = 1; + string run_id = 2; + + // The type of the activity, a string that maps to a registered activity on a worker. + temporal.api.common.v1.ActivityType activity_type = 3; + // A general status for this activity, indicates whether it is currently running or in one of the terminal statuses. + temporal.api.enums.v1.ActivityExecutionStatus status = 4; + // More detailed breakdown of ACTIVITY_EXECUTION_STATUS_RUNNING. + temporal.api.enums.v1.PendingActivityState run_state = 5; + // Details provided in the last recorded activity heartbeat. + temporal.api.common.v1.Payloads heartbeat_details = 6; + // Time the last heartbeat was recorded. + google.protobuf.Timestamp last_heartbeat_time = 7; + // Time the last attempt was started. + google.protobuf.Timestamp last_started_time = 8; + // The attempt this activity is currently on. + // Incremented each time a new attempt is started. + // TODO: Confirm if this is on scheduled or started. + int32 attempt = 9; + int32 maximum_attempts = 10; + // Time the activity was originally scheduled via a StartActivityExecution request. + google.protobuf.Timestamp scheduled_time = 11; + // Scheduled time + schedule to close timeout. + google.protobuf.Timestamp expiration_time = 12; + // Failure details from the last failed attempt. + temporal.api.failure.v1.Failure last_failure = 13; + string last_worker_identity = 14; + + // Time from the last attempt failure to the next activity retry. + // If the activity is currently running, this represents the next retry interval in case the attempt fails. + // If activity is currently backing off between attempt, this represents the current retry interval. + // If there is no next retry allowed, this field will be null. + // This interval is typically calculated from the specified retry policy, but may be modified if an activity fails + // with a retryable application failure specifying a retry delay. + google.protobuf.Duration current_retry_interval = 15; + + // The time when the last activity attempt completed. If activity has not been completed yet, it will be null. + google.protobuf.Timestamp last_attempt_complete_time = 16; + + // The time when the next activity attempt will be scheduled. + // If activity is currently scheduled or started, this field will be null. + google.protobuf.Timestamp next_attempt_schedule_time = 17; + + // The Worker Deployment Version this activity was dispatched to most recently. + // If nil, the activity has not yet been dispatched or was last dispatched to an unversioned worker. + temporal.api.deployment.v1.WorkerDeploymentVersion last_deployment_version = 18; + + // Priority metadata. + temporal.api.common.v1.Priority priority = 19; + + // Current activity options. May be different from the one used to start the activity. + temporal.api.activity.v1.ActivityOptions activity_options = 20; + + // Serialized activity input, passed as arguments to the activity function. + temporal.api.common.v1.Payloads input = 21; + + // Incremented each time the activity's state is mutated in persistence. + int64 state_transition_count = 22; + + temporal.api.common.v1.SearchAttributes search_attributes = 23; + temporal.api.common.v1.Header header = 24; + // Whether the activity was started with a request_eager_execution flag set to `true`, indicating that the first + // task was delivered inline in the start response, bypassing matching. + bool eager_execution_requested = 25; + + // Callbacks to be called by the server when this activity reaches a terminal status. + // Callback addresses must be whitelisted in the server's dynamic configuration. + repeated temporal.api.common.v1.Callback completion_callbacks = 26; + // Metadata for use by user interfaces to display the fixed as-of-start summary and details of the activity. + temporal.api.sdk.v1.UserMetadata user_metadata = 27; + // Links to be associated with the activity. + repeated temporal.api.common.v1.Link links = 28; + + // Set if activity cancelation was requested. + string canceled_reason = 29; + + // TODO: Move this to a common package? + message PauseInfo { + // The time when the activity was paused. + google.protobuf.Timestamp pause_time = 1; + + message Manual { + // The identity of the actor that paused the activity. + string identity = 1; + // Reason for pausing the activity. + string reason = 2; + } + + oneof paused_by { + // The activity was paused by direct API invocation. + Manual manual = 2; + } + } + + PauseInfo pause_info = 30; +} + +// Limited activity information returned in the list response. +message ActivityListInfo { + // For standalone activity - a unique identifier of this activity within its namespace along with run ID (below). + string activity_id = 1; + // The run ID of the workflow or standalone activity. + string run_id = 2; + // Workflow that contains this activity - only present for workflow activity. + string workflow_id = 3; + + // The type of the activity, a string that maps to a registered activity on a worker. + temporal.api.common.v1.ActivityType activity_type = 4; + // Time the activity was originally scheduled via a StartActivityExecution request. + // TODO: Workflows call this schedule_time but it's scheduled_time in PendingActivityInfo, what should we choose for + // consistency? + google.protobuf.Timestamp scheduled_time = 5; + // If the activity is in a terminal status, this field represents the time the activity transitioned to that status. + google.protobuf.Timestamp close_time = 6; + // Only scheduled and terminal statuses appear here. More detailed information in PendingActivityInfo but not + // available in the list response. + temporal.api.enums.v1.ActivityExecutionStatus status = 7; + + // Search attributes from the start request. + temporal.api.common.v1.SearchAttributes search_attributes = 8; + + // The task queue this activity was scheduled on when it was originally started, updated on activity options update. + string task_queue = 9; + // Updated on terminal status. + int64 state_transition_count = 10; + // Updated once on scheduled and once on terminal status. + int64 state_size_bytes = 11; + // The difference between close time and scheduled time. + // This field is only populated if the activity is closed. + google.protobuf.Duration execution_duration = 12; + + // TODO: pause_info +} diff --git a/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto b/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto index 51acfaa2e..33e3a48c0 100644 --- a/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto +++ b/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto @@ -232,9 +232,17 @@ message Link { string job_id = 1; } + // A link to an activity. + message Activity { + string namespace = 1; + string activity_id = 2; + string run_id = 3; + } + oneof variant { WorkflowEvent workflow_event = 1; BatchJob batch_job = 2; + Activity activity = 3; } } @@ -280,7 +288,7 @@ message Priority { // configuration, and defaults to 5. // // If priority is not present (or zero), then the effective priority will be - // the default priority, which is is calculated by (min+max)/2. With the + // the default priority, which is calculated by (min+max)/2. With the // default max of 5, and min of 1, that comes out to 3. int32 priority_key = 1; @@ -338,4 +346,3 @@ message WorkerSelector { string worker_instance_key = 1; } } - diff --git a/sdk-core-protos/protos/api_upstream/temporal/api/deployment/v1/message.proto b/sdk-core-protos/protos/api_upstream/temporal/api/deployment/v1/message.proto index 14b4205c5..8f6685a5d 100644 --- a/sdk-core-protos/protos/api_upstream/temporal/api/deployment/v1/message.proto +++ b/sdk-core-protos/protos/api_upstream/temporal/api/deployment/v1/message.proto @@ -195,6 +195,12 @@ message WorkerDeploymentInfo { // `SetWorkerDeploymentRampingVersion`. string last_modifier_identity = 5; + // Identity of the client that has the exclusive right to make changes to this Worker Deployment. + // Empty by default. + // If this is set, clients whose identity does not match `manager_identity` will not be able to make changes + // to this Worker Deployment. They can either set their own identity as the manager or unset the field to proceed. + string manager_identity = 6; + message WorkerDeploymentVersionSummary { // Deprecated. Use `deployment_version`. string version = 1 [deprecated = true]; diff --git a/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/activity.proto b/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/activity.proto new file mode 100644 index 000000000..5061f3162 --- /dev/null +++ b/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/activity.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; + +package temporal.api.enums.v1; + +option go_package = "go.temporal.io/api/enums/v1;enums"; +option java_package = "io.temporal.api.enums.v1"; +option java_multiple_files = true; +option java_outer_classname = "ActivityProto"; +option ruby_package = "Temporalio::Api::Enums::V1"; +option csharp_namespace = "Temporalio.Api.Enums.V1"; + +// Status of a standalone activity. +// The status is updated once, when the activity is originally scheduled, and again when the activity reaches a terminal +// status. +// TODO: Should this be a common execution status? Seems like the other archetypes will share this status. +// (-- api-linter: core::0216::synonyms=disabled +// aip.dev/not-precedent: Named consistently with WorkflowExecutionStatus. --) +enum ActivityExecutionStatus { + ACTIVITY_EXECUTION_STATUS_UNSPECIFIED = 0; + // The activity is not in a terminal status. This does not necessarily mean that there is a currently running + // attempt. The activity may be backing off between attempts or waiting for a worker to pick it up. + ACTIVITY_EXECUTION_STATUS_RUNNING = 1; + // The activity completed successfully. + ACTIVITY_EXECUTION_STATUS_COMPLETED = 2; + // The activity completed with failure. + ACTIVITY_EXECUTION_STATUS_FAILED = 3; + // The activity completed as canceled. + // Requesting to cancel an activity does not automatically transition the activity to canceled status. If the + // activity has a currently running attempt, the activity will only transition to canceled status if the current + // attempt is unsuccessful. + // TODO: Clarify what happens if there are no more allowed retries after the current attempt. + ACTIVITY_EXECUTION_STATUS_CANCELED = 4; + // The activity was terminated. Termination does not reach the worker and the activity code cannot react to it. + // A terminated activity may have a running attempt and will be requested to be canceled by the server when it + // heartbeats. + ACTIVITY_EXECUTION_STATUS_TERMINATED = 5; + // The activity has timed out by reaching the specified shedule-to-start or schedule-to-close timeouts. + // TODO: Clarify if there are other conditions where the activity can end up in timed out status. + ACTIVITY_EXECUTION_STATUS_TIMED_OUT = 6; +} diff --git a/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/id.proto b/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/id.proto new file mode 100644 index 000000000..cc25502ea --- /dev/null +++ b/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/id.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; + +package temporal.api.enums.v1; + +option go_package = "go.temporal.io/api/enums/v1;enums"; +option java_package = "io.temporal.api.enums.v1"; +option java_multiple_files = true; +option java_outer_classname = "IdProto"; +option ruby_package = "Temporalio::Api::Enums::V1"; +option csharp_namespace = "Temporalio.Api.Enums.V1"; + +// Defines whether to allow re-using an ID from a previously *closed* execution. +// If the request is denied, the server returns an `ExecutionAlreadyStarted` error. +// +// See `IdConflictPolicy` for handling ID duplication with a *running* execution. +enum IdReusePolicy { + ID_REUSE_POLICY_UNSPECIFIED = 0; + // Always allow starting an execution using the same entity ID. + ID_REUSE_POLICY_ALLOW_DUPLICATE = 1; + // Allow starting an execution using the same ID, only when the last execution's final state is one of [terminated, + // cancelled, timed out, failed]. + ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY = 2; + // Do not permit re-use of the ID for this execution. Future start requests could potentially change the policy, + // allowing re-use of the ID. + ID_REUSE_POLICY_REJECT_DUPLICATE = 3; +} + +// Defines what to do when trying to start an execution with the same ID as a *running* execution. +// Note that it is *never* valid to have two actively running instances of the same execution ID. +// +// See `IdReusePolicy` for handling execution ID duplication with a *closed* execution. +enum IdConflictPolicy { + ID_CONFLICT_POLICY_UNSPECIFIED = 0; + // Don't start a new execution; instead return `ExecutionAlreadyStarted` error. + ID_CONFLICT_POLICY_FAIL = 1; + // Don't start a new execution; instead return a handle for the running execution. + ID_CONFLICT_POLICY_USE_EXISTING = 2; + // Terminate the running execution before starting a new one. + ID_CONFLICT_POLICY_TERMINATE_EXISTING = 3; +} diff --git a/sdk-core-protos/protos/api_upstream/temporal/api/namespace/v1/message.proto b/sdk-core-protos/protos/api_upstream/temporal/api/namespace/v1/message.proto index 405cd53c9..79c44cb05 100644 --- a/sdk-core-protos/protos/api_upstream/temporal/api/namespace/v1/message.proto +++ b/sdk-core-protos/protos/api_upstream/temporal/api/namespace/v1/message.proto @@ -34,6 +34,10 @@ message NamespaceInfo { bool sync_update = 2; // True if the namespace supports async update bool async_update = 3; + // True if the namespace supports worker heartbeats + bool worker_heartbeats = 4; + // True if the namespace supports reported problems search attribute + bool reported_problems_search_attribute = 5; } // Whether scheduled workflows are supported on this namespace. This is only needed @@ -68,8 +72,8 @@ message UpdateNamespaceInfo { string description = 1; string owner_email = 2; // A key-value map for any customized purpose. - // If data already exists on the namespace, - // this will merge with the existing key values. + // If data already exists on the namespace, + // this will merge with the existing key values. map data = 3; // New namespace state, server will reject if transition is not allowed. // Allowed transitions are: diff --git a/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto b/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto index 5059575dc..e0a6c68a2 100644 --- a/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +++ b/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto @@ -19,6 +19,7 @@ import "temporal/api/enums/v1/reset.proto"; import "temporal/api/enums/v1/task_queue.proto"; import "temporal/api/enums/v1/deployment.proto"; import "temporal/api/enums/v1/update.proto"; +import "temporal/api/enums/v1/id.proto"; import "temporal/api/activity/v1/message.proto"; import "temporal/api/common/v1/message.proto"; import "temporal/api/history/v1/message.proto"; @@ -460,6 +461,7 @@ message PollActivityTaskQueueResponse { // The autogenerated or user specified identifier of this activity. Can be used to complete the // activity via `RespondActivityTaskCompletedById`. May be re-used as long as the last usage // has resolved, but unique IDs for every activity invocation is a good idea. + // Note that only a workflow activity ID may be autogenerated. string activity_id = 6; // Headers specified by the scheduling workflow. Commonly used to propagate contextual info // from the workflow to its activities. For example, tracing contexts. @@ -525,9 +527,10 @@ message RecordActivityTaskHeartbeatResponse { message RecordActivityTaskHeartbeatByIdRequest { // Namespace of the workflow which scheduled this activity string namespace = 1; - // Id of the workflow which scheduled this activity + // Id of the workflow which scheduled this activity, leave empty to target a standalone activity string workflow_id = 2; - // Run Id of the workflow which scheduled this activity + // For a workflow activity - the run ID of the workflow which scheduled this activity. + // For a standalone activity - the run ID of the activity. string run_id = 3; // Id of the activity we're heartbeating string activity_id = 4; @@ -577,9 +580,10 @@ message RespondActivityTaskCompletedResponse { message RespondActivityTaskCompletedByIdRequest { // Namespace of the workflow which scheduled this activity string namespace = 1; - // Id of the workflow which scheduled this activity + // Id of the workflow which scheduled this activity, leave empty to target a standalone activity string workflow_id = 2; - // Run Id of the workflow which scheduled this activity + // For a workflow activity - the run ID of the workflow which scheduled this activity. + // For a standalone activity - the run ID of the activity. string run_id = 3; // Id of the activity to complete string activity_id = 4; @@ -624,9 +628,10 @@ message RespondActivityTaskFailedResponse { message RespondActivityTaskFailedByIdRequest { // Namespace of the workflow which scheduled this activity string namespace = 1; - // Id of the workflow which scheduled this activity + // Id of the workflow which scheduled this activity, leave empty to target a standalone activity string workflow_id = 2; - // Run Id of the workflow which scheduled this activity + // For a workflow activity - the run ID of the workflow which scheduled this activity. + // For a standalone activity - the run ID of the activity. string run_id = 3; // Id of the activity to fail string activity_id = 4; @@ -671,9 +676,10 @@ message RespondActivityTaskCanceledResponse { message RespondActivityTaskCanceledByIdRequest { // Namespace of the workflow which scheduled this activity string namespace = 1; - // Id of the workflow which scheduled this activity + // Id of the workflow which scheduled this activity, leave empty to target a standalone activity string workflow_id = 2; - // Run Id of the workflow which scheduled this activity + // For a workflow activity - the run ID of the workflow which scheduled this activity. + // For a standalone activity - the run ID of the activity. string run_id = 3; // Id of the activity to confirm is cancelled string activity_id = 4; @@ -1157,6 +1163,8 @@ message GetClusterInfoResponse { int32 history_shard_count = 6; string persistence_store = 7; string visibility_store = 8; + int64 initial_failover_version = 9; + int64 failover_version_increment = 10; } message GetSystemInfoRequest { @@ -1886,6 +1894,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; @@ -1919,11 +1928,13 @@ message UpdateActivityOptionsRequest { bool restore_original = 8; } +// Deprecated. See UpdateActivityExecutionOptionsResponse. message UpdateActivityOptionsResponse { // Activity options after an update temporal.api.activity.v1.ActivityOptions activity_options = 1; } +// Deprecated. See PauseActivityExecutionRequest. message PauseActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -1938,6 +1949,7 @@ message PauseActivityRequest { // Only the activity with this ID will be paused. string id = 4; // Pause all running activities of this type. + // Note: Experimental - the behavior of pause by activity type might change in a future release. string type = 5; } @@ -1945,9 +1957,11 @@ message PauseActivityRequest { string reason = 6; } +// Deprecated. See PauseActivityExecutionResponse. message PauseActivityResponse { } +// Deprecated. See UnpauseActivityExecutionRequest. message UnpauseActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -1977,10 +1991,12 @@ message UnpauseActivityRequest { google.protobuf.Duration jitter = 9; } +// Deprecated. See UnpauseActivityExecutionResponse. message UnpauseActivityResponse { } // NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities +// Deprecated. See ResetActivityExecutionRequest. message ResetActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -2018,6 +2034,7 @@ message ResetActivityRequest { } +// Deprecated. See ResetActivityExecutionResponse. message ResetActivityResponse { } @@ -2163,6 +2180,10 @@ message SetWorkerDeploymentCurrentVersionRequest { // pollers have not reached to the server yet. Only set this if you expect those pollers to // never arrive. bool ignore_missing_task_queues = 6; + // Optional. By default this request will be rejected if no pollers have been seen for the proposed + // Current Version, in order to protect users from routing tasks to pollers that do not exist, leading + // to possible timeouts. Pass `true` here to bypass this protection. + bool allow_no_pollers = 9; } message SetWorkerDeploymentCurrentVersionResponse { @@ -2215,6 +2236,10 @@ message SetWorkerDeploymentRampingVersionRequest { // that the percentage changes. Also note that the check is against the deployment's Current // Version, not the previous Ramping Version. bool ignore_missing_task_queues = 7; + // Optional. By default this request will be rejected if no pollers have been seen for the proposed + // Current Version, in order to protect users from routing tasks to pollers that do not exist, leading + // to possible timeouts. Pass `true` here to bypass this protection. + bool allow_no_pollers = 10; } message SetWorkerDeploymentRampingVersionResponse { @@ -2248,8 +2273,8 @@ message ListWorkerDeploymentsResponse { google.protobuf.Timestamp create_time = 2; temporal.api.deployment.v1.RoutingConfig routing_config = 3; // Summary of the version that was added most recently in the Worker Deployment. - temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary latest_version_summary = 4; - // Summary of the current version of the Worker Deployment. + temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary latest_version_summary = 4; + // Summary of the current version of the Worker Deployment. temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary current_version_summary = 5; // Summary of the ramping version of the Worker Deployment. temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary ramping_version_summary = 6; @@ -2309,6 +2334,39 @@ message UpdateWorkerDeploymentVersionMetadataResponse { temporal.api.deployment.v1.VersionMetadata metadata = 1; } +// Update the ManagerIdentity of a Worker Deployment. +message SetWorkerDeploymentManagerRequest { + string namespace = 1; + string deployment_name = 2; + + oneof new_manager_identity { + // Arbitrary value for `manager_identity`. + // Empty will unset the field. + string manager_identity = 3; + + // True will set `manager_identity` to `identity`. + bool self = 4; + } + + // Optional. This can be the value of conflict_token from a Describe, or another Worker + // Deployment API. Passing a non-nil conflict token will cause this request to fail if the + // Deployment's configuration has been modified between the API call that generated the + // token and this one. + bytes conflict_token = 5; + + // Required. The identity of the client who initiated this request. + string identity = 6; +} + +message SetWorkerDeploymentManagerResponse { + // This value is returned so that it can be optionally passed to APIs + // that write to the Worker Deployment state to ensure that the state + // did not change between this API call and a future write. + bytes conflict_token = 1; + + // What the `manager_identity` field was before this change. + string previous_manager_identity = 2; +} // Returns the Current Deployment of a deployment series. // [cleanup-wv-pre-release] Pre-release deployment APIs, clean up later @@ -2537,3 +2595,376 @@ message UpdateWorkerConfigResponse { // Once we support sending update to a multiple workers - it will be converted into a batch job, and job id will be returned. } } + +message DescribeWorkerRequest { + // Namespace this worker belongs to. + string namespace = 1; + + // Worker instance key to describe. + string worker_instance_key = 2; +} + +message DescribeWorkerResponse { + temporal.api.worker.v1.WorkerInfo worker_info = 1; +} + +message StartActivityExecutionRequest { + string namespace = 1; + // The identity of the client who initiated this request + string identity = 2; + // A unique identifier for this start request. Typically UUIDv4. + string request_id = 3; + + string activity_id = 4; + temporal.api.common.v1.ActivityType activity_type = 5; + temporal.api.activity.v1.ActivityOptions options = 6; + // Serialized arguments to the activity. These are passed as arguments to the activity function. + temporal.api.common.v1.Payloads input = 7; + + // Defines whether to allow re-using the activity id from a previously *closed* activity. + // The default policy is ID_REUSE_POLICY_ALLOW_DUPLICATE. + temporal.api.enums.v1.IdReusePolicy id_reuse_policy = 8; + // Defines how to resolve an activity id conflict with a *running* activity. + // The default policy is ID_CONFLICT_POLICY_FAIL. + temporal.api.enums.v1.IdConflictPolicy id_conflict_policy = 9; + + // Arbitrary structured data that can be attached to the activity execution and made available via the list and + // describe APIs. + temporal.api.common.v1.Memo memo = 10; + // Search attributes for indexing. + temporal.api.common.v1.SearchAttributes search_attributes = 11; + // Header for context propagation and tracing purposes. + temporal.api.common.v1.Header header = 12; + // Request to get the first activity task inline in the response bypassing matching service and worker polling. + // If set to `true` the caller is expected to have a worker available and capable of processing the task. + // The returned task will be marked as started and is expected to be completed by the specified + // `schedule_to_close_timeout`. + bool request_eager_execution = 13; + // Callbacks to be called by the server when this activity reaches a terminal status. + // Callback addresses must be whitelisted in the server's dynamic configuration. + repeated temporal.api.common.v1.Callback completion_callbacks = 14; + // Metadata for use by user interfaces to display the fixed as-of-start summary and details of the activity. + temporal.api.sdk.v1.UserMetadata user_metadata = 15; + // Links to be associated with the activity. + repeated temporal.api.common.v1.Link links = 16; + // Defines actions to be done to the existing running activity when ID_CONFLICT_POLICY_USE_EXISTING is used. If not + // set or empty, it won't do anything to the existing running activity. + temporal.api.activity.v1.OnConflictOptions on_conflict_options = 17; + // Priority metadata + temporal.api.common.v1.Priority priority = 18; +} + +message StartActivityExecutionResponse { + // The run ID of the activity that was started - or used (via ID_CONFLICT_POLICY_USE_EXISTING). + string run_id = 1; + // If true, a new activity was started. + bool started = 2; + // When `request_eager_execution` is set on the `StartActivityExecutionRequest`, the server will return the first + // activity task to be eagerly executed. + // The caller is expected to have a worker available to process the task. + PollActivityTaskQueueResponse eager_task = 3; + // Link to the workflow event. + temporal.api.common.v1.Link link = 4; +} + +message DescribeActivityExecutionRequest { + string namespace = 1; + string activity_id = 2; + // Activity run ID, targets the latest run if run_id is empty. + string run_id = 3; + + // If true, the activity input is returned in the response. + bool include_input = 4; + + // If not empty, turns this request into a long poll that is unblocked when the activity state changes from the time + // the token was returned. + // This token is returned as part of the `DescribeActivityExecutionResponse`. + bytes long_poll_token = 5; +} + +message DescribeActivityExecutionResponse { + temporal.api.activity.v1.ActivityExecutionInfo info = 1; + + // A token that can be passed in via a subsequent `DescribeActivityExecutionRequest` to long poll on the activity + // state as it makes progress. + bytes long_poll_token = 2; +} + +message ListActivityExecutionsRequest { + string namespace = 1; + // Max number of executions to return per page. + int32 page_size = 2; + // Token returned in ListActivityExecutionsResponse. + bytes next_page_token = 3; + // Visibility query, see https://docs.temporal.io/list-filter for the syntax. + string query = 4; +} + +message ListActivityExecutionsResponse { + repeated temporal.api.activity.v1.ActivityListInfo executions = 1; + // Token to use to fetch the next page. If empty, there is no next page. + bytes next_page_token = 2; +} + +message CountActivityExecutionsRequest { + string namespace = 1; + // Visibility query, see https://docs.temporal.io/list-filter for the syntax. + string query = 2; +} + +message CountActivityExecutionsResponse { + // If `query` is not grouping by any field, the count is an approximate number + // of activities that match the query. + // If `query` is grouping by a field, the count is simply the sum of the counts + // of the groups returned in the response. This number can be smaller than the + // total number of activities matching the query. + int64 count = 1; + + // Contains the groups if the request is grouping by a field. + // The list might not be complete, and the counts of each group is approximate. + repeated AggregationGroup groups = 2; + + message AggregationGroup { + repeated temporal.api.common.v1.Payload group_values = 1; + int64 count = 2; + } +} + +message GetActivityExecutionResultRequest { + string namespace = 1; + string activity_id = 2; + // Activity run ID, targets the latest run if run_id is empty. + string run_id = 3; + // If set, turns this request into a long poll that is unblocked when the activity reaches a terminal status. + // The wait duration is capped by the request's context deadline or by the maximum enforced long poll interval + // allowed by the server. + bool wait = 4; +} + +message GetActivityExecutionResultResponse { + // The run ID of the completed activity, may be used in case a run ID was not specified in the request. + string run_id = 1; + + oneof outcome { + // The result if the activity completed successfully. + temporal.api.common.v1.Payloads result = 2; + // The failure if the activity completed unsuccessfully. + temporal.api.failure.v1.Failure failure = 3; + } +} + +message RequestCancelActivityExecutionRequest { + string namespace = 1; + string activity_id = 2; + // Activity run ID, targets the latest run if run_id is empty. + string run_id = 3; + // The identity of the worker/client. + string identity = 4; + // Used to de-dupe cancellation requests. + string request_id = 5; + // Reason for requesting the cancellation, recorded and available via the DescribeActivityExecution API. + // Not propagated to a worker if an activity attempt is currently running. + string reason = 6; +} + +message RequestCancelActivityExecutionResponse { +} + +message TerminateActivityExecutionRequest { + string namespace = 1; + string activity_id = 2; + // Activity run ID, targets the latest run if run_id is empty. + string run_id = 3; + // Reason for requesting the termination, recorded in in the activity's result failure outcome. + string reason = 4; + // The identity of the worker/client. + string identity = 5; +} + +message TerminateActivityExecutionResponse { +} + +message DeleteActivityExecutionRequest { + string namespace = 1; + string activity_id = 2; + // Activity run ID, targets the latest run if run_id is empty. + string run_id = 3; +} + +message DeleteActivityExecutionResponse { +} + +// TODO: update batch +// 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, update options for a workflow activity (or activities) for the given workflow ID. If empty, target a + // standalone activity. + string workflow_id = 2; + // Update options for an activity with this ID. Must be provided for a standalone activity. + // Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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; + + // Update all pending workflow activities of this type. + // Only available if workflow_id is provided. + // Mutually exclusive with activity_id and all_workflow_activities. + // + // Note: Experimental - the behavior of updating by activity type may change or be removed in a future release. + string workflow_activity_type = 6; + // Update all pending workflow activities. + // Only available if workflow_id is provided. + // Mutually exclusive with activity_id and workflow_activity_type. + // + // Note: Experimental - the behavior of updating all activities may change or be removed in a future release. + bool all_workflow_activities = 7; + + // Activity options. Partial updates are accepted and controlled by update_mask + // Mutually exclusive with restore_original. + temporal.api.activity.v1.ActivityOptions activity_options = 8; + + // Controls which fields from `activity_options` will be applied + google.protobuf.FieldMask update_mask = 9; + + // If set, the activity options will be restored to the defaults. + // Default options are then options activity was originally created with. + // For workflow activities the original options are restored from first ActivityTaskScheduled event. + // Mutually exclusive with activity_options. + bool restore_original = 10; +} + +message UpdateActivityExecutionOptionsResponse { + // Activity options after an update + temporal.api.activity.v1.ActivityOptions activity_options = 1; +} + +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; +} + +message PauseActivityExecutionResponse { +} + +// TODO: update batch +message UnpauseActivityExecutionRequest { + // Namespace of the workflow which scheduled this activity. + string namespace = 1; + + // If provided, unpause a workflow activity (or activities) for the given workflow ID. + // If empty, target a standalone activity. + string workflow_id = 2; + // Unpause an activity with this ID. Must be provided for a standalone activity. + // Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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; + + // Unpause all currently paused workflow activities of this type. + // Only available if workflow_id is provided. + // Mutually exclusive with activity_id and all_workflow_activities. + // + // Note: Experimental - the behavior of unpausing by activity type may change or be removed in a future release. + string workflow_activity_type = 6; + // Unpause all paused workflow activities. + // Only available if workflow_id is provided. + // Mutually exclusive with activity_id and workflow_activity_type. + // + // Note: Experimental - the behavior of unpausing all activities may change or be removed in a future release. + bool all_workflow_activities = 7; + + // Providing this flag will also reset the number of attempts. + bool reset_attempts = 8; + + // Providing this flag will also reset the heartbeat details. + bool reset_heartbeat = 9; + + // If set, the activity will start at a random time within the specified jitter duration. + google.protobuf.Duration jitter = 10; +} + +message UnpauseActivityExecutionResponse { +} + +// TODO: update batch +// 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, reset a workflow activity (or activities) for the given workflow ID. + // If empty, target a standalone activity. + string workflow_id = 2; + // Reset an activity with this ID. Must be provided for a standalone activity. + // Mutually exclusive with workflow_activity_type and all_workflow_activities. + 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; + + // Reset all pending workflow activities of this type. + // Only available if workflow_id is provided. + // Mutually exclusive with activity_id and all_workflow_activities. + // + // Note: Experimental - the behavior of resetting by activity type may change or be removed in a future release. + string workflow_activity_type = 6; + // Reset all pending workflow activities. + // Only available if workflow_id is provided. + // Mutually exclusive with activity_id and workflow_activity_type. + // + // Note: Experimental - the behavior of resetting all activities may change or be removed in a future release. + bool all_workflow_activities = 7; + + // Indicates that activity should reset heartbeat details. + // This flag will be applied only to the new instance of the activity. + bool reset_heartbeat = 8; + + // If activity is paused, it will remain paused after reset + bool keep_paused = 9; + + // 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 = 10; + + // If set, the activity options will be restored to the defaults. + // Default options are then options activity was originally created with. + // For workflow activities the original options are restored from first ActivityTaskScheduled event. + bool restore_original_options = 11; + +} + +message ResetActivityExecutionResponse { +} diff --git a/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto b/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto index cc74230af..5a7b82387 100644 --- a/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +++ b/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto @@ -133,9 +133,9 @@ service WorkflowService { } }; } - - // GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse - // order (starting from last event). Fails with`NotFound` if the specified workflow execution is + + // GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse + // order (starting from last event). Fails with`NotFound` if the specified workflow execution is // unknown to the service. rpc GetWorkflowExecutionHistoryReverse (GetWorkflowExecutionHistoryReverseRequest) returns (GetWorkflowExecutionHistoryReverseResponse) { option (google.api.http) = { @@ -458,7 +458,8 @@ service WorkflowService { }; } - // ScanWorkflowExecutions is a visibility API to list large amount of workflow executions in a specific namespace without order. + // ScanWorkflowExecutions _was_ a visibility API to list large amount of workflow executions in a specific namespace without order. + // It has since been deprecated in favor of `ListWorkflowExecutions` and rewritten to use `ListWorkflowExecutions` internally. // // Deprecated: Replaced with `ListWorkflowExecutions`. // (-- api-linter: core::0127::http-annotation=disabled @@ -669,8 +670,8 @@ service WorkflowService { // members are compatible with one another. // // A single build id may be mapped to multiple task queues using this API for cases where a single process hosts - // multiple workers. - // + // multiple workers. + // // To query which workers can be retired, use the `GetWorkerTaskReachability` API. // // NOTE: The number of task queues mapped to a single build id is limited by the `limit.taskQueuesPerBuildId` @@ -923,6 +924,19 @@ service WorkflowService { }; } + // Set/unset the ManagerIdentity of a Worker Deployment. + // Experimental. This API might significantly change or be removed in a future release. + rpc SetWorkerDeploymentManager (SetWorkerDeploymentManagerRequest) returns (SetWorkerDeploymentManagerResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/worker-deployments/{deployment_name}/set-manager" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/worker-deployments/{deployment_name}/set-manager" + body: "*" + } + }; + } + // Invokes the specified Update function on user Workflow code. rpc UpdateWorkflowExecution(UpdateWorkflowExecutionRequest) returns (UpdateWorkflowExecutionResponse) { option (google.api.http) = { @@ -1007,8 +1021,30 @@ service WorkflowService { rpc RespondNexusTaskFailed(RespondNexusTaskFailedRequest) returns (RespondNexusTaskFailedResponse) { } + // UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID or type. + // If there are multiple pending activities of the provided type - all of them will be updated. + rpc UpdateActivityExecutionOptions (UpdateActivityExecutionOptionsRequest) returns (UpdateActivityExecutionOptionsResponse) { + option (google.api.http) = { + post: "/namespaces/activities/{activity_id}/update-options" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/activities/{activity_id}/update-options" + body: "*" + } + 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: "*" + } + }; + } + // UpdateActivityOptions is called by the client to update the options of an activity by its ID or type. // If there are multiple pending activities of the provided type - all of them will be updated. + // Deprecated. See UpdateActivityExecutionOptions. rpc UpdateActivityOptions (UpdateActivityOptionsRequest) returns (UpdateActivityOptionsResponse) { option (google.api.http) = { post: "/namespaces/{namespace}/activities/update-options" @@ -1032,6 +1068,41 @@ service WorkflowService { }; } + // PauseActivityExecution 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 + rpc PauseActivityExecution (PauseActivityExecutionRequest) returns (PauseActivityExecutionResponse) { + option (google.api.http) = { + post: "/namespaces/activities/{activity_id}/pause" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/activities/{activity_id}/pause" + body: "*" + } + 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: "*" + } + }; + } + // 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 // @@ -1048,6 +1119,7 @@ service WorkflowService { // - The activity should respond to the cancellation accordingly. // // Returns a `NotFound` error if there is no pending activity with the provided ID or type + // Deprecated. See PauseActivityExecution. rpc PauseActivity (PauseActivityRequest) returns (PauseActivityResponse) { option (google.api.http) = { post: "/namespaces/{namespace}/activities/pause" @@ -1059,6 +1131,38 @@ service WorkflowService { }; } + // UnpauseActivityExecution 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 + rpc UnpauseActivityExecution (UnpauseActivityExecutionRequest) returns (UnpauseActivityExecutionResponse) { + option (google.api.http) = { + post: "/namespaces/activities/{activity_id}/unpause" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/activities/{activity_id}/unpause" + body: "*" + } + 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: "*" + } + }; + } + // 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. // @@ -1072,6 +1176,7 @@ service WorkflowService { // '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 + // Deprecated. See UnpauseActivityExecution. rpc UnpauseActivity (UnpauseActivityRequest) returns (UnpauseActivityResponse) { option (google.api.http) = { post: "/namespaces/{namespace}/activities/unpause" @@ -1083,6 +1188,42 @@ service WorkflowService { }; } + // ResetActivityExecution 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. + // + // 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/activities/{activity_id}/reset" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/activities/{activity_id}/reset" + body: "*" + } + 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: "*" + } + }; + } + // 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. // @@ -1100,6 +1241,7 @@ service WorkflowService { // '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. + // Deprecated. See ResetActivityExecution. rpc ResetActivity (ResetActivityRequest) returns (ResetActivityResponse) { option (google.api.http) = { post: "/namespaces/{namespace}/activities/reset" @@ -1235,4 +1377,118 @@ service WorkflowService { } }; } + + // DescribeWorker returns information about the specified worker. + rpc DescribeWorker (DescribeWorkerRequest) returns (DescribeWorkerResponse) { + option (google.api.http) = { + get: "/namespaces/{namespace}/workers/describe/{worker_instance_key}" + additional_bindings { + get: "/api/v1/namespaces/{namespace}/workers/describe/{worker_instance_key}" + } + }; + } + + // StartActivityExecution starts a new activity execution. + // + // Returns an `ExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace + // unless permitted by the specified ID conflict policy. + rpc StartActivityExecution (StartActivityExecutionRequest) returns (StartActivityExecutionResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/activities/{activity_id}" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}" + body: "*" + } + }; + } + + // DescribeActivityExecution returns information about the specified activity execution. + // Pass in a long_poll_token to turn this request into a long poll that gets unblocked when the activity makes + // progress. + // In case the activity has not made progress by the time the long poll request times out, an empty response is + // returned and the caller may issue an identical DescribeActivityExecution request to continue polling. + rpc DescribeActivityExecution (DescribeActivityExecutionRequest) returns (DescribeActivityExecutionResponse) { + option (google.api.http) = { + get: "/namespaces/{namespace}/activities/{activity_id}" + additional_bindings { + get: "/api/v1/namespaces/{namespace}/activities/{activity_id}" + } + }; + } + + // ListActivityExecutions is a visibility API to list activity executions in a specific namespace. + rpc ListActivityExecutions (ListActivityExecutionsRequest) returns (ListActivityExecutionsResponse) { + option (google.api.http) = { + get: "/namespaces/{namespace}/activities" + additional_bindings { + get: "/api/v1/namespaces/{namespace}/activities" + } + }; + } + + // CountActivityExecutions is a visibility API to count of activity executions in a specific namespace. + rpc CountActivityExecutions (CountActivityExecutionsRequest) returns (CountActivityExecutionsResponse) { + option (google.api.http) = { + get: "/namespaces/{namespace}/activity-count" + additional_bindings { + get: "/api/v1/namespaces/{namespace}/activity-count" + } + }; + } + + // GetActivityExecutionResult returns the activity result if it is in a terminal status or (optionally) wait for it + // to reach one. + rpc GetActivityExecutionResult (GetActivityExecutionResultRequest) returns (GetActivityExecutionResultResponse) { + option (google.api.http) = { + get: "/namespaces/{namespace}/activities/{activity_id}/result" + additional_bindings { + get: "/api/v1/namespaces/{namespace}/activities/{activity_id}/result" + } + }; + } + + // RequestCancelActivityExecution requests cancellation of an activity execution. + // + // Requesting to cancel an activity does not automatically transition the activity to canceled status. If the + // activity has a currently running attempt, the activity will only transition to canceled status if the current + // attempt is unsuccessful. + // TODO: Clarify what happens if there are no more allowed retries after the current attempt. + // + // It returns success if the requested activity is already closed. + // TODO: This ^^ is copied from RequestCancelWorkflowExecution, do we want to preserve this behavior? + rpc RequestCancelActivityExecution (RequestCancelActivityExecutionRequest) returns (RequestCancelActivityExecutionResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/activities/{activity_id}/cancel" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/cancel" + body: "*" + } + }; + } + + // TerminateActivityExecution terminates an existing activity execution immediately. + // + // Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a + // running attempt and will be requested to be canceled by the server when it heartbeats. + rpc TerminateActivityExecution (TerminateActivityExecutionRequest) returns (TerminateActivityExecutionResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/activities/{activity_id}/terminate" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/terminate" + body: "*" + } + }; + } + + // DeleteActivityExecution asynchronously deletes a specific activity execution (when + // ActivityExecution.run_id is provided) or the latest activity execution (when + // ActivityExecution.run_id is not provided). If the activity EXecution is running, it will be + // terminated before deletion. + // + // (-- 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) {} }