diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 1437120e5..1ea891029 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -12225,6 +12225,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." } } }, @@ -12250,6 +12254,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." } } }, @@ -14046,6 +14054,17 @@ } } }, + "v1ActivityTaskFailedCause": { + "type": "string", + "enum": [ + "ACTIVITY_TASK_FAILED_CAUSE_UNSPECIFIED", + "ACTIVITY_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE", + "ACTIVITY_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE", + "ACTIVITY_TASK_FAILED_CAUSE_ACTIVITY_WORKER_UNHANDLED_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_PAYLOADS_TOO_LARGE: A payload-bearing field on a request the worker sent for this activity task exceeded the\nper-field size limit configured on the server for the namespace.\nCheck the activity task failure message for more information.\n - ACTIVITY_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE: The worker failed to offload a payload to, or retrieve one from, external storage while\nprocessing this activity task.\nCheck the activity task failure message for more information.\n - ACTIVITY_TASK_FAILED_CAUSE_ACTIVITY_WORKER_UNHANDLED_FAILURE: The default cause for an activity task failure reported by a worker; a more specific cause\ntakes precedence whenever the condition is recognized.\nCheck the activity task failure message for more information." + }, "v1ActivityTaskFailedEventAttributes": { "type": "object", "properties": { @@ -14073,6 +14092,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 007d77168..ba2bf2efc 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -10227,6 +10227,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_PAYLOADS_TOO_LARGE + - ACTIVITY_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE + - ACTIVITY_TASK_FAILED_CAUSE_ACTIVITY_WORKER_UNHANDLED_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: @@ -15917,6 +15926,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_PAYLOADS_TOO_LARGE + - ACTIVITY_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE + - ACTIVITY_TASK_FAILED_CAUSE_ACTIVITY_WORKER_UNHANDLED_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: @@ -15969,6 +15989,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_PAYLOADS_TOO_LARGE + - ACTIVITY_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE + - ACTIVITY_TASK_FAILED_CAUSE_ACTIVITY_WORKER_UNHANDLED_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 f8809fd4e..c96de00db 100644 --- a/temporal/api/enums/v1/failed_cause.proto +++ b/temporal/api/enums/v1/failed_cause.proto @@ -92,6 +92,24 @@ enum WorkflowTaskFailedCause { WORKFLOW_TASK_FAILED_CAUSE_REQUEST_TOO_LARGE = 40; } +// 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; + // A payload-bearing field on a request the worker sent for this activity task exceeded the + // per-field size limit configured on the server for the namespace. + // Check the activity task failure message for more information. + ACTIVITY_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE = 1; + // The worker failed to offload a payload to, or retrieve one from, external storage while + // processing this activity task. + // Check the activity task failure message for more information. + ACTIVITY_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE = 2; + // The default cause for an activity task failure reported by a worker; a more specific cause + // takes precedence whenever the condition is recognized. + // Check the activity task failure message for more information. + ACTIVITY_TASK_FAILED_CAUSE_ACTIVITY_WORKER_UNHANDLED_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 0211c6f55..b40324d68 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 c3dd95769..de1c271cd 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -739,6 +739,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 { @@ -765,6 +767,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 {