diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 97d10fb8e..ffcf5104e 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -11967,6 +11967,10 @@ "deploymentOptions": { "$ref": "#/definitions/v1WorkerDeploymentOptions", "description": "Worker deployment options that user has set in the worker." + }, + "cause": { + "$ref": "#/definitions/v1ActivityTaskFailedCause", + "description": "Why did the task fail? When unset, the failure is treated as an unspecified activity failure." } } }, @@ -11992,6 +11996,10 @@ "resourceId": { "type": "string", "description": "Resource ID for routing. Contains \"workflow:workflow_id\" or \"activity:activity_id\" for standalone activities." + }, + "cause": { + "$ref": "#/definitions/v1ActivityTaskFailedCause", + "description": "Why did the activity task fail? Optional; when unset the failure is treated as a normal\nactivity failure. See the type's doc for more." } } }, @@ -13752,6 +13760,17 @@ } } }, + "v1ActivityTaskFailedCause": { + "type": "string", + "enum": [ + "ACTIVITY_TASK_FAILED_CAUSE_UNSPECIFIED", + "ACTIVITY_TASK_FAILED_CAUSE_GRPC_MESSAGE_TOO_LARGE", + "ACTIVITY_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE", + "ACTIVITY_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE" + ], + "default": "ACTIVITY_TASK_FAILED_CAUSE_UNSPECIFIED", + "description": "Activity tasks can fail for various reasons. Note that some of these reasons can only originate\nfrom the server, and some of them can only originate from the SDK/worker.\n\n - ACTIVITY_TASK_FAILED_CAUSE_GRPC_MESSAGE_TOO_LARGE: An activity task failed because a grpc message was too large.\n - ACTIVITY_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE: An activity task failed because payloads were too large.\n - ACTIVITY_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE: An activity task failed because an external storage operation failed.\nCheck the activity task failure message for more information." + }, "v1ActivityTaskFailedEventAttributes": { "type": "object", "properties": { @@ -13779,6 +13798,10 @@ "workerVersion": { "$ref": "#/definitions/v1WorkerVersionStamp", "title": "Version info of the worker who processed this workflow task.\nDeprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]" + }, + "cause": { + "$ref": "#/definitions/v1ActivityTaskFailedCause", + "description": "Why did the task fail? When unset, the failure is treated as an unspecified activity failure." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 8f209c6ff..163a73db9 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -10101,6 +10101,15 @@ components: description: |- Version info of the worker who processed this workflow task. Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv] + cause: + enum: + - ACTIVITY_TASK_FAILED_CAUSE_UNSPECIFIED + - ACTIVITY_TASK_FAILED_CAUSE_GRPC_MESSAGE_TOO_LARGE + - ACTIVITY_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE + - ACTIVITY_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE + type: string + description: Why did the task fail? When unset, the failure is treated as an unspecified activity failure. + format: enum ActivityTaskScheduledEventAttributes: type: object properties: @@ -15456,6 +15465,17 @@ components: resourceId: type: string description: Resource ID for routing. Contains "workflow:workflow_id" or "activity:activity_id" for standalone activities. + cause: + enum: + - ACTIVITY_TASK_FAILED_CAUSE_UNSPECIFIED + - ACTIVITY_TASK_FAILED_CAUSE_GRPC_MESSAGE_TOO_LARGE + - ACTIVITY_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE + - ACTIVITY_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE + type: string + description: |- + Why did the activity task fail? Optional; when unset the failure is treated as a normal + activity failure. See the type's doc for more. + format: enum RespondActivityTaskFailedByIdResponse: type: object properties: @@ -15508,6 +15528,15 @@ components: allOf: - $ref: '#/components/schemas/WorkerDeploymentOptions' description: Worker deployment options that user has set in the worker. + cause: + enum: + - ACTIVITY_TASK_FAILED_CAUSE_UNSPECIFIED + - ACTIVITY_TASK_FAILED_CAUSE_GRPC_MESSAGE_TOO_LARGE + - ACTIVITY_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE + - ACTIVITY_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE + type: string + description: Why did the task fail? When unset, the failure is treated as an unspecified activity failure. + format: enum RespondActivityTaskFailedResponse: type: object properties: diff --git a/temporal/api/enums/v1/failed_cause.proto b/temporal/api/enums/v1/failed_cause.proto index 6b3eedfce..8f0cdca5d 100644 --- a/temporal/api/enums/v1/failed_cause.proto +++ b/temporal/api/enums/v1/failed_cause.proto @@ -85,6 +85,19 @@ enum WorkflowTaskFailedCause { WORKFLOW_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE = 37; } +// Activity tasks can fail for various reasons. Note that some of these reasons can only originate +// from the server, and some of them can only originate from the SDK/worker. +enum ActivityTaskFailedCause { + ACTIVITY_TASK_FAILED_CAUSE_UNSPECIFIED = 0; + // An activity task failed because a grpc message was too large. + ACTIVITY_TASK_FAILED_CAUSE_GRPC_MESSAGE_TOO_LARGE = 1; + // An activity task failed because payloads were too large. + ACTIVITY_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE = 2; + // An activity task failed because an external storage operation failed. + // Check the activity task failure message for more information. + ACTIVITY_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE = 3; +} + enum StartChildWorkflowExecutionFailedCause { START_CHILD_WORKFLOW_EXECUTION_FAILED_CAUSE_UNSPECIFIED = 0; START_CHILD_WORKFLOW_EXECUTION_FAILED_CAUSE_WORKFLOW_ALREADY_EXISTS = 1; diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index 2fdb678bc..8af0c42ed 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -517,6 +517,8 @@ message ActivityTaskFailedEventAttributes { // Version info of the worker who processed this workflow task. // Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv] temporal.api.common.v1.WorkerVersionStamp worker_version = 6 [deprecated = true]; + // Why did the task fail? When unset, the failure is treated as an unspecified activity failure. + temporal.api.enums.v1.ActivityTaskFailedCause cause = 7; } message ActivityTaskTimedOutEventAttributes { diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 263c3c8a0..7882bced8 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -702,6 +702,8 @@ message RespondActivityTaskFailedRequest { temporal.api.deployment.v1.Deployment deployment = 7 [deprecated = true]; // Worker deployment options that user has set in the worker. temporal.api.deployment.v1.WorkerDeploymentOptions deployment_options = 8; + // Why did the task fail? When unset, the failure is treated as an unspecified activity failure. + temporal.api.enums.v1.ActivityTaskFailedCause cause = 10; } message RespondActivityTaskFailedResponse { @@ -728,6 +730,9 @@ message RespondActivityTaskFailedByIdRequest { temporal.api.common.v1.Payloads last_heartbeat_details = 7; // Resource ID for routing. Contains "workflow:workflow_id" or "activity:activity_id" for standalone activities. string resource_id = 8; + // Why did the activity task fail? Optional; when unset the failure is treated as a normal + // activity failure. See the type's doc for more. + temporal.api.enums.v1.ActivityTaskFailedCause cause = 9; } message RespondActivityTaskFailedByIdResponse {