diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 85e0f95b4..60872a2de 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -211,16 +211,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/cancel": { + "/api/v1/namespaces/{namespace}/activities-deprecated/pause": { "post": { - "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", - "description": "For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", - "operationId": "RespondActivityTaskCanceled2", + "summary": "PauseActivity pauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be paused", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and\nstructured to work well for standalone activities.", + "operationId": "PauseActivity2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledResponse" + "$ref": "#/definitions/v1PauseActivityResponse" } }, "default": { @@ -233,6 +233,7 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" @@ -242,7 +243,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledBody" + "$ref": "#/definitions/WorkflowServicePauseActivityBody" } } ], @@ -251,15 +252,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/cancel-by-id": { + "/api/v1/namespaces/{namespace}/activities-deprecated/reset": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById2", + "summary": "ResetActivity resets the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be reset.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.\nThis API will be deprecated soon and replaced with a newer ResetActivityExecution that is better named and\nstructured to work well for standalone activities.", + "operationId": "ResetActivity2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1ResetActivityResponse" } }, "default": { @@ -272,7 +274,7 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" @@ -282,7 +284,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceResetActivityBody" } } ], @@ -291,16 +293,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/complete": { + "/api/v1/namespaces/{namespace}/activities-deprecated/unpause": { "post": { - "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", - "description": "For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", - "operationId": "RespondActivityTaskCompleted2", + "summary": "UnpauseActivity unpauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be unpaused.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and\nstructured to work well for standalone activities.", + "operationId": "UnpauseActivity2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCompletedResponse" + "$ref": "#/definitions/v1UnpauseActivityResponse" } }, "default": { @@ -313,6 +315,7 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" @@ -322,7 +325,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityBody" } } ], @@ -331,15 +334,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/complete-by-id": { + "/api/v1/namespaces/{namespace}/activities-deprecated/update-options": { "post": { - "summary": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCompletedById2", + "summary": "UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be updated.\nThis API will be deprecated soon and replaced with a newer UpdateActivityExecutionOptions that is better named and\nstructured to work well for standalone activities.", + "operationId": "UpdateActivityOptions2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" + "$ref": "#/definitions/v1UpdateActivityOptionsResponse" } }, "default": { @@ -362,7 +365,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityOptionsBody" } } ], @@ -371,16 +374,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/fail": { - "post": { - "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", - "description": "This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and\na new workflow task created for the workflow. Fails with `NotFound` if the task token is no\nlonger valid due to activity timeout, already being completed, or never having existed.", - "operationId": "RespondActivityTaskFailed2", + "/api/v1/namespaces/{namespace}/activities/{activityId}": { + "get": { + "summary": "DescribeActivityExecution returns information about an activity execution.\nIt can be used to:\n- Get current activity info without waiting\n- Long-poll for next state change and return new activity info\nResponse can optionally include activity input or outcome (if the activity has completed).", + "operationId": "DescribeActivityExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedResponse" + "$ref": "#/definitions/v1DescribeActivityExecutionResponse" } }, "default": { @@ -398,28 +400,54 @@ "type": "string" }, { - "name": "body", - "in": "body", + "name": "activityId", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedBody" - } + "type": "string" + }, + { + "name": "runId", + "description": "Activity run ID. If empty the request targets the latest run.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "includeInput", + "description": "Include the input field in the response.", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "includeOutcome", + "description": "Include the outcome (result/failure) in the response if the activity has completed.", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "longPollToken", + "description": "Token from a previous DescribeActivityExecutionResponse. If present, long-poll until activity\nstate changes from the state encoded in this token. If absent, return current state immediately.\nIf present, run_id must also be present.\nNote that activity state may change multiple times between requests, therefore it is not\nguaranteed that a client making a sequence of long-poll requests will see a complete\nsequence of state changes.", + "in": "query", + "required": false, + "type": "string", + "format": "byte" } ], "tags": [ "WorkflowService" ] - } - }, - "/api/v1/namespaces/{namespace}/activities/fail-by-id": { + }, "post": { - "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskFailedById2", + "summary": "StartActivityExecution starts a new activity execution.", + "description": "Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace\nunless permitted by the specified ID conflict policy.", + "operationId": "StartActivityExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" + "$ref": "#/definitions/v1StartActivityExecutionResponse" } }, "default": { @@ -432,7 +460,13 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Identifier for this activity. Required. This identifier should be meaningful in the user's\nown system. It must be unique among activities in the same namespace, subject to the rules\nimposed by id_reuse_policy and id_conflict_policy.", "in": "path", "required": true, "type": "string" @@ -442,7 +476,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + "$ref": "#/definitions/WorkflowServiceStartActivityExecutionBody" } } ], @@ -451,16 +485,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/heartbeat": { + "/api/v1/namespaces/{namespace}/activities/{activityId}/cancel": { "post": { - "summary": "RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.", - "description": "If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,\nthen the current attempt times out. Depending on RetryPolicy, this may trigger a retry or\ntime out the activity.\n\nFor workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow\nhistory. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations,\nin that event, the SDK should request cancellation of the activity.\n\nThe request may contain response `details` which will be persisted by the server and may be\nused by the activity to checkpoint progress. The `cancel_requested` field in the response\nindicates whether cancellation has been requested for the activity.", - "operationId": "RecordActivityTaskHeartbeat2", + "summary": "RequestCancelActivityExecution requests cancellation of an activity execution.", + "description": "Cancellation is cooperative: this call records the request, but the activity must detect and\nacknowledge it for the activity to reach CANCELED status. The cancellation signal is\ndelivered via `cancel_requested` in the heartbeat response; SDKs surface this via\nlanguage-idiomatic mechanisms (context cancellation, exceptions, abort signals).", + "operationId": "RequestCancelActivityExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatResponse" + "$ref": "#/definitions/v1RequestCancelActivityExecutionResponse" } }, "default": { @@ -477,12 +511,18 @@ "required": true, "type": "string" }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatBody" + "$ref": "#/definitions/WorkflowServiceRequestCancelActivityExecutionBody" } } ], @@ -491,15 +531,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/heartbeat-by-id": { + "/api/v1/namespaces/{namespace}/activities/{activityId}/complete": { "post": { - "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RecordActivityTaskHeartbeatById2", + "summary": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCompletedById2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" } }, "default": { @@ -517,12 +557,19 @@ "required": true, "type": "string" }, + { + "name": "activityId", + "description": "Id of the activity to complete", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" } } ], @@ -531,16 +578,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/pause": { + "/api/v1/namespaces/{namespace}/activities/{activityId}/fail": { "post": { - "summary": "PauseActivity pauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be paused", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and\nstructured to work well for standalone activities.", - "operationId": "PauseActivity2", + "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskFailedById2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityResponse" + "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" } }, "default": { @@ -553,7 +599,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", "in": "path", "required": true, "type": "string" @@ -563,7 +616,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" } } ], @@ -572,16 +625,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/reset": { + "/api/v1/namespaces/{namespace}/activities/{activityId}/heartbeat": { "post": { - "summary": "ResetActivity resets the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be reset.", - "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.\nThis API will be deprecated soon and replaced with a newer ResetActivityExecution that is better named and\nstructured to work well for standalone activities.", - "operationId": "ResetActivity2", + "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RecordActivityTaskHeartbeatById2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetActivityResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" } }, "default": { @@ -594,7 +646,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 we're heartbeating", "in": "path", "required": true, "type": "string" @@ -604,7 +663,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" } } ], @@ -613,16 +672,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/unpause": { - "post": { - "summary": "UnpauseActivity unpauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be unpaused.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and\nstructured to work well for standalone activities.", - "operationId": "UnpauseActivity2", + "/api/v1/namespaces/{namespace}/activities/{activityId}/outcome": { + "get": { + "summary": "PollActivityExecution long-polls for an activity execution to complete and returns the\noutcome (result or failure).", + "operationId": "PollActivityExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UnpauseActivityResponse" + "$ref": "#/definitions/v1PollActivityExecutionResponse" } }, "default": { @@ -635,18 +693,22 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", + "name": "activityId", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityBody" - } + "type": "string" + }, + { + "name": "runId", + "description": "Activity run ID. If empty the request targets the latest run.", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -654,15 +716,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/update-options": { + "/api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be updated.\nThis API will be deprecated soon and replaced with a newer UpdateActivityExecutionOptions that is better named and\nstructured to work well for standalone activities.", - "operationId": "UpdateActivityOptions2", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateActivityOptionsResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -680,12 +742,19 @@ "required": true, "type": "string" }, + { + "name": "activityId", + "description": "Id of the activity to confirm is cancelled", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityOptionsBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -694,15 +763,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/{activityId}": { - "get": { - "summary": "DescribeActivityExecution returns information about an activity execution.\nIt can be used to:\n- Get current activity info without waiting\n- Long-poll for next state change and return new activity info\nResponse can optionally include activity input or outcome (if the activity has completed).", - "operationId": "DescribeActivityExecution2", + "/api/v1/namespaces/{namespace}/activities/{activityId}/terminate": { + "post": { + "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", + "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", + "operationId": "TerminateActivityExecution2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1DescribeActivityExecutionResponse" + "$ref": "#/definitions/v1TerminateActivityExecutionResponse" } }, "default": { @@ -726,49 +796,30 @@ "type": "string" }, { - "name": "runId", - "description": "Activity run ID. If empty the request targets the latest run.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "includeInput", - "description": "Include the input field in the response.", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "includeOutcome", - "description": "Include the outcome (result/failure) in the response if the activity has completed.", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "longPollToken", - "description": "Token from a previous DescribeActivityExecutionResponse. If present, long-poll until activity\nstate changes from the state encoded in this token. If absent, return current state immediately.\nIf present, run_id must also be present.\nNote that activity state may change multiple times between requests, therefore it is not\nguaranteed that a client making a sequence of long-poll requests will see a complete\nsequence of state changes.", - "in": "query", - "required": false, - "type": "string", - "format": "byte" - } - ], - "tags": [ - "WorkflowService" - ] - }, - "post": { - "summary": "StartActivityExecution starts a new activity execution.", - "description": "Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace\nunless permitted by the specified ID conflict policy.", - "operationId": "StartActivityExecution2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1StartActivityExecutionResponse" - } + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/activity-complete": { + "post": { + "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", + "description": "For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", + "operationId": "RespondActivityTaskCompleted2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RespondActivityTaskCompletedResponse" + } }, "default": { "description": "An unexpected error response.", @@ -784,19 +835,12 @@ "required": true, "type": "string" }, - { - "name": "activityId", - "description": "Identifier for this activity. Required. This identifier should be meaningful in the user's\nown system. It must be unique among activities in the same namespace, subject to the rules\nimposed by id_reuse_policy and id_conflict_policy.", - "in": "path", - "required": true, - "type": "string" - }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceStartActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedBody" } } ], @@ -805,16 +849,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/cancel": { - "post": { - "summary": "RequestCancelActivityExecution requests cancellation of an activity execution.", - "description": "Cancellation is cooperative: this call records the request, but the activity must detect and\nacknowledge it for the activity to reach CANCELED status. The cancellation signal is\ndelivered via `cancel_requested` in the heartbeat response; SDKs surface this via\nlanguage-idiomatic mechanisms (context cancellation, exceptions, abort signals).", - "operationId": "RequestCancelActivityExecution2", + "/api/v1/namespaces/{namespace}/activity-count": { + "get": { + "summary": "CountActivityExecutions is a visibility API to count activity executions in a specific namespace.", + "operationId": "CountActivityExecutions2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RequestCancelActivityExecutionResponse" + "$ref": "#/definitions/v1CountActivityExecutionsResponse" } }, "default": { @@ -832,18 +875,11 @@ "type": "string" }, { - "name": "activityId", - "in": "path", - "required": true, + "name": "query", + "description": "Visibility query, see https://docs.temporal.io/list-filter for the syntax.", + "in": "query", + "required": false, "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceRequestCancelActivityExecutionBody" - } } ], "tags": [ @@ -851,15 +887,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/outcome": { - "get": { - "summary": "PollActivityExecution long-polls for an activity execution to complete and returns the\noutcome (result or failure).", - "operationId": "PollActivityExecution2", + "/api/v1/namespaces/{namespace}/activity-fail": { + "post": { + "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", + "description": "This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and\na new workflow task created for the workflow. Fails with `NotFound` if the task token is no\nlonger valid due to activity timeout, already being completed, or never having existed.", + "operationId": "RespondActivityTaskFailed2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PollActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskFailedResponse" } }, "default": { @@ -877,17 +914,12 @@ "type": "string" }, { - "name": "activityId", - "in": "path", + "name": "body", + "in": "body", "required": true, - "type": "string" - }, - { - "name": "runId", - "description": "Activity run ID. If empty the request targets the latest run.", - "in": "query", - "required": false, - "type": "string" + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedBody" + } } ], "tags": [ @@ -895,16 +927,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activities/{activityId}/terminate": { + "/api/v1/namespaces/{namespace}/activity-heartbeat": { "post": { - "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", - "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", - "operationId": "TerminateActivityExecution2", + "summary": "RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.", + "description": "If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,\nthen the current attempt times out. Depending on RetryPolicy, this may trigger a retry or\ntime out the activity.\n\nFor workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow\nhistory. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations,\nin that event, the SDK should request cancellation of the activity.\n\nThe request may contain response `details` which will be persisted by the server and may be\nused by the activity to checkpoint progress. The `cancel_requested` field in the response\nindicates whether cancellation has been requested for the activity.", + "operationId": "RecordActivityTaskHeartbeat2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateActivityExecutionResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatResponse" } }, "default": { @@ -921,18 +953,12 @@ "required": true, "type": "string" }, - { - "name": "activityId", - "in": "path", - "required": true, - "type": "string" - }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatBody" } } ], @@ -941,15 +967,16 @@ ] } }, - "/api/v1/namespaces/{namespace}/activity-count": { - "get": { - "summary": "CountActivityExecutions is a visibility API to count activity executions in a specific namespace.", - "operationId": "CountActivityExecutions2", + "/api/v1/namespaces/{namespace}/activity-resolve-as-canceled": { + "post": { + "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", + "description": "For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", + "operationId": "RespondActivityTaskCanceled2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1CountActivityExecutionsResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledResponse" } }, "default": { @@ -967,11 +994,12 @@ "type": "string" }, { - "name": "query", - "description": "Visibility query, see https://docs.temporal.io/list-filter for the syntax.", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledBody" + } } ], "tags": [ @@ -3769,15 +3797,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/pause": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete": { "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": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCompletedById4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseWorkflowExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" } }, "default": { @@ -3790,14 +3818,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": "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" @@ -3807,7 +3842,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" } } ], @@ -3816,16 +3851,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail": { "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 `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskFailedById4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1SignalWithStartWorkflowExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" } }, "default": { @@ -3838,19 +3872,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 fail", "in": "path", "required": true, "type": "string" @@ -3860,7 +3896,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceSignalWithStartWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" } } ], @@ -3869,15 +3905,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause": { + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat": { "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": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RecordActivityTaskHeartbeatById4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UnpauseWorkflowExecutionResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" } }, "default": { @@ -3890,14 +3926,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": "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 we're heartbeating", "in": "path", "required": true, "type": "string" @@ -3907,7 +3950,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseWorkflowExecutionBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" } } ], @@ -3916,15 +3959,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}/resolve-as-canceled": { + "post": { + "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/v1ListNexusEndpointsResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -3936,73 +3979,49 @@ }, "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": "Id of the workflow which scheduled this activity, leave empty to 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": "Id of the activity to confirm is cancelled", + "in": "path", + "required": true, "type": "string" - } - ], - "tags": [ - "OperatorService" - ] - }, - "post": { - "summary": "Create a Nexus endpoint. This will fail if an endpoint with the same name is already registered with a status of\nALREADY_EXISTS.\nReturns the created endpoint with its initial version. You may use this version for subsequent updates.", - "operationId": "CreateNexusEndpoint2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1CreateNexusEndpointResponse" - } }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/v1CreateNexusEndpointRequest" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], "tags": [ - "OperatorService" + "WorkflowService" ] } }, - "/api/v1/nexus/endpoints/{id}": { - "get": { - "summary": "Get a registered Nexus endpoint by ID. The returned version can be used for optimistic updates.", - "operationId": "GetNexusEndpoint2", + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/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/v1GetNexusEndpointResponse" + "$ref": "#/definitions/v1PauseWorkflowExecutionResponse" } }, "default": { @@ -4014,12 +4033,237 @@ }, "parameters": [ { - "name": "id", - "description": "Server-generated unique endpoint ID.", + "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.", + "operationId": "CreateNexusEndpoint2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateNexusEndpointResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateNexusEndpointRequest" + } + } + ], + "tags": [ + "OperatorService" + ] + } + }, + "/api/v1/nexus/endpoints/{id}": { + "get": { + "summary": "Get a registered Nexus endpoint by ID. The returned version can be used for optimistic updates.", + "operationId": "GetNexusEndpoint2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetNexusEndpointResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "description": "Server-generated unique endpoint ID.", + "in": "path", + "required": true, + "type": "string" + } ], "tags": [ "OperatorService" @@ -4577,16 +4821,16 @@ ] } }, - "/namespaces/{namespace}/activities/cancel": { + "/namespaces/{namespace}/activities-deprecated/pause": { "post": { - "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", - "description": "For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", - "operationId": "RespondActivityTaskCanceled", + "summary": "PauseActivity pauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be paused", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and\nstructured to work well for standalone activities.", + "operationId": "PauseActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledResponse" + "$ref": "#/definitions/v1PauseActivityResponse" } }, "default": { @@ -4599,6 +4843,7 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" @@ -4608,7 +4853,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledBody" + "$ref": "#/definitions/WorkflowServicePauseActivityBody" } } ], @@ -4617,15 +4862,16 @@ ] } }, - "/namespaces/{namespace}/activities/cancel-by-id": { + "/namespaces/{namespace}/activities-deprecated/reset": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById", + "summary": "ResetActivity resets the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be reset.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.\nThis API will be deprecated soon and replaced with a newer ResetActivityExecution that is better named and\nstructured to work well for standalone activities.", + "operationId": "ResetActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1ResetActivityResponse" } }, "default": { @@ -4638,7 +4884,7 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" @@ -4648,7 +4894,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceResetActivityBody" } } ], @@ -4657,16 +4903,16 @@ ] } }, - "/namespaces/{namespace}/activities/complete": { + "/namespaces/{namespace}/activities-deprecated/unpause": { "post": { - "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", - "description": "For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", - "operationId": "RespondActivityTaskCompleted", + "summary": "UnpauseActivity unpauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be unpaused.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and\nstructured to work well for standalone activities.", + "operationId": "UnpauseActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCompletedResponse" + "$ref": "#/definitions/v1UnpauseActivityResponse" } }, "default": { @@ -4679,6 +4925,7 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" @@ -4688,7 +4935,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedBody" + "$ref": "#/definitions/WorkflowServiceUnpauseActivityBody" } } ], @@ -4697,15 +4944,15 @@ ] } }, - "/namespaces/{namespace}/activities/complete-by-id": { + "/namespaces/{namespace}/activities-deprecated/update-options": { "post": { - "summary": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCompletedById", + "summary": "UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be updated.\nThis API will be deprecated soon and replaced with a newer UpdateActivityExecutionOptions that is better named and\nstructured to work well for standalone activities.", + "operationId": "UpdateActivityOptions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" + "$ref": "#/definitions/v1UpdateActivityOptionsResponse" } }, "default": { @@ -4728,7 +4975,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityOptionsBody" } } ], @@ -4737,16 +4984,15 @@ ] } }, - "/namespaces/{namespace}/activities/fail": { - "post": { - "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", - "description": "This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and\na new workflow task created for the workflow. Fails with `NotFound` if the task token is no\nlonger valid due to activity timeout, already being completed, or never having existed.", - "operationId": "RespondActivityTaskFailed", + "/namespaces/{namespace}/activities/{activityId}": { + "get": { + "summary": "DescribeActivityExecution returns information about an activity execution.\nIt can be used to:\n- Get current activity info without waiting\n- Long-poll for next state change and return new activity info\nResponse can optionally include activity input or outcome (if the activity has completed).", + "operationId": "DescribeActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedResponse" + "$ref": "#/definitions/v1DescribeActivityExecutionResponse" } }, "default": { @@ -4764,28 +5010,54 @@ "type": "string" }, { - "name": "body", - "in": "body", + "name": "activityId", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedBody" - } + "type": "string" + }, + { + "name": "runId", + "description": "Activity run ID. If empty the request targets the latest run.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "includeInput", + "description": "Include the input field in the response.", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "includeOutcome", + "description": "Include the outcome (result/failure) in the response if the activity has completed.", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "longPollToken", + "description": "Token from a previous DescribeActivityExecutionResponse. If present, long-poll until activity\nstate changes from the state encoded in this token. If absent, return current state immediately.\nIf present, run_id must also be present.\nNote that activity state may change multiple times between requests, therefore it is not\nguaranteed that a client making a sequence of long-poll requests will see a complete\nsequence of state changes.", + "in": "query", + "required": false, + "type": "string", + "format": "byte" } ], "tags": [ "WorkflowService" ] - } - }, - "/namespaces/{namespace}/activities/fail-by-id": { + }, "post": { - "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskFailedById", + "summary": "StartActivityExecution starts a new activity execution.", + "description": "Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace\nunless permitted by the specified ID conflict policy.", + "operationId": "StartActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" + "$ref": "#/definitions/v1StartActivityExecutionResponse" } }, "default": { @@ -4798,7 +5070,13 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Identifier for this activity. Required. This identifier should be meaningful in the user's\nown system. It must be unique among activities in the same namespace, subject to the rules\nimposed by id_reuse_policy and id_conflict_policy.", "in": "path", "required": true, "type": "string" @@ -4808,7 +5086,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + "$ref": "#/definitions/WorkflowServiceStartActivityExecutionBody" } } ], @@ -4817,16 +5095,16 @@ ] } }, - "/namespaces/{namespace}/activities/heartbeat": { + "/namespaces/{namespace}/activities/{activityId}/cancel": { "post": { - "summary": "RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.", - "description": "If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,\nthen the current attempt times out. Depending on RetryPolicy, this may trigger a retry or\ntime out the activity.\n\nFor workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow\nhistory. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations,\nin that event, the SDK should request cancellation of the activity.\n\nThe request may contain response `details` which will be persisted by the server and may be\nused by the activity to checkpoint progress. The `cancel_requested` field in the response\nindicates whether cancellation has been requested for the activity.", - "operationId": "RecordActivityTaskHeartbeat", + "summary": "RequestCancelActivityExecution requests cancellation of an activity execution.", + "description": "Cancellation is cooperative: this call records the request, but the activity must detect and\nacknowledge it for the activity to reach CANCELED status. The cancellation signal is\ndelivered via `cancel_requested` in the heartbeat response; SDKs surface this via\nlanguage-idiomatic mechanisms (context cancellation, exceptions, abort signals).", + "operationId": "RequestCancelActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatResponse" + "$ref": "#/definitions/v1RequestCancelActivityExecutionResponse" } }, "default": { @@ -4843,12 +5121,18 @@ "required": true, "type": "string" }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatBody" + "$ref": "#/definitions/WorkflowServiceRequestCancelActivityExecutionBody" } } ], @@ -4857,15 +5141,15 @@ ] } }, - "/namespaces/{namespace}/activities/heartbeat-by-id": { + "/namespaces/{namespace}/activities/{activityId}/complete": { "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 `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCompletedById", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" } }, "default": { @@ -4883,12 +5167,19 @@ "required": true, "type": "string" }, + { + "name": "activityId", + "description": "Id of the activity to complete", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" } } ], @@ -4897,16 +5188,15 @@ ] } }, - "/namespaces/{namespace}/activities/pause": { + "/namespaces/{namespace}/activities/{activityId}/fail": { "post": { - "summary": "PauseActivity pauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be paused", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n- The activity should respond to the cancellation accordingly.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and\nstructured to work well for standalone activities.", - "operationId": "PauseActivity", + "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/v1PauseActivityResponse" + "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" } }, "default": { @@ -4919,7 +5209,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", "in": "path", "required": true, "type": "string" @@ -4929,7 +5226,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" } } ], @@ -4938,16 +5235,15 @@ ] } }, - "/namespaces/{namespace}/activities/reset": { + "/namespaces/{namespace}/activities/{activityId}/heartbeat": { "post": { - "summary": "ResetActivity resets the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be reset.", - "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag),\n\nFlags:\n\n'jitter': the activity will be scheduled at a random time within the jitter duration.\nIf the activity currently paused it will be unpaused, unless 'keep_paused' flag is provided.\n'reset_heartbeats': the activity heartbeat timer and heartbeats will be reset.\n'keep_paused': if the activity is paused, it will remain paused.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.\nThis API will be deprecated soon and replaced with a newer ResetActivityExecution that is better named and\nstructured to work well for standalone activities.", - "operationId": "ResetActivity", + "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/v1ResetActivityResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" } }, "default": { @@ -4960,7 +5256,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 we're heartbeating", "in": "path", "required": true, "type": "string" @@ -4970,7 +5273,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" } } ], @@ -4979,16 +5282,15 @@ ] } }, - "/namespaces/{namespace}/activities/unpause": { - "post": { - "summary": "UnpauseActivity unpauses the execution of an activity specified by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be unpaused.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nFlags:\n'jitter': the activity will be scheduled at a random time within the jitter duration.\n'reset_attempts': the number of attempts will be reset.\n'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type\nThis API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and\nstructured to work well for standalone activities.", - "operationId": "UnpauseActivity", + "/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/v1UnpauseActivityResponse" + "$ref": "#/definitions/v1PollActivityExecutionResponse" } }, "default": { @@ -5001,18 +5303,22 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", + "name": "activityId", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityBody" - } + "type": "string" + }, + { + "name": "runId", + "description": "Activity run ID. If empty the request targets the latest run.", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -5020,15 +5326,15 @@ ] } }, - "/namespaces/{namespace}/activities/update-options": { + "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.\nIf there are multiple pending activities of the provided type - all of them will be updated.\nThis API will be deprecated soon and replaced with a newer UpdateActivityExecutionOptions that is better named and\nstructured to work well for standalone activities.", - "operationId": "UpdateActivityOptions", + "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/v1UpdateActivityOptionsResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -5046,12 +5352,19 @@ "required": true, "type": "string" }, + { + "name": "activityId", + "description": "Id of the activity to confirm is cancelled", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityOptionsBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -5060,15 +5373,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}": { - "get": { - "summary": "DescribeActivityExecution returns information about an activity execution.\nIt can be used to:\n- Get current activity info without waiting\n- Long-poll for next state change and return new activity info\nResponse can optionally include activity input or outcome (if the activity has completed).", - "operationId": "DescribeActivityExecution", + "/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/v1DescribeActivityExecutionResponse" + "$ref": "#/definitions/v1TerminateActivityExecutionResponse" } }, "default": { @@ -5092,48 +5406,29 @@ "type": "string" }, { - "name": "runId", - "description": "Activity run ID. If empty the request targets the latest run.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "includeInput", - "description": "Include the input field in the response.", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "includeOutcome", - "description": "Include the outcome (result/failure) in the response if the activity has completed.", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "longPollToken", - "description": "Token from a previous DescribeActivityExecutionResponse. If present, long-poll until activity\nstate changes from the state encoded in this token. If absent, return current state immediately.\nIf present, run_id must also be present.\nNote that activity state may change multiple times between requests, therefore it is not\nguaranteed that a client making a sequence of long-poll requests will see a complete\nsequence of state changes.", - "in": "query", - "required": false, - "type": "string", - "format": "byte" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" + } } ], "tags": [ "WorkflowService" ] - }, + } + }, + "/namespaces/{namespace}/activity-complete": { "post": { - "summary": "StartActivityExecution starts a new activity execution.", - "description": "Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace\nunless permitted by the specified ID conflict policy.", - "operationId": "StartActivityExecution", + "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", + "description": "For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", + "operationId": "RespondActivityTaskCompleted", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1StartActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskCompletedResponse" } }, "default": { @@ -5150,19 +5445,12 @@ "required": true, "type": "string" }, - { - "name": "activityId", - "description": "Identifier for this activity. Required. This identifier should be meaningful in the user's\nown system. It must be unique among activities in the same namespace, subject to the rules\nimposed by id_reuse_policy and id_conflict_policy.", - "in": "path", - "required": true, - "type": "string" - }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceStartActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedBody" } } ], @@ -5171,16 +5459,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/cancel": { - "post": { - "summary": "RequestCancelActivityExecution requests cancellation of an activity execution.", - "description": "Cancellation is cooperative: this call records the request, but the activity must detect and\nacknowledge it for the activity to reach CANCELED status. The cancellation signal is\ndelivered via `cancel_requested` in the heartbeat response; SDKs surface this via\nlanguage-idiomatic mechanisms (context cancellation, exceptions, abort signals).", - "operationId": "RequestCancelActivityExecution", + "/namespaces/{namespace}/activity-count": { + "get": { + "summary": "CountActivityExecutions is a visibility API to count activity executions in a specific namespace.", + "operationId": "CountActivityExecutions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RequestCancelActivityExecutionResponse" + "$ref": "#/definitions/v1CountActivityExecutionsResponse" } }, "default": { @@ -5198,18 +5485,11 @@ "type": "string" }, { - "name": "activityId", - "in": "path", - "required": true, + "name": "query", + "description": "Visibility query, see https://docs.temporal.io/list-filter for the syntax.", + "in": "query", + "required": false, "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceRequestCancelActivityExecutionBody" - } } ], "tags": [ @@ -5217,15 +5497,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}/activity-fail": { + "post": { + "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", + "description": "This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and\na new workflow task created for the workflow. Fails with `NotFound` if the task token is no\nlonger valid due to activity timeout, already being completed, or never having existed.", + "operationId": "RespondActivityTaskFailed", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PollActivityExecutionResponse" + "$ref": "#/definitions/v1RespondActivityTaskFailedResponse" } }, "default": { @@ -5243,17 +5524,12 @@ "type": "string" }, { - "name": "activityId", - "in": "path", + "name": "body", + "in": "body", "required": true, - "type": "string" - }, - { - "name": "runId", - "description": "Activity run ID. If empty the request targets the latest run.", - "in": "query", - "required": false, - "type": "string" + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedBody" + } } ], "tags": [ @@ -5261,16 +5537,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/terminate": { + "/namespaces/{namespace}/activity-heartbeat": { "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": "RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.", + "description": "If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task,\nthen the current attempt times out. Depending on RetryPolicy, this may trigger a retry or\ntime out the activity.\n\nFor workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow\nhistory. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations,\nin that event, the SDK should request cancellation of the activity.\n\nThe request may contain response `details` which will be persisted by the server and may be\nused by the activity to checkpoint progress. The `cancel_requested` field in the response\nindicates whether cancellation has been requested for the activity.", + "operationId": "RecordActivityTaskHeartbeat", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateActivityExecutionResponse" + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatResponse" } }, "default": { @@ -5287,18 +5563,12 @@ "required": true, "type": "string" }, - { - "name": "activityId", - "in": "path", - "required": true, - "type": "string" - }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatBody" } } ], @@ -5307,15 +5577,16 @@ ] } }, - "/namespaces/{namespace}/activity-count": { - "get": { - "summary": "CountActivityExecutions is a visibility API to count activity executions in a specific namespace.", - "operationId": "CountActivityExecutions", + "/namespaces/{namespace}/activity-resolve-as-canceled": { + "post": { + "summary": "RespondActivityTaskFailed is called by workers when processing an activity task fails.", + "description": "For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history\nand a new workflow task created for the workflow. Fails with `NotFound` if the task token is\nno longer valid due to activity timeout, already being completed, or never having existed.", + "operationId": "RespondActivityTaskCanceled", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1CountActivityExecutionsResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledResponse" } }, "default": { @@ -5333,11 +5604,12 @@ "type": "string" }, { - "name": "query", - "description": "Visibility query, see https://docs.temporal.io/list-filter for the syntax.", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledBody" + } } ], "tags": [ @@ -8065,6 +8337,222 @@ ] } }, + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete": { + "post": { + "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/v1RespondActivityTaskCompletedByIdResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "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" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowId}/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": "RespondActivityTaskFailedById3", + "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": "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" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowId}/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": "RecordActivityTaskHeartbeatById3", + "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": "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 we're heartbeating", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled": { + "post": { + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById3", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "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 confirm is cancelled", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/workflows/{workflowId}/pause": { "post": { "summary": "Note: This is an experimental API and the behavior may change in a future release.\nPauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in\n- The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history\n- No new workflow tasks or activity tasks are dispatched.\n - Any workflow task currently executing on the worker will be allowed to complete.\n - Any activity task currently executing will be paused.\n- All server-side events will continue to be processed by the server.\n- Queries & Updates on a paused workflow will be rejected.", @@ -8931,18 +9419,10 @@ "WorkflowServiceRecordActivityTaskHeartbeatByIdBody": { "type": "object", "properties": { - "workflowId": { - "type": "string", - "title": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity" - }, "runId": { "type": "string", "description": "For a workflow activity - the run ID of the workflow which scheduled this activity.\nFor a standalone activity - the run ID of the activity." }, - "activityId": { - "type": "string", - "title": "Id of the activity we're heartbeating" - }, "details": { "$ref": "#/definitions/v1Payloads", "title": "Arbitrary data, of which the most recent call is kept, to store for this activity" @@ -9152,18 +9632,10 @@ "WorkflowServiceRespondActivityTaskCanceledByIdBody": { "type": "object", "properties": { - "workflowId": { - "type": "string", - "title": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity" - }, "runId": { "type": "string", "description": "For a workflow activity - the run ID of the workflow which scheduled this activity.\nFor a standalone activity - the run ID of the activity." }, - "activityId": { - "type": "string", - "title": "Id of the activity to confirm is cancelled" - }, "details": { "$ref": "#/definitions/v1Payloads", "title": "Serialized additional information to attach to the cancellation" @@ -9211,18 +9683,10 @@ "WorkflowServiceRespondActivityTaskCompletedByIdBody": { "type": "object", "properties": { - "workflowId": { - "type": "string", - "title": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity" - }, "runId": { "type": "string", "description": "For a workflow activity - the run ID of the workflow which scheduled this activity.\nFor a standalone activity - the run ID of the activity." }, - "activityId": { - "type": "string", - "title": "Id of the activity to complete" - }, "result": { "$ref": "#/definitions/v1Payloads", "title": "The serialized result of activity execution" @@ -9270,18 +9734,10 @@ "WorkflowServiceRespondActivityTaskFailedByIdBody": { "type": "object", "properties": { - "workflowId": { - "type": "string", - "title": "Id of the workflow which scheduled this activity, leave empty to target a standalone activity" - }, "runId": { "type": "string", "description": "For a workflow activity - the run ID of the workflow which scheduled this activity.\nFor a standalone activity - the run ID of the activity." }, - "activityId": { - "type": "string", - "title": "Id of the activity to fail" - }, "failure": { "$ref": "#/definitions/apiFailureV1Failure", "title": "Detailed failure information" diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 580d68a73..7098105c5 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -164,20 +164,34 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/cancel: + /api/v1/namespaces/{namespace}/activities-deprecated/pause: post: tags: - WorkflowService description: |- - RespondActivityTaskFailed is called by workers when processing an activity task fails. + PauseActivity pauses the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be paused - For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history - and a new workflow task created for the workflow. Fails with `NotFound` if the task token is - no longer valid due to activity timeout, already being completed, or never having existed. - operationId: RespondActivityTaskCanceled + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + - The activity should respond to the cancellation accordingly. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type + This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and + structured to work well for standalone activities. + operationId: PauseActivity parameters: - name: namespace in: path + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string @@ -185,7 +199,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledRequest' + $ref: '#/components/schemas/PauseActivityRequest' required: true responses: "200": @@ -193,28 +207,42 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledResponse' + $ref: '#/components/schemas/PauseActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/cancel-by-id: + /api/v1/namespaces/{namespace}/activities-deprecated/reset: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCanceled`. This version allows clients to record failures by - namespace/workflow id/activity id instead of task token. + ResetActivity resets the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be reset. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskCanceledById + 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. + This API will be deprecated soon and replaced with a newer ResetActivityExecution that is better named and + structured to work well for standalone activities. + operationId: ResetActivity 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 @@ -222,7 +250,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' + $ref: '#/components/schemas/ResetActivityRequest' required: true responses: "200": @@ -230,28 +258,38 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' + $ref: '#/components/schemas/ResetActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/complete: + /api/v1/namespaces/{namespace}/activities-deprecated/unpause: post: tags: - WorkflowService description: |- - RespondActivityTaskCompleted is called by workers when they successfully complete an activity - task. + UnpauseActivity unpauses the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be unpaused. - For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history - and a new workflow task created for the workflow. Fails with `NotFound` if the task token is - no longer valid due to activity timeout, already being completed, or never having existed. - operationId: RespondActivityTaskCompleted + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Flags: + 'jitter': the activity will be scheduled at a random time within the jitter duration. + 'reset_attempts': the number of attempts will be reset. + 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type + This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and + structured to work well for standalone activities. + operationId: UnpauseActivity parameters: - name: namespace in: path + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string @@ -259,7 +297,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedRequest' + $ref: '#/components/schemas/UnpauseActivityRequest' required: true responses: "200": @@ -267,24 +305,23 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedResponse' + $ref: '#/components/schemas/UnpauseActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/complete-by-id: + /api/v1/namespaces/{namespace}/activities-deprecated/update-options: 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 + UpdateActivityOptions is called by the client to update the options of an activity by its ID or type. + If there are multiple pending activities of the provided type - all of them will be updated. + This API will be deprecated soon and replaced with a newer UpdateActivityExecutionOptions that is better named and + structured to work well for standalone activities. + operationId: UpdateActivityOptions parameters: - name: namespace in: path @@ -296,7 +333,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' + $ref: '#/components/schemas/UpdateActivityOptionsRequest' required: true responses: "200": @@ -304,64 +341,96 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' + $ref: '#/components/schemas/UpdateActivityOptionsResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/fail: - post: + /api/v1/namespaces/{namespace}/activities/{activityId}: + get: tags: - WorkflowService description: |- - RespondActivityTaskFailed is called by workers when processing an activity task fails. - - This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and - a new workflow task created for the workflow. Fails with `NotFound` if the task token is no - longer valid due to activity timeout, already being completed, or never having existed. - operationId: RespondActivityTaskFailed + DescribeActivityExecution returns information about an activity execution. + It can be used to: + - Get current activity info without waiting + - Long-poll for next state change and return new activity info + Response can optionally include activity input or outcome (if the activity has completed). + operationId: DescribeActivityExecution parameters: - name: namespace in: path required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskFailedRequest' - required: true + - 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 + - name: includeInput + in: query + description: Include the input field in the response. + schema: + type: boolean + - name: includeOutcome + in: query + description: Include the outcome (result/failure) in the response if the activity has completed. + schema: + type: boolean + - name: longPollToken + in: query + description: |- + Token from a previous DescribeActivityExecutionResponse. If present, long-poll until activity + state changes from the state encoded in this token. If absent, return current state immediately. + If present, run_id must also be present. + Note that activity state may change multiple times between requests, therefore it is not + guaranteed that a client making a sequence of long-poll requests will see a complete + sequence of state changes. + schema: + type: string + format: bytes responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedResponse' + $ref: '#/components/schemas/DescribeActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/fail-by-id: post: tags: - WorkflowService description: |- - See `RecordActivityTaskFailed`. This version allows clients to record failures by - namespace/workflow id/activity id instead of task token. + StartActivityExecution starts a new activity execution. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RespondActivityTaskFailedById + Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace + unless permitted by the specified ID conflict policy. + operationId: StartActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Identifier for this activity. Required. This identifier should be meaningful in the user's + own system. It must be unique among activities in the same namespace, subject to the rules + imposed by id_reuse_policy and id_conflict_policy. required: true schema: type: string @@ -369,7 +438,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' + $ref: '#/components/schemas/StartActivityExecutionRequest' required: true responses: "200": @@ -377,43 +446,41 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' + $ref: '#/components/schemas/StartActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/heartbeat: + /api/v1/namespaces/{namespace}/activities/{activityId}/cancel: post: tags: - WorkflowService description: |- - RecordActivityTaskHeartbeat is optionally called by workers while they execute activities. - - If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task, - then the current attempt times out. Depending on RetryPolicy, this may trigger a retry or - time out the activity. - - For workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow - history. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations, - in that event, the SDK should request cancellation of the activity. + RequestCancelActivityExecution requests cancellation of an activity execution. - The request may contain response `details` which will be persisted by the server and may be - used by the activity to checkpoint progress. The `cancel_requested` field in the response - indicates whether cancellation has been requested for the activity. - operationId: RecordActivityTaskHeartbeat + Cancellation is cooperative: this call records the request, but the activity must detect and + acknowledge it for the activity to reach CANCELED status. The cancellation signal is + delivered via `cancel_requested` in the heartbeat response; SDKs surface this via + language-idiomatic mechanisms (context cancellation, exceptions, abort signals). + operationId: RequestCancelActivityExecution parameters: - name: namespace in: path required: true schema: type: string + - name: activityId + in: path + required: true + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatRequest' + $ref: '#/components/schemas/RequestCancelActivityExecutionRequest' required: true responses: "200": @@ -421,24 +488,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatResponse' + $ref: '#/components/schemas/RequestCancelActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/heartbeat-by-id: + /api/v1/namespaces/{namespace}/activities/{activityId}/complete: post: tags: - WorkflowService description: |- - See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by + 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: RecordActivityTaskHeartbeatById + operationId: RespondActivityTaskCompletedById parameters: - name: namespace in: path @@ -446,11 +513,17 @@ paths: 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/RecordActivityTaskHeartbeatByIdRequest' + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' required: true responses: "200": @@ -458,41 +531,34 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/pause: + /api/v1/namespaces/{namespace}/activities/{activityId}/fail: post: tags: - WorkflowService description: |- - PauseActivity pauses the execution of an activity specified by its ID or type. - If there are multiple pending activities of the provided type - all of them will be paused - - Pausing an activity means: - - If the activity is currently waiting for a retry or is running and subsequently fails, - it will not be rescheduled until it is unpaused. - - If the activity is already paused, calling this method will have no effect. - - If the activity is running and finishes successfully, the activity will be completed. - - If the activity is running and finishes with failure: - * if there is no retry left - the activity will be completed. - * if there are more retries left - the activity will be paused. - For long-running activities: - - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. - - The activity should respond to the cancellation accordingly. + See `RecordActivityTaskFailed`. This version allows clients to record failures by + namespace/workflow id/activity id instead of task token. - Returns a `NotFound` error if there is no pending activity with the provided ID or type - This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and - structured to work well for standalone activities. - operationId: PauseActivity + (-- 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. + 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 @@ -500,7 +566,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityRequest' + $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' required: true responses: "200": @@ -508,42 +574,34 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityResponse' + $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/reset: + /api/v1/namespaces/{namespace}/activities/{activityId}/heartbeat: post: tags: - WorkflowService description: |- - ResetActivity resets the execution of an activity specified by its ID or type. - If there are multiple pending activities of the provided type - all of them will be reset. - - 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. + See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by + namespace/workflow id/activity id instead of task token. - Returns a `NotFound` error if there is no pending activity with the provided ID or type. - This API will be deprecated soon and replaced with a newer ResetActivityExecution that is better named and - structured to work well for standalone activities. - operationId: ResetActivity + (-- 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. + 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 @@ -551,7 +609,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityRequest' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' required: true responses: "200": @@ -559,70 +617,61 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityResponse' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/unpause: - post: + /api/v1/namespaces/{namespace}/activities/{activityId}/outcome: + get: tags: - WorkflowService description: |- - UnpauseActivity unpauses the execution of an activity specified by its ID or type. - If there are multiple pending activities of the provided type - all of them will be unpaused. - - If activity is not paused, this call will have no effect. - If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). - Once the activity is unpaused, all timeout timers will be regenerated. - - Flags: - 'jitter': the activity will be scheduled at a random time within the jitter duration. - 'reset_attempts': the number of attempts will be reset. - 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. - - Returns a `NotFound` error if there is no pending activity with the provided ID or type - This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and - structured to work well for standalone activities. - operationId: UnpauseActivity + PollActivityExecution long-polls for an activity execution to complete and returns the + outcome (result or failure). + operationId: PollActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity. required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UnpauseActivityRequest' - required: true + - 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/UnpauseActivityResponse' + $ref: '#/components/schemas/PollActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/update-options: + /api/v1/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - UpdateActivityOptions is called by the client to update the options of an activity by its ID or type. - If there are multiple pending activities of the provided type - all of them will be updated. - This API will be deprecated soon and replaced with a newer UpdateActivityExecutionOptions that is better named and - structured to work well for standalone activities. - operationId: UpdateActivityOptions + 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 parameters: - name: namespace in: path @@ -630,11 +679,17 @@ paths: 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/UpdateActivityOptionsRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' required: true responses: "200": @@ -642,24 +697,23 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateActivityOptionsResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/{activityId}: - get: + /api/v1/namespaces/{namespace}/activities/{activityId}/terminate: + post: tags: - WorkflowService description: |- - DescribeActivityExecution returns information about an activity execution. - It can be used to: - - Get current activity info without waiting - - Long-poll for next state change and return new activity info - Response can optionally include activity input or outcome (if the activity has completed). - operationId: DescribeActivityExecution + 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 @@ -671,75 +725,48 @@ 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 - - name: includeInput - in: query - description: Include the input field in the response. - schema: - type: boolean - - name: includeOutcome - in: query - description: Include the outcome (result/failure) in the response if the activity has completed. - schema: - type: boolean - - name: longPollToken - in: query - description: |- - Token from a previous DescribeActivityExecutionResponse. If present, long-poll until activity - state changes from the state encoded in this token. If absent, return current state immediately. - If present, run_id must also be present. - Note that activity state may change multiple times between requests, therefore it is not - guaranteed that a client making a sequence of long-poll requests will see a complete - sequence of state changes. - schema: - type: string - format: bytes + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TerminateActivityExecutionRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/DescribeActivityExecutionResponse' + $ref: '#/components/schemas/TerminateActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activity-complete: post: tags: - WorkflowService description: |- - StartActivityExecution starts a new activity execution. + RespondActivityTaskCompleted is called by workers when they successfully complete an activity + task. - Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace - unless permitted by the specified ID conflict policy. - operationId: StartActivityExecution + For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history + and a new workflow task created for the workflow. Fails with `NotFound` if the task token is + no longer valid due to activity timeout, already being completed, or never having existed. + operationId: RespondActivityTaskCompleted parameters: - name: namespace in: path required: true schema: type: string - - name: activityId - in: path - description: |- - Identifier for this activity. Required. This identifier should be meaningful in the user's - own system. It must be unique among activities in the same namespace, subject to the rules - imposed by id_reuse_policy and id_conflict_policy. - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/StartActivityExecutionRequest' + $ref: '#/components/schemas/RespondActivityTaskCompletedRequest' required: true responses: "200": @@ -747,118 +774,109 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartActivityExecutionResponse' + $ref: '#/components/schemas/RespondActivityTaskCompletedResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/{activityId}/cancel: - post: + /api/v1/namespaces/{namespace}/activity-count: + get: tags: - WorkflowService - description: |- - RequestCancelActivityExecution requests cancellation of an activity execution. - - Cancellation is cooperative: this call records the request, but the activity must detect and - acknowledge it for the activity to reach CANCELED status. The cancellation signal is - delivered via `cancel_requested` in the heartbeat response; SDKs surface this via - language-idiomatic mechanisms (context cancellation, exceptions, abort signals). - operationId: RequestCancelActivityExecution + description: CountActivityExecutions is a visibility API to count activity executions in a specific namespace. + operationId: CountActivityExecutions parameters: - name: namespace in: path required: true schema: type: string - - name: activityId - in: path - required: true + - name: query + in: query + description: Visibility query, see https://docs.temporal.io/list-filter for the syntax. schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RequestCancelActivityExecutionRequest' - required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/RequestCancelActivityExecutionResponse' + $ref: '#/components/schemas/CountActivityExecutionsResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/{activityId}/outcome: - get: + /api/v1/namespaces/{namespace}/activity-fail: + post: tags: - WorkflowService description: |- - PollActivityExecution long-polls for an activity execution to complete and returns the - outcome (result or failure). - operationId: PollActivityExecution + RespondActivityTaskFailed is called by workers when processing an activity task fails. + + This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and + a new workflow task created for the workflow. Fails with `NotFound` if the task token is no + longer valid due to activity timeout, already being completed, or never having existed. + operationId: RespondActivityTaskFailed 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 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskFailedRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/PollActivityExecutionResponse' + $ref: '#/components/schemas/RespondActivityTaskFailedResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activities/{activityId}/terminate: + /api/v1/namespaces/{namespace}/activity-heartbeat: post: tags: - WorkflowService description: |- - TerminateActivityExecution terminates an existing activity execution immediately. + RecordActivityTaskHeartbeat is optionally called by workers while they execute activities. - Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a - running attempt. - operationId: TerminateActivityExecution + If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task, + then the current attempt times out. Depending on RetryPolicy, this may trigger a retry or + time out the activity. + + For workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow + history. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations, + in that event, the SDK should request cancellation of the activity. + + The request may contain response `details` which will be persisted by the server and may be + used by the activity to checkpoint progress. The `cancel_requested` field in the response + indicates whether cancellation has been requested for the activity. + operationId: RecordActivityTaskHeartbeat parameters: - name: namespace in: path required: true schema: type: string - - name: activityId - in: path - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/TerminateActivityExecutionRequest' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatRequest' required: true responses: "200": @@ -866,37 +884,43 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TerminateActivityExecutionResponse' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/activity-count: - get: + /api/v1/namespaces/{namespace}/activity-resolve-as-canceled: + post: tags: - WorkflowService - description: CountActivityExecutions is a visibility API to count activity executions in a specific namespace. - operationId: CountActivityExecutions + description: |- + RespondActivityTaskFailed is called by workers when processing an activity task fails. + + For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history + and a new workflow task created for the workflow. Fails with `NotFound` if the task token is + no longer valid due to activity timeout, already being completed, or never having existed. + operationId: RespondActivityTaskCanceled parameters: - name: namespace in: path required: true schema: type: string - - name: query - in: query - description: Visibility query, see https://docs.temporal.io/list-filter for the syntax. - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCanceledRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/CountActivityExecutionsResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledResponse' default: description: Default error response content: @@ -2885,138 +2909,317 @@ paths: required: true schema: type: string - - name: execution.workflow_id + - name: execution.workflow_id + in: path + required: true + schema: + type: string + - name: execution.workflowId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + - name: maximumPageSize + in: query + schema: + type: integer + format: int32 + - name: nextPageToken + in: query + description: |- + If a `GetWorkflowExecutionHistoryResponse` or a `PollWorkflowTaskQueueResponse` had one of + these, it should be passed here to fetch the next page. + schema: + type: string + format: bytes + - name: waitNewEvent + in: query + description: |- + If set to true, the RPC call will not resolve until there is a new event which matches + the `history_event_filter_type`, or a timeout is hit. + schema: + type: boolean + - name: historyEventFilterType + in: query + description: |- + Filter returned events such that they match the specified filter type. + Default: HISTORY_EVENT_FILTER_TYPE_ALL_EVENT. + schema: + enum: + - HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED + - HISTORY_EVENT_FILTER_TYPE_ALL_EVENT + - HISTORY_EVENT_FILTER_TYPE_CLOSE_EVENT + type: string + format: enum + - name: skipArchival + in: query + schema: + type: boolean + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetWorkflowExecutionHistoryResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/history-reverse: + get: + tags: + - WorkflowService + description: |- + GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse + order (starting from last event). Fails with`NotFound` if the specified workflow execution is + unknown to the service. + operationId: GetWorkflowExecutionHistoryReverse + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.workflow_id + in: path + required: true + schema: + type: string + - name: execution.workflowId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + - name: maximumPageSize + in: query + schema: + type: integer + format: int32 + - name: nextPageToken + in: query + schema: + type: string + format: bytes + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetWorkflowExecutionHistoryReverseResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/query/{query.query_type}: + post: + tags: + - WorkflowService + description: QueryWorkflow requests a query be executed for a specified workflow execution. + operationId: QueryWorkflow + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.workflow_id + in: path + required: true + schema: + type: string + - name: query.query_type + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QueryWorkflowRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/QueryWorkflowResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/trigger-rule: + post: + tags: + - WorkflowService + description: |- + TriggerWorkflowRule allows to: + * trigger existing rule for a specific workflow execution; + * trigger rule for a specific workflow execution without creating a rule; + This is useful for one-off operations. + operationId: TriggerWorkflowRule + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - 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' + /api/v1/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 - - name: execution.workflowId - in: query - schema: - type: string - - name: execution.runId - in: query - schema: - type: string - - name: maximumPageSize - in: query - schema: - type: integer - format: int32 - - name: nextPageToken - in: query - description: |- - If a `GetWorkflowExecutionHistoryResponse` or a `PollWorkflowTaskQueueResponse` had one of - these, it should be passed here to fetch the next page. - schema: - type: string - format: bytes - - name: waitNewEvent - in: query - description: |- - If set to true, the RPC call will not resolve until there is a new event which matches - the `history_event_filter_type`, or a timeout is hit. - schema: - type: boolean - - name: historyEventFilterType - in: query - description: |- - Filter returned events such that they match the specified filter type. - Default: HISTORY_EVENT_FILTER_TYPE_ALL_EVENT. - schema: - enum: - - HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED - - HISTORY_EVENT_FILTER_TYPE_ALL_EVENT - - HISTORY_EVENT_FILTER_TYPE_CLOSE_EVENT - type: string - format: enum - - name: skipArchival - in: query - schema: - type: boolean + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartWorkflowExecutionRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/GetWorkflowExecutionHistoryResponse' + $ref: '#/components/schemas/StartWorkflowExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/history-reverse: - get: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/complete: + post: tags: - WorkflowService description: |- - GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse - order (starting from last event). Fails with`NotFound` if the specified workflow execution is - unknown to the service. - operationId: GetWorkflowExecutionHistoryReverse + 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: execution.workflow_id + - 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: execution.workflowId - in: query - schema: - type: string - - name: execution.runId - in: query - schema: - type: string - - name: maximumPageSize - in: query - schema: - type: integer - format: int32 - - name: nextPageToken - in: query + - name: activityId + in: path + description: Id of the activity to complete + required: true schema: type: string - format: bytes + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/GetWorkflowExecutionHistoryReverseResponse' + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/query/{query.query_type}: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/fail: post: tags: - WorkflowService - description: QueryWorkflow requests a query be executed for a specified workflow execution. - operationId: QueryWorkflow + 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: execution.workflow_id + - 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: query.query_type + - name: activityId in: path + description: Id of the activity to fail required: true schema: type: string @@ -3024,7 +3227,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/QueryWorkflowRequest' + $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' required: true responses: "200": @@ -3032,31 +3235,40 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/QueryWorkflowResponse' + $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/trigger-rule: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/heartbeat: post: tags: - WorkflowService description: |- - TriggerWorkflowRule allows to: - * trigger existing rule for a specific workflow execution; - * trigger rule for a specific workflow execution without creating a rule; - This is useful for one-off operations. - operationId: TriggerWorkflowRule + 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: execution.workflow_id + - name: activityId in: path + description: Id of the activity we're heartbeating required: true schema: type: string @@ -3064,7 +3276,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TriggerWorkflowRuleRequest' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' required: true responses: "200": @@ -3072,32 +3284,40 @@ 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' - /api/v1/namespaces/{namespace}/workflows/{workflowId}: + /api/v1/namespaces/{namespace}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - StartWorkflowExecution starts a new workflow execution. + See `RespondActivityTaskCanceled`. This version allows clients to record failures by + namespace/workflow id/activity id instead of task token. - 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 + (-- api-linter: core::0136::prepositions=disabled + 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 @@ -3105,7 +3325,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartWorkflowExecutionRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' required: true responses: "200": @@ -3113,7 +3333,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartWorkflowExecutionResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' default: description: Default error response content: @@ -4003,94 +4223,16 @@ paths: tags: - OperatorService description: |- - Optimistically update a Nexus endpoint based on provided version as obtained via the `GetNexusEndpoint` or - `ListNexusEndpointResponse` APIs. This will fail with a status of FAILED_PRECONDITION if the version does not - match. - Returns the updated endpoint with its updated version. You may use this version for subsequent updates. You don't - need to increment the version yourself. The server will increment the version for you after each update. - operationId: UpdateNexusEndpoint - parameters: - - name: id - in: path - description: Server-generated unique endpoint ID. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateNexusEndpointRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateNexusEndpointResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities: - get: - tags: - - WorkflowService - description: ListActivityExecutions is a visibility API to list activity executions in a specific namespace. - operationId: ListActivityExecutions - parameters: - - name: namespace - in: path - required: true - schema: - type: string - - name: pageSize - in: query - description: Max number of executions to return per page. - schema: - type: integer - format: int32 - - name: nextPageToken - in: query - description: Token returned in ListActivityExecutionsResponse. - schema: - type: string - format: bytes - - name: query - in: query - description: Visibility query, see https://docs.temporal.io/list-filter for the syntax. - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListActivityExecutionsResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/cancel: - post: - tags: - - WorkflowService - description: |- - RespondActivityTaskFailed is called by workers when processing an activity task fails. - - For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history - and a new workflow task created for the workflow. Fails with `NotFound` if the task token is - no longer valid due to activity timeout, already being completed, or never having existed. - operationId: RespondActivityTaskCanceled + Optimistically update a Nexus endpoint based on provided version as obtained via the `GetNexusEndpoint` or + `ListNexusEndpointResponse` APIs. This will fail with a status of FAILED_PRECONDITION if the version does not + match. + Returns the updated endpoint with its updated version. You may use this version for subsequent updates. You don't + need to increment the version yourself. The server will increment the version for you after each update. + operationId: UpdateNexusEndpoint parameters: - - name: namespace + - name: id in: path + description: Server-generated unique endpoint ID. required: true schema: type: string @@ -4098,7 +4240,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledRequest' + $ref: '#/components/schemas/UpdateNexusEndpointRequest' required: true responses: "200": @@ -4106,65 +4248,83 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledResponse' + $ref: '#/components/schemas/UpdateNexusEndpointResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/cancel-by-id: - post: + /namespaces/{namespace}/activities: + get: 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 + description: ListActivityExecutions is a visibility API to list activity executions in a specific namespace. + operationId: ListActivityExecutions parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' - required: true + - name: pageSize + in: query + description: Max number of executions to return per page. + schema: + type: integer + format: int32 + - name: nextPageToken + in: query + description: Token returned in ListActivityExecutionsResponse. + schema: + type: string + format: bytes + - name: query + in: query + description: Visibility query, see https://docs.temporal.io/list-filter for the syntax. + schema: + type: string responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' + $ref: '#/components/schemas/ListActivityExecutionsResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/complete: + /namespaces/{namespace}/activities-deprecated/pause: post: tags: - WorkflowService description: |- - RespondActivityTaskCompleted is called by workers when they successfully complete an activity - task. + PauseActivity pauses the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be paused - For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history - and a new workflow task created for the workflow. Fails with `NotFound` if the task token is - no longer valid due to activity timeout, already being completed, or never having existed. - operationId: RespondActivityTaskCompleted + Pausing an activity means: + - If the activity is currently waiting for a retry or is running and subsequently fails, + it will not be rescheduled until it is unpaused. + - If the activity is already paused, calling this method will have no effect. + - If the activity is running and finishes successfully, the activity will be completed. + - If the activity is running and finishes with failure: + * if there is no retry left - the activity will be completed. + * if there are more retries left - the activity will be paused. + For long-running activities: + - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. + - The activity should respond to the cancellation accordingly. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type + This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and + structured to work well for standalone activities. + operationId: PauseActivity parameters: - name: namespace in: path + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string @@ -4172,7 +4332,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedRequest' + $ref: '#/components/schemas/PauseActivityRequest' required: true responses: "200": @@ -4180,28 +4340,42 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedResponse' + $ref: '#/components/schemas/PauseActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/complete-by-id: + /namespaces/{namespace}/activities-deprecated/reset: post: tags: - WorkflowService description: |- - See `RespondActivityTaskCompleted`. This version allows clients to record completions by - namespace/workflow id/activity id instead of task token. + ResetActivity resets the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be reset. - (-- 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. + This API will be deprecated soon and replaced with a newer ResetActivityExecution that is better named and + structured to work well for standalone activities. + operationId: ResetActivity 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 @@ -4209,7 +4383,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' + $ref: '#/components/schemas/ResetActivityRequest' required: true responses: "200": @@ -4217,27 +4391,38 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' + $ref: '#/components/schemas/ResetActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/fail: + /namespaces/{namespace}/activities-deprecated/unpause: post: tags: - WorkflowService description: |- - RespondActivityTaskFailed is called by workers when processing an activity task fails. + UnpauseActivity unpauses the execution of an activity specified by its ID or type. + If there are multiple pending activities of the provided type - all of them will be unpaused. - This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and - a new workflow task created for the workflow. Fails with `NotFound` if the task token is no - longer valid due to activity timeout, already being completed, or never having existed. - operationId: RespondActivityTaskFailed + If activity is not paused, this call will have no effect. + If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). + Once the activity is unpaused, all timeout timers will be regenerated. + + Flags: + 'jitter': the activity will be scheduled at a random time within the jitter duration. + 'reset_attempts': the number of attempts will be reset. + 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + + Returns a `NotFound` error if there is no pending activity with the provided ID or type + This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and + structured to work well for standalone activities. + operationId: UnpauseActivity parameters: - name: namespace in: path + description: Namespace of the workflow which scheduled this activity. required: true schema: type: string @@ -4245,7 +4430,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedRequest' + $ref: '#/components/schemas/UnpauseActivityRequest' required: true responses: "200": @@ -4253,24 +4438,23 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedResponse' + $ref: '#/components/schemas/UnpauseActivityResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/fail-by-id: + /namespaces/{namespace}/activities-deprecated/update-options: 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 + UpdateActivityOptions is called by the client to update the options of an activity by its ID or type. + If there are multiple pending activities of the provided type - all of them will be updated. + This API will be deprecated soon and replaced with a newer UpdateActivityExecutionOptions that is better named and + structured to work well for standalone activities. + operationId: UpdateActivityOptions parameters: - name: namespace in: path @@ -4282,7 +4466,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' + $ref: '#/components/schemas/UpdateActivityOptionsRequest' required: true responses: "200": @@ -4290,72 +4474,96 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' + $ref: '#/components/schemas/UpdateActivityOptionsResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/heartbeat: - post: + /namespaces/{namespace}/activities/{activityId}: + get: tags: - WorkflowService description: |- - RecordActivityTaskHeartbeat is optionally called by workers while they execute activities. - - If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task, - then the current attempt times out. Depending on RetryPolicy, this may trigger a retry or - time out the activity. - - For workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow - history. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations, - in that event, the SDK should request cancellation of the activity. - - The request may contain response `details` which will be persisted by the server and may be - used by the activity to checkpoint progress. The `cancel_requested` field in the response - indicates whether cancellation has been requested for the activity. - operationId: RecordActivityTaskHeartbeat + DescribeActivityExecution returns information about an activity execution. + It can be used to: + - Get current activity info without waiting + - Long-poll for next state change and return new activity info + Response can optionally include activity input or outcome (if the activity has completed). + operationId: DescribeActivityExecution parameters: - name: namespace in: path required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatRequest' - required: true + - 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 + - name: includeInput + in: query + description: Include the input field in the response. + schema: + type: boolean + - name: includeOutcome + in: query + description: Include the outcome (result/failure) in the response if the activity has completed. + schema: + type: boolean + - name: longPollToken + in: query + description: |- + Token from a previous DescribeActivityExecutionResponse. If present, long-poll until activity + state changes from the state encoded in this token. If absent, return current state immediately. + If present, run_id must also be present. + Note that activity state may change multiple times between requests, therefore it is not + guaranteed that a client making a sequence of long-poll requests will see a complete + sequence of state changes. + schema: + type: string + format: bytes responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatResponse' + $ref: '#/components/schemas/DescribeActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/heartbeat-by-id: post: tags: - WorkflowService description: |- - See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by - namespace/workflow id/activity id instead of task token. + StartActivityExecution starts a new activity execution. - (-- api-linter: core::0136::prepositions=disabled - aip.dev/not-precedent: "By" is used to indicate request type. --) - operationId: RecordActivityTaskHeartbeatById + Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace + unless permitted by the specified ID conflict policy. + operationId: StartActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: activityId + in: path + description: |- + Identifier for this activity. Required. This identifier should be meaningful in the user's + own system. It must be unique among activities in the same namespace, subject to the rules + imposed by id_reuse_policy and id_conflict_policy. required: true schema: type: string @@ -4363,7 +4571,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' + $ref: '#/components/schemas/StartActivityExecutionRequest' required: true responses: "200": @@ -4371,41 +4579,33 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' + $ref: '#/components/schemas/StartActivityExecutionResponse' default: description: Default error response content: application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/pause: - post: - tags: - - WorkflowService - description: |- - PauseActivity pauses the execution of an activity specified by its ID or type. - If there are multiple pending activities of the provided type - all of them will be paused - - Pausing an activity means: - - If the activity is currently waiting for a retry or is running and subsequently fails, - it will not be rescheduled until it is unpaused. - - If the activity is already paused, calling this method will have no effect. - - If the activity is running and finishes successfully, the activity will be completed. - - If the activity is running and finishes with failure: - * if there is no retry left - the activity will be completed. - * if there are more retries left - the activity will be paused. - For long-running activities: - - activities in paused state will send a cancellation with "activity_paused" set to 'true' in response to 'RecordActivityTaskHeartbeat'. - - The activity should respond to the cancellation accordingly. + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/cancel: + post: + tags: + - WorkflowService + description: |- + RequestCancelActivityExecution requests cancellation of an activity execution. - Returns a `NotFound` error if there is no pending activity with the provided ID or type - This API will be deprecated soon and replaced with a newer PauseActivityExecution that is better named and - structured to work well for standalone activities. - operationId: PauseActivity + Cancellation is cooperative: this call records the request, but the activity must detect and + acknowledge it for the activity to reach CANCELED status. The cancellation signal is + delivered via `cancel_requested` in the heartbeat response; SDKs surface this via + language-idiomatic mechanisms (context cancellation, exceptions, abort signals). + operationId: RequestCancelActivityExecution parameters: - name: namespace in: path - description: Namespace of the workflow which scheduled this activity. + required: true + schema: + type: string + - name: activityId + in: path required: true schema: type: string @@ -4413,7 +4613,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityRequest' + $ref: '#/components/schemas/RequestCancelActivityExecutionRequest' required: true responses: "200": @@ -4421,42 +4621,34 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PauseActivityResponse' + $ref: '#/components/schemas/RequestCancelActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/reset: + /namespaces/{namespace}/activities/{activityId}/complete: post: tags: - WorkflowService description: |- - ResetActivity resets the execution of an activity specified by its ID or type. - If there are multiple pending activities of the provided type - all of them will be reset. - - 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. + See `RespondActivityTaskCompleted`. This version allows clients to record completions by + namespace/workflow id/activity id instead of task token. - Returns a `NotFound` error if there is no pending activity with the provided ID or type. - This API will be deprecated soon and replaced with a newer ResetActivityExecution that is better named and - structured to work well for standalone activities. - operationId: ResetActivity + (-- 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. + description: Namespace of the workflow which scheduled this activity + required: true + schema: + type: string + - name: activityId + in: path + description: Id of the activity to complete required: true schema: type: string @@ -4464,7 +4656,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityRequest' + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdRequest' required: true responses: "200": @@ -4472,38 +4664,34 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ResetActivityResponse' + $ref: '#/components/schemas/RespondActivityTaskCompletedByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/unpause: + /namespaces/{namespace}/activities/{activityId}/fail: post: tags: - WorkflowService description: |- - UnpauseActivity unpauses the execution of an activity specified by its ID or type. - If there are multiple pending activities of the provided type - all of them will be unpaused. - - If activity is not paused, this call will have no effect. - If the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag). - Once the activity is unpaused, all timeout timers will be regenerated. - - Flags: - 'jitter': the activity will be scheduled at a random time within the jitter duration. - 'reset_attempts': the number of attempts will be reset. - 'reset_heartbeat': the activity heartbeat timer and heartbeats will be reset. + See `RecordActivityTaskFailed`. This version allows clients to record failures by + namespace/workflow id/activity id instead of task token. - Returns a `NotFound` error if there is no pending activity with the provided ID or type - This API will be deprecated soon and replaced with a newer UnpauseActivityExecution that is better named and - structured to work well for standalone activities. - operationId: UnpauseActivity + (-- 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. + 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 @@ -4511,7 +4699,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnpauseActivityRequest' + $ref: '#/components/schemas/RespondActivityTaskFailedByIdRequest' required: true responses: "200": @@ -4519,23 +4707,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnpauseActivityResponse' + $ref: '#/components/schemas/RespondActivityTaskFailedByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/update-options: + /namespaces/{namespace}/activities/{activityId}/heartbeat: post: tags: - WorkflowService description: |- - UpdateActivityOptions is called by the client to update the options of an activity by its ID or type. - If there are multiple pending activities of the provided type - all of them will be updated. - This API will be deprecated soon and replaced with a newer UpdateActivityExecutionOptions that is better named and - structured to work well for standalone activities. - operationId: UpdateActivityOptions + 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 @@ -4543,11 +4732,17 @@ paths: 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/UpdateActivityOptionsRequest' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdRequest' required: true responses: "200": @@ -4555,24 +4750,21 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateActivityOptionsResponse' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}: + /namespaces/{namespace}/activities/{activityId}/outcome: get: tags: - WorkflowService description: |- - DescribeActivityExecution returns information about an activity execution. - It can be used to: - - Get current activity info without waiting - - Long-poll for next state change and return new activity info - Response can optionally include activity input or outcome (if the activity has completed). - operationId: DescribeActivityExecution + PollActivityExecution long-polls for an activity execution to complete and returns the + outcome (result or failure). + operationId: PollActivityExecution parameters: - name: namespace in: path @@ -4589,62 +4781,40 @@ paths: description: Activity run ID. If empty the request targets the latest run. schema: type: string - - name: includeInput - in: query - description: Include the input field in the response. - schema: - type: boolean - - name: includeOutcome - in: query - description: Include the outcome (result/failure) in the response if the activity has completed. - schema: - type: boolean - - name: longPollToken - in: query - description: |- - Token from a previous DescribeActivityExecutionResponse. If present, long-poll until activity - state changes from the state encoded in this token. If absent, return current state immediately. - If present, run_id must also be present. - Note that activity state may change multiple times between requests, therefore it is not - guaranteed that a client making a sequence of long-poll requests will see a complete - sequence of state changes. - schema: - type: string - format: bytes responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/DescribeActivityExecutionResponse' + $ref: '#/components/schemas/PollActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{activityId}/resolve-as-canceled: post: tags: - WorkflowService description: |- - StartActivityExecution starts a new activity execution. + See `RespondActivityTaskCanceled`. This version allows clients to record failures by + namespace/workflow id/activity id instead of task token. - Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace - unless permitted by the specified ID conflict policy. - operationId: StartActivityExecution + (-- api-linter: core::0136::prepositions=disabled + 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: activityId in: path - description: |- - Identifier for this activity. Required. This identifier should be meaningful in the user's - own system. It must be unique among activities in the same namespace, subject to the rules - imposed by id_reuse_policy and id_conflict_policy. + description: Id of the activity to confirm is cancelled required: true schema: type: string @@ -4652,7 +4822,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartActivityExecutionRequest' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdRequest' required: true responses: "200": @@ -4660,25 +4830,23 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StartActivityExecutionResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledByIdResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/cancel: + /namespaces/{namespace}/activities/{activityId}/terminate: post: tags: - WorkflowService description: |- - RequestCancelActivityExecution requests cancellation of an activity execution. + TerminateActivityExecution terminates an existing activity execution immediately. - Cancellation is cooperative: this call records the request, but the activity must detect and - acknowledge it for the activity to reach CANCELED status. The cancellation signal is - delivered via `cancel_requested` in the heartbeat response; SDKs surface this via - language-idiomatic mechanisms (context cancellation, exceptions, abort signals). - operationId: RequestCancelActivityExecution + 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 @@ -4694,7 +4862,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RequestCancelActivityExecutionRequest' + $ref: '#/components/schemas/TerminateActivityExecutionRequest' required: true responses: "200": @@ -4702,76 +4870,146 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RequestCancelActivityExecutionResponse' + $ref: '#/components/schemas/TerminateActivityExecutionResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/outcome: - get: + /namespaces/{namespace}/activity-complete: + post: tags: - WorkflowService description: |- - PollActivityExecution long-polls for an activity execution to complete and returns the - outcome (result or failure). - operationId: PollActivityExecution + RespondActivityTaskCompleted is called by workers when they successfully complete an activity + task. + + For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history + and a new workflow task created for the workflow. Fails with `NotFound` if the task token is + no longer valid due to activity timeout, already being completed, or never having existed. + operationId: RespondActivityTaskCompleted parameters: - name: namespace in: path required: true schema: type: string - - name: activityId + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCompletedRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCompletedResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activity-count: + get: + tags: + - WorkflowService + description: CountActivityExecutions is a visibility API to count activity executions in a specific namespace. + operationId: CountActivityExecutions + parameters: + - name: namespace in: path required: true schema: type: string - - name: runId + - name: query in: query - description: Activity run ID. If empty the request targets the latest run. + description: Visibility query, see https://docs.temporal.io/list-filter for the syntax. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CountActivityExecutionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activity-fail: + post: + tags: + - WorkflowService + description: |- + RespondActivityTaskFailed is called by workers when processing an activity task fails. + + This results in a new `ACTIVITY_TASK_FAILED` event being written to the workflow history and + a new workflow task created for the workflow. Fails with `NotFound` if the task token is no + longer valid due to activity timeout, already being completed, or never having existed. + operationId: RespondActivityTaskFailed + parameters: + - name: namespace + in: path + required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskFailedRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/PollActivityExecutionResponse' + $ref: '#/components/schemas/RespondActivityTaskFailedResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activities/{activityId}/terminate: + /namespaces/{namespace}/activity-heartbeat: post: tags: - WorkflowService description: |- - TerminateActivityExecution terminates an existing activity execution immediately. + RecordActivityTaskHeartbeat is optionally called by workers while they execute activities. - Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a - running attempt. - operationId: TerminateActivityExecution + If a worker fails to heartbeat within the `heartbeat_timeout` interval for the activity task, + then the current attempt times out. Depending on RetryPolicy, this may trigger a retry or + time out the activity. + + For workflow activities, an `ACTIVITY_TASK_TIMED_OUT` event will be written to the workflow + history. Calling `RecordActivityTaskHeartbeat` will fail with `NotFound` in such situations, + in that event, the SDK should request cancellation of the activity. + + The request may contain response `details` which will be persisted by the server and may be + used by the activity to checkpoint progress. The `cancel_requested` field in the response + indicates whether cancellation has been requested for the activity. + operationId: RecordActivityTaskHeartbeat parameters: - name: namespace in: path required: true schema: type: string - - name: activityId - in: path - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/TerminateActivityExecutionRequest' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatRequest' required: true responses: "200": @@ -4779,37 +5017,43 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TerminateActivityExecutionResponse' + $ref: '#/components/schemas/RecordActivityTaskHeartbeatResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activity-count: - get: + /namespaces/{namespace}/activity-resolve-as-canceled: + post: tags: - WorkflowService - description: CountActivityExecutions is a visibility API to count activity executions in a specific namespace. - operationId: CountActivityExecutions + description: |- + RespondActivityTaskFailed is called by workers when processing an activity task fails. + + For workflow activities, this results in a new `ACTIVITY_TASK_CANCELED` event being written to the workflow history + and a new workflow task created for the workflow. Fails with `NotFound` if the task token is + no longer valid due to activity timeout, already being completed, or never having existed. + operationId: RespondActivityTaskCanceled parameters: - name: namespace in: path required: true schema: type: string - - name: query - in: query - description: Visibility query, see https://docs.temporal.io/list-filter for the syntax. - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCanceledRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/CountActivityExecutionsResponse' + $ref: '#/components/schemas/RespondActivityTaskCanceledResponse' default: description: Default error response content: @@ -6975,6 +7219,202 @@ paths: 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 + 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}/workflows/{workflowId}/activities/{activityId}/resolve-as-canceled: + 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 + 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' /namespaces/{namespace}/workflows/{workflowId}/pause: post: tags: diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 8b0eb2ce6..6f1b2d517 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -218,10 +218,10 @@ service WorkflowService { // indicates whether cancellation has been requested for the activity. rpc RecordActivityTaskHeartbeat (RecordActivityTaskHeartbeatRequest) returns (RecordActivityTaskHeartbeatResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/heartbeat" + post: "/namespaces/{namespace}/activity-heartbeat" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/heartbeat" + post: "/api/v1/namespaces/{namespace}/activity-heartbeat" body: "*" } }; @@ -234,10 +234,21 @@ service WorkflowService { // aip.dev/not-precedent: "By" is used to indicate request type. --) rpc RecordActivityTaskHeartbeatById (RecordActivityTaskHeartbeatByIdRequest) returns (RecordActivityTaskHeartbeatByIdResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/heartbeat-by-id" + // Standalone + post: "/namespaces/{namespace}/activities/{activity_id}/heartbeat" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/heartbeat-by-id" + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/heartbeat" + body: "*" + } + + // Workflow + additional_bindings { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/heartbeat" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/heartbeat" body: "*" } }; @@ -251,10 +262,10 @@ service WorkflowService { // no longer valid due to activity timeout, already being completed, or never having existed. rpc RespondActivityTaskCompleted (RespondActivityTaskCompletedRequest) returns (RespondActivityTaskCompletedResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/complete" + post: "/namespaces/{namespace}/activity-complete" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/complete" + post: "/api/v1/namespaces/{namespace}/activity-complete" body: "*" } }; @@ -267,10 +278,21 @@ service WorkflowService { // aip.dev/not-precedent: "By" is used to indicate request type. --) rpc RespondActivityTaskCompletedById (RespondActivityTaskCompletedByIdRequest) returns (RespondActivityTaskCompletedByIdResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/complete-by-id" + // Standalone + post: "/namespaces/{namespace}/activities/{activity_id}/complete" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/complete-by-id" + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/complete" + body: "*" + } + + // Workflow + additional_bindings { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/complete" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/complete" body: "*" } }; @@ -283,10 +305,10 @@ service WorkflowService { // longer valid due to activity timeout, already being completed, or never having existed. rpc RespondActivityTaskFailed (RespondActivityTaskFailedRequest) returns (RespondActivityTaskFailedResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/fail" + post: "/namespaces/{namespace}/activity-fail" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/fail" + post: "/api/v1/namespaces/{namespace}/activity-fail" body: "*" } }; @@ -299,10 +321,21 @@ service WorkflowService { // aip.dev/not-precedent: "By" is used to indicate request type. --) rpc RespondActivityTaskFailedById (RespondActivityTaskFailedByIdRequest) returns (RespondActivityTaskFailedByIdResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/fail-by-id" + // Standalone + post: "/namespaces/{namespace}/activities/{activity_id}/fail" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/fail-by-id" + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/fail" + body: "*" + } + + // Workflow + additional_bindings { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/fail" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/fail" body: "*" } }; @@ -315,10 +348,10 @@ service WorkflowService { // no longer valid due to activity timeout, already being completed, or never having existed. rpc RespondActivityTaskCanceled (RespondActivityTaskCanceledRequest) returns (RespondActivityTaskCanceledResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/cancel" + post: "/namespaces/{namespace}/activity-resolve-as-canceled" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/cancel" + post: "/api/v1/namespaces/{namespace}/activity-resolve-as-canceled" body: "*" } }; @@ -331,10 +364,21 @@ service WorkflowService { // aip.dev/not-precedent: "By" is used to indicate request type. --) rpc RespondActivityTaskCanceledById (RespondActivityTaskCanceledByIdRequest) returns (RespondActivityTaskCanceledByIdResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/cancel-by-id" + // Standalone + post: "/namespaces/{namespace}/activities/{activity_id}/resolve-as-canceled" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/cancel-by-id" + post: "/api/v1/namespaces/{namespace}/activities/{activity_id}/resolve-as-canceled" + body: "*" + } + + // Workflow + additional_bindings { + post: "/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/resolve-as-canceled" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities/{activity_id}/resolve-as-canceled" body: "*" } }; @@ -1045,10 +1089,10 @@ service WorkflowService { // structured to work well for standalone activities. rpc UpdateActivityOptions (UpdateActivityOptionsRequest) returns (UpdateActivityOptionsResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/update-options" + post: "/namespaces/{namespace}/activities-deprecated/update-options" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/update-options" + post: "/api/v1/namespaces/{namespace}/activities-deprecated/update-options" body: "*" } }; @@ -1086,10 +1130,10 @@ service WorkflowService { // structured to work well for standalone activities. rpc PauseActivity (PauseActivityRequest) returns (PauseActivityResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/pause" + post: "/namespaces/{namespace}/activities-deprecated/pause" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/pause" + post: "/api/v1/namespaces/{namespace}/activities-deprecated/pause" body: "*" } }; @@ -1112,10 +1156,10 @@ service WorkflowService { // structured to work well for standalone activities. rpc UnpauseActivity (UnpauseActivityRequest) returns (UnpauseActivityResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/unpause" + post: "/namespaces/{namespace}/activities-deprecated/unpause" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/unpause" + post: "/api/v1/namespaces/{namespace}/activities-deprecated/unpause" body: "*" } }; @@ -1142,10 +1186,10 @@ service WorkflowService { // structured to work well for standalone activities. rpc ResetActivity (ResetActivityRequest) returns (ResetActivityResponse) { option (google.api.http) = { - post: "/namespaces/{namespace}/activities/reset" + post: "/namespaces/{namespace}/activities-deprecated/reset" body: "*" additional_bindings { - post: "/api/v1/namespaces/{namespace}/activities/reset" + post: "/api/v1/namespaces/{namespace}/activities-deprecated/reset" body: "*" } };