diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index ddbc48c61..26843d743 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -716,6 +716,102 @@ ] } }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/pause": { + "post": { + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Pause an activity with this ID. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/reset": { + "post": { + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ResetActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", @@ -809,6 +905,101 @@ ] } }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/unpause": { + "post": { + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/activities/{activityId}/update-options": { + "post": { + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/activity-complete": { "post": { "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", @@ -3919,15 +4110,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById4", + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1PauseActivityExecutionResponse" } }, "default": { @@ -3940,21 +4132,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "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": "Id of the activity to confirm is cancelled", + "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" @@ -3964,7 +4156,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" } } ], @@ -3973,15 +4165,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/pause": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { "post": { - "summary": "Note: This is an experimental API and the behavior may change in a future release.\nPauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in\n- The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history\n- No new workflow tasks or activity tasks are dispatched.\n - Any workflow task currently executing on the worker will be allowed to complete.\n - Any activity task currently executing will be paused.\n- All server-side events will continue to be processed by the server.\n- Queries & Updates on a paused workflow will be rejected.", - "operationId": "PauseWorkflowExecution2", + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseWorkflowExecutionResponse" + "$ref": "#/definitions/v1ResetActivityExecutionResponse" } }, "default": { @@ -3994,14 +4187,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow to pause.", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "ID of the workflow execution to be paused. Required.", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -4011,7 +4211,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" } } ], @@ -4020,16 +4220,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { "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": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1SignalWithStartWorkflowExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -4042,19 +4241,21 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", + "description": "Id of the workflow which scheduled this activity, leave empty to 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": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -4064,7 +4265,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWithStartWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -4073,15 +4274,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause": { "post": { - "summary": "Note: This is an experimental API and the behavior may change in a future release.\nUnpauseWorkflowExecution unpauses a previously paused workflow execution specified in the request.\nUnpausing a workflow execution results in\n- The workflow execution status changes to `RUNNING` and a new WORKFLOW_EXECUTION_UNPAUSED event is added to the history\n- Workflow tasks and activity tasks are resumed.", - "operationId": "UnpauseWorkflowExecution2", + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UnpauseWorkflowExecutionResponse" + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" } }, "default": { @@ -4094,14 +4296,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow to unpause.", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "ID of the workflow execution to be paused. Required.", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -4111,7 +4320,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" } } ], @@ -4120,15 +4329,15 @@ ] } }, - "/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}/update-options": { + "post": { + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ListNexusEndpointsResponse" + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" } }, "default": { @@ -4140,31 +4349,232 @@ }, "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, targets a workflow activity 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": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", + "in": "path", + "required": true, "type": "string" - } - ], - "tags": [ - "OperatorService" - ] + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/pause": { + "post": { + "summary": "Note: This is an experimental API and the behavior may change in a future release.\nPauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in\n- The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history\n- No new workflow tasks or activity tasks are dispatched.\n - Any workflow task currently executing on the worker will be allowed to complete.\n - Any activity task currently executing will be paused.\n- All server-side events will continue to be processed by the server.\n- Queries & Updates on a paused workflow will be rejected.", + "operationId": "PauseWorkflowExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow to pause.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "ID of the workflow execution to be paused. Required.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { + "post": { + "summary": "SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if\nit isn't yet started.", + "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/v1SignalWithStartWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "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/WorkflowServiceSignalWithStartWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause": { + "post": { + "summary": "Note: This is an experimental API and the behavior may change in a future release.\nUnpauseWorkflowExecution unpauses a previously paused workflow execution specified in the request.\nUnpausing a workflow execution results in\n- The workflow execution status changes to `RUNNING` and a new WORKFLOW_EXECUTION_UNPAUSED event is added to the history\n- Workflow tasks and activity tasks are resumed.", + "operationId": "UnpauseWorkflowExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnpauseWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow to unpause.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "ID of the workflow execution to be paused. Required.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUnpauseWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/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", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListNexusEndpointsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "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.", @@ -5129,7 +5539,193 @@ }, { "name": "activityId", - "description": "Id of the activity to complete", + "description": "Id of the activity to complete", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/fail": { + "post": { + "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/v1RespondActivityTaskFailedByIdResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Id of the activity to fail", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/heartbeat": { + "post": { + "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/v1RecordActivityTaskHeartbeatByIdResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Id of the activity we're heartbeating", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/outcome": { + "get": { + "summary": "PollActivityExecution long-polls for an activity execution to complete and returns the\noutcome (result or failure).", + "operationId": "PollActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PollActivityExecutionResponse" + } + }, + "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. If empty the request targets the latest run.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/pause": { + "post": { + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "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" @@ -5139,7 +5735,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" } } ], @@ -5148,15 +5744,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/fail": { + "/namespaces/{namespace}/activities/{activityId}/reset": { "post": { - "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskFailedById", + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" + "$ref": "#/definitions/v1ResetActivityExecutionResponse" } }, "default": { @@ -5169,14 +5766,14 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to fail", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -5186,7 +5783,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" } } ], @@ -5195,15 +5792,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/heartbeat": { + "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RecordActivityTaskHeartbeatById", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -5223,7 +5820,7 @@ }, { "name": "activityId", - "description": "Id of the activity we're heartbeating", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -5233,7 +5830,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -5242,15 +5839,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/outcome": { - "get": { - "summary": "PollActivityExecution long-polls for an activity execution to complete and returns the\noutcome (result or failure).", - "operationId": "PollActivityExecution", + "/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.", + "operationId": "TerminateActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PollActivityExecutionResponse" + "$ref": "#/definitions/v1TerminateActivityExecutionResponse" } }, "default": { @@ -5274,11 +5872,12 @@ "type": "string" }, { - "name": "runId", - "description": "Activity run ID. If empty the request targets the latest run.", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" + } } ], "tags": [ @@ -5286,15 +5885,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { + "/namespaces/{namespace}/activities/{activityId}/unpause": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById", + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" } }, "default": { @@ -5307,14 +5907,14 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -5324,7 +5924,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" } } ], @@ -5333,16 +5933,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/terminate": { + "/namespaces/{namespace}/activities/{activityId}/update-options": { "post": { - "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", - "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", - "operationId": "TerminateActivityExecution", + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateActivityExecutionResponse" + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" } }, "default": { @@ -5355,12 +5954,14 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -5370,7 +5971,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" } } ], @@ -8016,14 +8617,211 @@ }, "/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", + "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": "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": { @@ -8041,14 +8839,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" @@ -8058,7 +8849,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" } } ], @@ -8067,15 +8858,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/terminate": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete": { "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": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCompletedById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateWorkflowExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" } }, "default": { @@ -8088,12 +8879,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": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Id of the activity to complete", "in": "path", "required": true, "type": "string" @@ -8103,7 +8903,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" } } ], @@ -8112,15 +8912,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update-options": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail": { "post": { - "summary": "UpdateWorkflowExecutionOptions partially updates the WorkflowExecutionOptions of an existing workflow execution.", - "operationId": "UpdateWorkflowExecutionOptions", + "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskFailedById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateWorkflowExecutionOptionsResponse" + "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" } }, "default": { @@ -8133,13 +8933,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": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Id of the activity to fail", "in": "path", "required": true, "type": "string" @@ -8149,7 +8957,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionOptionsBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" } } ], @@ -8158,15 +8966,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/update/{request.input.name}": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat": { "post": { - "summary": "Invokes the specified Update function on user Workflow code.", - "operationId": "UpdateWorkflowExecution", + "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RecordActivityTaskHeartbeatById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateWorkflowExecutionResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" } }, "default": { @@ -8179,20 +8987,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": "Id of the workflow which scheduled this activity, leave empty to 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": "Id of the activity we're heartbeating", "in": "path", "required": true, "type": "string" @@ -8202,7 +9011,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" } } ], @@ -8211,16 +9020,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause": { "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": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1StartWorkflowExecutionResponse" + "$ref": "#/definitions/v1PauseActivityExecutionResponse" } }, "default": { @@ -8233,12 +9042,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": "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" @@ -8248,7 +9066,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceStartWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" } } ], @@ -8257,15 +9075,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset": { "post": { - "summary": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCompletedById3", + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" + "$ref": "#/definitions/v1ResetActivityExecutionResponse" } }, "default": { @@ -8278,21 +9097,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to complete", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -8302,7 +9121,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" } } ], @@ -8311,15 +9130,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskFailedById3", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -8346,7 +9165,7 @@ }, { "name": "activityId", - "description": "Id of the activity to fail", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -8356,7 +9175,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -8365,15 +9184,16 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause": { "post": { - "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RecordActivityTaskHeartbeatById3", + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" } }, "default": { @@ -8386,21 +9206,21 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity we're heartbeating", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -8410,7 +9230,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" } } ], @@ -8419,15 +9239,15 @@ ] } }, - "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById3", + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" } }, "default": { @@ -8447,14 +9267,14 @@ }, { "name": "workflowId", - "description": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity", + "description": "If provided, targets a workflow activity for the given workflow ID.\nIf empty, target a standalone activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "description": "The ID of the activity to target. Must be provided for a standalone activity.\nMutually exclusive with workflow_activity_type.", "in": "path", "required": true, "type": "string" @@ -8464,7 +9284,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" } } ], @@ -9229,6 +10049,28 @@ "type": "string", "description": "Reason to pause the activity." } + }, + "description": "Deprecated. Use `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." + }, + "reason": { + "type": "string", + "description": "Reason to pause the activity." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." + } } }, "WorkflowServicePauseWorkflowExecutionBody": { @@ -9447,7 +10289,40 @@ "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event." } }, - "title": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities" + "description": "NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities\nDeprecated. Use `ResetActivityExecutionRequest`." + }, + "WorkflowServiceResetActivityExecutionBody": { + "type": "object", + "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." + }, + "resetHeartbeat": { + "type": "boolean", + "description": "Indicates that activity should reset heartbeat details.\nThis flag will be applied only to the new instance of the activity." + }, + "keepPaused": { + "type": "boolean", + "title": "If activity is paused, it will remain paused after reset" + }, + "jitter": { + "type": "string", + "title": "If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.\n(unless it is paused and keep_paused is set)" + }, + "restoreOriginalOptions": { + "type": "boolean", + "description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." + } + } }, "WorkflowServiceResetWorkflowExecutionBody": { "type": "object", @@ -10289,6 +11164,40 @@ "type": "string", "description": "If set, the activity will start at a random time within the specified jitter duration." } + }, + "description": "Deprecated. Use `UnpauseActivityExecutionRequest`." + }, + "WorkflowServiceUnpauseActivityExecutionBody": { + "type": "object", + "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." + }, + "resetAttempts": { + "type": "boolean", + "description": "Providing this flag will also reset the number of attempts." + }, + "resetHeartbeat": { + "type": "boolean", + "description": "Providing this flag will also reset the heartbeat details." + }, + "reason": { + "type": "string", + "description": "Reason to unpause the activity." + }, + "jitter": { + "type": "string", + "description": "If set, the activity will start at a random time within the specified jitter duration." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." + } } }, "WorkflowServiceUnpauseWorkflowExecutionBody": { @@ -10312,6 +11221,35 @@ } } }, + "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" + }, + "activityOptions": { + "$ref": "#/definitions/v1ActivityOptions", + "title": "Activity options. Partial updates are accepted and controlled by update_mask" + }, + "updateMask": { + "type": "string", + "title": "Controls which fields from `activity_options` will be applied" + }, + "restoreOriginal": { + "type": "boolean", + "description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected." + }, + "resourceId": { + "type": "string", + "description": "Resource ID for routing. Contains \"workflow:{workflow_id}\" for workflow activities or \"activity:{activity_id}\" for standalone activities." + } + } + }, "WorkflowServiceUpdateActivityOptionsBody": { "type": "object", "properties": { @@ -10348,7 +11286,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", @@ -14202,9 +15140,13 @@ "v1PatchScheduleResponse": { "type": "object" }, - "v1PauseActivityResponse": { + "v1PauseActivityExecutionResponse": { "type": "object" }, + "v1PauseActivityResponse": { + "type": "object", + "description": "Deprecated. Use `PauseActivityExecutionResponse`." + }, "v1PauseWorkflowExecutionResponse": { "type": "object", "description": "Response to a successful PauseWorkflowExecution request." @@ -14985,9 +15927,13 @@ }, "description": "RequestIdInfo contains details of a request ID." }, - "v1ResetActivityResponse": { + "v1ResetActivityExecutionResponse": { "type": "object" }, + "v1ResetActivityResponse": { + "type": "object", + "description": "Deprecated. Use `ResetActivityExecutionRequest`." + }, "v1ResetOptions": { "type": "object", "properties": { @@ -16402,14 +17348,18 @@ } } }, - "v1UnpauseActivityResponse": { + "v1UnpauseActivityExecutionResponse": { "type": "object" }, + "v1UnpauseActivityResponse": { + "type": "object", + "description": "Deprecated. Use `UnpauseActivityExecutionResponse`." + }, "v1UnpauseWorkflowExecutionResponse": { "type": "object", "description": "Response to a successful UnpauseWorkflowExecution request." }, - "v1UpdateActivityOptionsResponse": { + "v1UpdateActivityExecutionOptionsResponse": { "type": "object", "properties": { "activityOptions": { @@ -16418,6 +17368,16 @@ } } }, + "v1UpdateActivityOptionsResponse": { + "type": "object", + "properties": { + "activityOptions": { + "$ref": "#/definitions/v1ActivityOptions", + "title": "Activity options after an update" + } + }, + "description": "Deprecated. Use `UpdateActivityExecutionOptionsResponse`." + }, "v1UpdateAdmittedEventOrigin": { "type": "string", "enum": [ diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index cd503dccd..ba5f23a72 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -661,6 +661,119 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/pause: + post: + tags: + - WorkflowService + description: |- + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity + + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + - The activity should respond to the cancellation accordingly. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/reset: + post: + tags: + - WorkflowService + description: |- + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag), + + Flags: + + 'jitter': the activity will be scheduled at a random time within the jitter duration. + If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided. + 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset. + 'keep_paused': if the activity is paused, it will remain paused. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: post: tags: @@ -744,6 +857,101 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/unpause: + post: + tags: + - WorkflowService + description: |- + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Flags: + 'jitter': the activity will be scheduled at a random time within the jitter duration. + 'reset_attempts': the number of attempts will be reset. + 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{activityId}/update-options: + post: + tags: + - WorkflowService + description: |- + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: activityId + in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activity-complete: post: tags: @@ -3249,33 +3457,48 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCanceled`. This version allows clients to record failures by - namespace/workflow id/activity id instead of task token. + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCanceledById + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + - The activity should respond to the cancellation accordingly. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + 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: Id of the activity to confirm is cancelled + 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 @@ -3283,7 +3506,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' + $ref: '#/components/schemas/PauseActivityExecutionRequest' required: true responses: "200": @@ -3291,37 +3514,56 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' + $ref: '#/components/schemas/PauseActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/pause: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: post: tags: - WorkflowService description: |- - Note: This is an experimental API and the behavior may change in a future release. - PauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in - - The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history - - No new workflow tasks or activity tasks are dispatched. - - Any workflow task currently executing on the worker will be allowed to complete. - - Any activity task currently executing will be paused. - - All server-side events will continue to be processed by the server. - - Queries & Updates on a paused workflow will be rejected. - operationId: PauseWorkflowExecution + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag), + + Flags: + + 'jitter': the activity will be scheduled at a random time within the jitter duration. + If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided. + 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset. + 'keep_paused': if the activity is paused, it will remain paused. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow to pause. + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path - description: ID of the workflow execution to be paused. Required. + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. required: true schema: type: string @@ -3329,7 +3571,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseWorkflowExecutionRequest' + $ref: '#/components/schemas/ResetActivityExecutionRequest' required: true responses: "200": @@ -3337,31 +3579,237 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseWorkflowExecutionResponse' + $ref: '#/components/schemas/ResetActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if - it isn't yet started. - - If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history - and a workflow task is generated. - - If the workflow is not running or not found, then the workflow is created with - `WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a - workflow task is generated. + See `RespondActivityTaskCanceled`. This version allows clients to record failures by + namespace/workflow id/activity id instead of task token. (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "With" is used to indicate combined operation. --) - operationId: SignalWithStartWorkflowExecution + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskCanceledById + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + required: true + schema: + type: string + - name: activityId + in: path + description: Id of the activity to confirm is cancelled + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' + 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. + This API can be used to target a workflow activity or a standalone activity. + + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Flags: + 'jitter': the activity will be scheduled at a random time within the jitter duration. + 'reset_attempts': the number of attempts will be reset. + 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: workflowId + in: path + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options: + post: + tags: + - WorkflowService + description: |- + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/pause: + post: + tags: + - WorkflowService + description: |- + Note: This is an experimental API and the behavior may change in a future release. + PauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in + - The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history + - No new workflow tasks or activity tasks are dispatched. + - Any workflow task currently executing on the worker will be allowed to complete. + - Any activity task currently executing will be paused. + - All server-side events will continue to be processed by the server. + - Queries & Updates on a paused workflow will be rejected. + operationId: PauseWorkflowExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow to pause. + required: true + schema: + type: string + - name: workflowId + in: path + description: ID of the workflow execution to be paused. Required. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseWorkflowExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseWorkflowExecutionResponse' + 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: + - WorkflowService + description: |- + SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if + it isn't yet started. + + If the workflow is running, a `WORKFLOW_EXECUTION_SIGNALED` event is recorded in the history + and a workflow task is generated. + + If the workflow is not running or not found, then the workflow is created with + `WORKFLOW_EXECUTION_STARTED` and `WORKFLOW_EXECUTION_SIGNALED` events in its history, and a + workflow task is generated. + + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "With" is used to indicate combined operation. --) + operationId: SignalWithStartWorkflowExecution parameters: - name: namespace in: path @@ -4643,13 +5091,206 @@ paths: parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: activityId + in: path + description: Id of the activity to fail + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/heartbeat: + post: + tags: + - WorkflowService + description: |- + See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by + namespace/workflow id/activity id instead of task token. + + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RecordActivityTaskHeartbeatById + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: activityId + in: path + description: Id of the activity we're heartbeating + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/outcome: + get: + tags: + - WorkflowService + description: |- + PollActivityExecution long-polls for an activity execution to complete and returns the + outcome (result or failure). + operationId: PollActivityExecution + 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. If empty the request targets the latest run. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PollActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/pause: + post: + tags: + - WorkflowService + description: |- + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity + + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + - The activity should respond to the cancellation accordingly. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/reset: + post: + tags: + - WorkflowService + description: |- + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. + + Resetting an activity means: + * number of attempts will be reset to 0. + * activity timeouts will be reset. + * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + it will be scheduled immediately (* see 'jitter' flag), + + Flags: + + 'jitter': the activity will be scheduled at a random time within the jitter duration. + If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided. + 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset. + 'keep_paused': if the activity is paused, it will remain paused. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type. + operationId: ResetActivityExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity to fail + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. required: true schema: type: string @@ -4657,7 +5298,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' + $ref: '#/components/schemas/ResetActivityExecutionRequest' required: true responses: "200": @@ -4665,24 +5306,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' + $ref: '#/components/schemas/ResetActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/heartbeat: + /namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by + See `RespondActivityTaskCanceled`. This version allows clients to record failures by namespace/workflow id/activity id instead of task token. (-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RecordActivityTaskHeartbeatById + operationId: RespondActivityTaskCanceledById parameters: - name: namespace in: path @@ -4692,7 +5333,7 @@ paths: type: string - name: activityId in: path - description: Id of the activity we're heartbeating + description: Id of the activity to confirm is cancelled required: true schema: type: string @@ -4700,7 +5341,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' required: true responses: "200": @@ -4708,21 +5349,23 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/outcome: - get: + /namespaces/{namespace}/activities/{activityId}/terminate: + post: tags: - WorkflowService description: |- - PollActivityExecution long-polls for an activity execution to complete and returns the - outcome (result or failure). - operationId: PollActivityExecution + 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. + operationId: TerminateActivityExecution parameters: - name: namespace in: path @@ -4734,45 +5377,56 @@ paths: required: true schema: type: string - - name: runId - in: query - description: Activity run ID. If empty the request targets the latest run. - 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/PollActivityExecutionResponse' + $ref: '#/components/schemas/TerminateActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: + /namespaces/{namespace}/activities/{activityId}/unpause: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCanceled`. This version allows clients to record failures by - namespace/workflow id/activity id instead of task token. + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCanceledById + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Flags: + 'jitter': the activity will be scheduled at a random time within the jitter duration. + 'reset_attempts': the number of attempts will be reset. + 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity to confirm is cancelled + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. required: true schema: type: string @@ -4780,7 +5434,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' required: true responses: "200": @@ -4788,31 +5442,33 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/terminate: + /namespaces/{namespace}/activities/{activityId}/update-options: 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. - operationId: TerminateActivityExecution + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions parameters: - name: namespace in: path + description: Namespace of the workflow which scheduled this activity required: true schema: type: string - name: activityId in: path + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. required: true schema: type: string @@ -4820,7 +5476,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TerminateActivityExecutionRequest' + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' required: true responses: "200": @@ -4828,7 +5484,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TerminateActivityExecutionResponse' + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' default: description: Default error response content: @@ -7070,8 +7726,196 @@ paths: required: true schema: type: string - - name: execution.workflow_id + - name: execution.workflow_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerWorkflowRuleRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerWorkflowRuleResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}: + post: + tags: + - WorkflowService + description: |- + StartWorkflowExecution starts a new workflow execution. + + It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and + also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an + instance already exists with same workflow id. + operationId: StartWorkflowExecution + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: workflowId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartWorkflowExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StartWorkflowExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete: + post: + tags: + - WorkflowService + description: |- + See `RespondActivityTaskCompleted`. This version allows clients to record completions by + namespace/workflow id/activity id instead of task token. + + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskCompletedById + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + required: true + schema: + type: string + - name: activityId + in: path + description: Id of the activity to complete + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail: + post: + tags: + - WorkflowService + description: |- + See `RecordActivityTaskFailed`. This version allows clients to record failures by + namespace/workflow id/activity id instead of task token. + + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RespondActivityTaskFailedById + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + required: true + schema: + type: string + - name: activityId + in: path + description: Id of the activity to fail + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat: + post: + tags: + - WorkflowService + description: |- + See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by + namespace/workflow id/activity id instead of task token. + + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: "By" is used to indicate request type. --) + operationId: RecordActivityTaskHeartbeatById + parameters: + - name: namespace + in: path + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: workflowId + in: path + description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + required: true + schema: + type: string + - name: activityId in: path + description: Id of the activity we're heartbeating required: true schema: type: string @@ -7079,7 +7923,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TriggerWorkflowRuleRequest' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' required: true responses: "200": @@ -7087,32 +7931,55 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TriggerWorkflowRuleResponse' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/pause: post: tags: - WorkflowService description: |- - StartWorkflowExecution starts a new workflow execution. + PauseActivityExecution pauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity - It will create the execution with a `WORKFLOW_EXECUTION_STARTED` event in its history and - also schedule the first workflow task. Returns `WorkflowExecutionAlreadyStarted`, if an - instance already exists with same workflow id. - operationId: StartWorkflowExecution + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + - The activity should respond to the cancellation accordingly. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: PauseActivityExecution parameters: - name: namespace in: path + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path + description: |- + If provided, pause a workflow activity (or activities) for the given workflow ID. + If empty, target a standalone activity. + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. required: true schema: type: string @@ -7120,7 +7987,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartWorkflowExecutionRequest' + $ref: '#/components/schemas/PauseActivityExecutionRequest' required: true responses: "200": @@ -7128,40 +7995,56 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartWorkflowExecutionResponse' + $ref: '#/components/schemas/PauseActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/reset: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCompleted`. This version allows clients to record completions by - namespace/workflow id/activity id instead of task token. + ResetActivityExecution resets the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCompletedById + 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 + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity to complete + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. required: true schema: type: string @@ -7169,7 +8052,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' + $ref: '#/components/schemas/ResetActivityExecutionRequest' required: true responses: "200": @@ -7177,24 +8060,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' + $ref: '#/components/schemas/ResetActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - See `RecordActivityTaskFailed`. This version allows clients to record failures by + See `RespondActivityTaskCanceled`. This version allows clients to record failures by namespace/workflow id/activity id instead of task token. (-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskFailedById + operationId: RespondActivityTaskCanceledById parameters: - name: namespace in: path @@ -7210,7 +8093,7 @@ paths: type: string - name: activityId in: path - description: Id of the activity to fail + description: Id of the activity to confirm is cancelled required: true schema: type: string @@ -7218,7 +8101,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' required: true responses: "200": @@ -7226,40 +8109,52 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/unpause: post: tags: - WorkflowService description: |- - See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by - namespace/workflow id/activity id instead of task token. + UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + This API can be used to target a workflow activity or a standalone activity. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RecordActivityTaskHeartbeatById + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Flags: + 'jitter': the activity will be scheduled at a random time within the jitter duration. + 'reset_attempts': the number of attempts will be reset. + 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + + Returns a `NotFound` error if there is no pending activity with the provided ID + operationId: UnpauseActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - name: workflowId in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity we're heartbeating + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. required: true schema: type: string @@ -7267,7 +8162,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' + $ref: '#/components/schemas/UnpauseActivityExecutionRequest' required: true responses: "200": @@ -7275,24 +8170,21 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' + $ref: '#/components/schemas/UnpauseActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: + /namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/update-options: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCanceled`. This version allows clients to record failures by - namespace/workflow id/activity id instead of task token. - - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCanceledById + UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + This API can be used to target a workflow activity or a standalone activity. + operationId: UpdateActivityExecutionOptions parameters: - name: namespace in: path @@ -7302,13 +8194,17 @@ paths: type: string - name: workflowId in: path - description: Id of the workflow which scheduled this activity, leave empty to target a standalone activity + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. required: true schema: type: string - name: activityId in: path - description: Id of the activity to confirm is cancelled + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. required: true schema: type: string @@ -7316,7 +8212,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' + $ref: '#/components/schemas/UpdateActivityExecutionOptionsRequest' required: true responses: "200": @@ -7324,7 +8220,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' + $ref: '#/components/schemas/UpdateActivityExecutionOptionsResponse' default: description: Default error response content: @@ -11191,6 +12087,37 @@ components: PatchScheduleResponse: type: object properties: {} + PauseActivityExecutionRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity. + workflowId: + type: string + description: |- + If provided, pause a workflow activity (or activities) for the given workflow ID. + If empty, target a standalone activity. + activityId: + type: string + description: |- + Pause an activity with this ID. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request. + reason: + type: string + description: Reason to pause the activity. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + PauseActivityExecutionResponse: + type: object + properties: {} PauseActivityRequest: type: object properties: @@ -11215,9 +12142,11 @@ components: reason: type: string description: Reason to pause the activity. + description: Deprecated. Use `PauseActivityExecutionRequest`. PauseActivityResponse: type: object properties: {} + description: Deprecated. Use `PauseActivityExecutionResponse`. PauseInfo_Manual: type: object properties: @@ -12273,6 +13202,54 @@ 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, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. + activityId: + type: string + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request. + resetHeartbeat: + type: boolean + description: |- + Indicates that activity should reset heartbeat details. + This flag will be applied only to the new instance of the activity. + keepPaused: + type: boolean + description: If activity is paused, it will remain paused after reset + jitter: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration. + (unless it is paused and keep_paused is set) + restoreOriginalOptions: + type: boolean + description: |- + If set, the activity options will be restored to the defaults. + Default options are then options activity was created with. + They are part of the first SCHEDULE event. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + ResetActivityExecutionResponse: + type: object + properties: {} ResetActivityRequest: type: object properties: @@ -12315,10 +13292,13 @@ components: If set, the activity options will be restored to the defaults. Default options are then options activity was created with. They are part of the first SCHEDULE event. - description: 'NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities' + description: |- + NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities + Deprecated. Use `ResetActivityExecutionRequest`. ResetActivityResponse: type: object properties: {} + description: Deprecated. Use `ResetActivityExecutionRequest`. ResetOptions: type: object properties: @@ -14552,6 +15532,47 @@ 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, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. + activityId: + type: string + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request. + resetAttempts: + type: boolean + description: Providing this flag will also reset the number of attempts. + resetHeartbeat: + type: boolean + description: Providing this flag will also reset the heartbeat details. + reason: + type: string + description: Reason to unpause the activity. + jitter: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: If set, the activity will start at a random time within the specified jitter duration. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + UnpauseActivityExecutionResponse: + type: object + properties: {} UnpauseActivityRequest: type: object properties: @@ -14584,9 +15605,11 @@ components: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: If set, the activity will start at a random time within the specified jitter duration. + description: Deprecated. Use `UnpauseActivityExecutionRequest`. UnpauseActivityResponse: type: object properties: {} + description: Deprecated. Use `UnpauseActivityExecutionResponse`. UnpauseWorkflowExecutionRequest: type: object properties: @@ -14612,6 +15635,54 @@ components: type: object properties: {} description: Response to a successful UnpauseWorkflowExecution request. + UpdateActivityExecutionOptionsRequest: + type: object + properties: + namespace: + type: string + description: Namespace of the workflow which scheduled this activity + workflowId: + type: string + description: |- + If provided, targets a workflow activity for the given workflow ID. + If empty, target a standalone activity. + activityId: + type: string + description: |- + The ID of the activity to target. Must be provided for a standalone activity. + Mutually exclusive with workflow_activity_type. + runId: + type: string + description: Run ID of the workflow or standalone activity. + identity: + type: string + description: The identity of the client who initiated this request + activityOptions: + allOf: + - $ref: '#/components/schemas/ActivityOptions' + description: Activity options. Partial updates are accepted and controlled by update_mask + updateMask: + type: string + description: Controls which fields from `activity_options` will be applied + format: field-mask + restoreOriginal: + type: boolean + description: |- + If set, the activity options will be restored to the default. + Default options are then options activity was created with. + They are part of the first SCHEDULE event. + This flag cannot be combined with any other option; if you supply + restore_original together with other options, the request will be rejected. + resourceId: + type: string + description: Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + UpdateActivityExecutionOptionsResponse: + type: object + properties: + activityOptions: + allOf: + - $ref: '#/components/schemas/ActivityOptions' + description: Activity options after an update UpdateActivityOptionsRequest: type: object properties: @@ -14650,7 +15721,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: @@ -14658,6 +15731,7 @@ components: allOf: - $ref: '#/components/schemas/ActivityOptions' description: Activity options after an update + description: Deprecated. Use `UpdateActivityExecutionOptionsResponse`. UpdateDeploymentMetadata: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 2d9dd7b83..9e573ff29 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1972,6 +1972,7 @@ message ExecuteMultiOperationResponse { } // NOTE: keep in sync with temporal.api.batch.v1.BatchOperationUpdateActivityOptions +// Deprecated. Use `UpdateActivityExecutionOptionsRequest`. message UpdateActivityOptionsRequest { // Namespace of the workflow which scheduled this activity string namespace = 1; @@ -2005,11 +2006,51 @@ message UpdateActivityOptionsRequest { bool restore_original = 8; } +message UpdateActivityExecutionOptionsRequest { + // Namespace of the workflow which scheduled this activity + string namespace = 1; + + // If provided, targets a workflow activity for the given workflow ID. + // If empty, target a standalone activity. + string workflow_id = 2; + // The ID of the activity to target. Must be provided for a standalone activity. + // Mutually exclusive with workflow_activity_type. + string activity_id = 3; + // Run ID of the workflow or standalone activity. + string run_id = 4; + + // The identity of the client who initiated this request + string identity = 5; + + // Activity options. Partial updates are accepted and controlled by update_mask + temporal.api.activity.v1.ActivityOptions activity_options = 6; + + // Controls which fields from `activity_options` will be applied + google.protobuf.FieldMask update_mask = 7; + + // If set, the activity options will be restored to the default. + // Default options are then options activity was created with. + // They are part of the first SCHEDULE event. + // This flag cannot be combined with any other option; if you supply + // restore_original together with other options, the request will be rejected. + bool restore_original = 8; + + // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + string resource_id = 9; +} + +// Deprecated. Use `UpdateActivityExecutionOptionsResponse`. message UpdateActivityOptionsResponse { // Activity options after an update temporal.api.activity.v1.ActivityOptions activity_options = 1; } +message UpdateActivityExecutionOptionsResponse { + // Activity options after an update + temporal.api.activity.v1.ActivityOptions activity_options = 1; +} + +// Deprecated. Use `PauseActivityExecutionRequest`. message PauseActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -2032,9 +2073,37 @@ message PauseActivityRequest { string reason = 6; } +message PauseActivityExecutionRequest { + // Namespace of the workflow which scheduled this activity. + string namespace = 1; + + // If provided, pause a workflow activity (or activities) for the given workflow ID. + // If empty, target a standalone activity. + string workflow_id = 2; + // Pause an activity with this ID. Must be provided for a standalone activity. + // Mutually exclusive with workflow_activity_type. + string activity_id = 3; + // Run ID of the workflow or standalone activity. + string run_id = 4; + + // The identity of the client who initiated this request. + string identity = 5; + + // Reason to pause the activity. + string reason = 6; + + // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + string resource_id = 7; +} + +// Deprecated. Use `PauseActivityExecutionResponse`. message PauseActivityResponse { } +message PauseActivityExecutionResponse { +} + +// Deprecated. Use `UnpauseActivityExecutionRequest`. message UnpauseActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -2064,10 +2133,47 @@ message UnpauseActivityRequest { google.protobuf.Duration jitter = 9; } +message UnpauseActivityExecutionRequest { + // Namespace of the workflow which scheduled this activity. + string namespace = 1; + + // If provided, targets a workflow activity for the given workflow ID. + // If empty, target a standalone activity. + string workflow_id = 2; + // The ID of the activity to target. Must be provided for a standalone activity. + // Mutually exclusive with workflow_activity_type. + string activity_id = 3; + // Run ID of the workflow or standalone activity. + string run_id = 4; + + // The identity of the client who initiated this request. + string identity = 5; + + // Providing this flag will also reset the number of attempts. + bool reset_attempts = 6; + + // Providing this flag will also reset the heartbeat details. + bool reset_heartbeat = 7; + + // Reason to unpause the activity. + string reason = 8; + + // If set, the activity will start at a random time within the specified jitter duration. + google.protobuf.Duration jitter = 9; + + // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + string resource_id = 10; +} + +// Deprecated. Use `UnpauseActivityExecutionResponse`. message UnpauseActivityResponse { } +message UnpauseActivityExecutionResponse { +} + // NOTE: keep in sync with temporal.api.batch.v1.BatchOperationResetActivities +// Deprecated. Use `ResetActivityExecutionRequest`. message ResetActivityRequest { // Namespace of the workflow which scheduled this activity. string namespace = 1; @@ -2102,12 +2208,51 @@ message ResetActivityRequest { // Default options are then options activity was created with. // They are part of the first SCHEDULE event. bool restore_original_options = 9; +} + +message ResetActivityExecutionRequest { + // Namespace of the workflow which scheduled this activity. + string namespace = 1; + + // If provided, targets a workflow activity for the given workflow ID. + // If empty, target a standalone activity. + string workflow_id = 2; + // The ID of the activity to target. Must be provided for a standalone activity. + // Mutually exclusive with workflow_activity_type. + string activity_id = 3; + // Run ID of the workflow or standalone activity. + string run_id = 4; + + // The identity of the client who initiated this request. + string identity = 5; + + // Indicates that activity should reset heartbeat details. + // This flag will be applied only to the new instance of the activity. + bool reset_heartbeat = 6; + + // If activity is paused, it will remain paused after reset + bool keep_paused = 7; + + // If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration. + // (unless it is paused and keep_paused is set) + google.protobuf.Duration jitter = 8; + + // If set, the activity options will be restored to the defaults. + // Default options are then options activity was created with. + // They are part of the first SCHEDULE event. + bool restore_original_options = 9; + // Resource ID for routing. Contains "workflow:{workflow_id}" for workflow activities or "activity:{activity_id}" for standalone activities. + string resource_id = 10; } +// Deprecated. Use `ResetActivityExecutionRequest`. message ResetActivityResponse { } +message ResetActivityExecutionResponse { +} + // Keep the parameters in sync with: // - temporal.api.batch.v1.BatchOperationUpdateWorkflowExecutionOptions. // - temporal.api.workflow.v1.PostResetOperation.UpdateWorkflowOptions. diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 18e579c2c..663ed2a99 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1684,4 +1684,152 @@ service WorkflowService { // (-- api-linter: core::0127::http-annotation=disabled // aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) rpc DeleteActivityExecution (DeleteActivityExecutionRequest) returns (DeleteActivityExecutionResponse) {} + + // PauseActivityExecution pauses the execution of an activity specified by its ID. + // This API can be used to target a workflow activity or a standalone activity + // + // Pausing an activity means: + // - If the activity is currently waiting for a retry or is running and subsequently fails, + // it will not be rescheduled until it is unpaused. + // - If the activity is already paused, calling this method will have no effect. + // - If the activity is running and finishes successfully, the activity will be completed. + // - If the activity is running and finishes with failure: + // * if there is no retry left - the activity will be completed. + // * if there are more retries left - the activity will be paused. + // For long-running activities: + // - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + // - The activity should respond to the cancellation accordingly. + // + // Returns a `NotFound` error if there is no pending activity with the provided ID + rpc PauseActivityExecution (PauseActivityExecutionRequest) returns (PauseActivityExecutionResponse) { + option (google.api.http) = { + // Standalone activity + post: "/namespaces/{namespace}/activities/{activity_id}/pause" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/pause" + body: "*" + } + // Workflow activity + additional_bindings { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/pause" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/pause" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "{resource_id}" + }; + } + + // ResetActivityExecution resets the execution of an activity specified by its ID. + // This API can be used to target a workflow activity or a standalone activity. + // + // Resetting an activity means: + // * number of attempts will be reset to 0. + // * activity timeouts will be reset. + // * if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided: + // it will be scheduled immediately (* see 'jitter' flag), + // + // Flags: + // + // 'jitter': the activity will be scheduled at a random time within the jitter duration. + // If the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided. + // 'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset. + // 'keep_paused': if the activity is paused, it will remain paused. + // + // Returns a `NotFound` error if there is no pending activity with the provided ID or type. + rpc ResetActivityExecution (ResetActivityExecutionRequest) returns (ResetActivityExecutionResponse) { + option (google.api.http) = { + // Standalone activity + post: "/namespaces/{namespace}/activities/{activity_id}/reset" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/reset" + body: "*" + } + // Workflow activity + additional_bindings { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/reset" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/reset" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "{resource_id}" + }; + } + + // UnpauseActivityExecution unpauses the execution of an activity specified by its ID. + // This API can be used to target a workflow activity or a standalone activity. + // + // If activity is not paused, this call will have no effect. + // If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + // Once the activity is unpaused, all timeout timers will be regenerated. + // + // Flags: + // 'jitter': the activity will be scheduled at a random time within the jitter duration. + // 'reset_attempts': the number of attempts will be reset. + // 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + // + // Returns a `NotFound` error if there is no pending activity with the provided ID + rpc UnpauseActivityExecution (UnpauseActivityExecutionRequest) returns (UnpauseActivityExecutionResponse) { + option (google.api.http) = { + // Standalone activity + post: "/namespaces/{namespace}/activities/{activity_id}/unpause" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/unpause" + body: "*" + } + // Workflow activity + additional_bindings { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/unpause" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/unpause" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "{resource_id}" + }; + } + + // UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID. + // This API can be used to target a workflow activity or a standalone activity. + rpc UpdateActivityExecutionOptions (UpdateActivityExecutionOptionsRequest) returns (UpdateActivityExecutionOptionsResponse) { + option (google.api.http) = { + // Standalone activity + post: "/namespaces/{namespace}/activities/{activity_id}/update-options" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/update-options" + body: "*" + } + // Workflow activity + additional_bindings { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/update-options" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/update-options" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "{resource_id}" + }; + } }