diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 08db7afbf..f8e62b4f3 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -16639,6 +16639,10 @@ "workflowUpdateCallbacks": { "type": "boolean", "title": "True if the namespace supports attaching callbacks on workflow updates" + }, + "workflowTaskCompletionPagination": { + "type": "boolean", + "description": "True if the namespace supports paginated workflow task completion, i.e.\n`RespondWorkflowTaskCompleted` requests split across multiple pages. SDKs must check this\ncapability before sending a request with `intermediate_page` set to true." } }, "description": "Namespace capability details. Should contain what features are enabled in a namespace." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index bd6bb404c..7d86e919f 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -13057,6 +13057,12 @@ components: workflowUpdateCallbacks: type: boolean description: True if the namespace supports attaching callbacks on workflow updates + workflowTaskCompletionPagination: + type: boolean + description: |- + True if the namespace supports paginated workflow task completion, i.e. + `RespondWorkflowTaskCompleted` requests split across multiple pages. SDKs must check this + capability before sending a request with `intermediate_page` set to true. description: Namespace capability details. Should contain what features are enabled in a namespace. NamespaceInfo_Limits: type: object diff --git a/temporal/api/errordetails/v1/message.proto b/temporal/api/errordetails/v1/message.proto index 2abb60db6..d2ae7c32d 100644 --- a/temporal/api/errordetails/v1/message.proto +++ b/temporal/api/errordetails/v1/message.proto @@ -137,3 +137,9 @@ message NexusOperationExecutionAlreadyStartedFailure { string start_request_id = 1; string run_id = 2; } + +// An error indicating that the server lost the buffered pages of a paginated workflow task +// completion. This is a transient error: the workflow task is still valid, and the client +// should resend all pages from page 0 using the same task token. +message WorkflowTaskCompletionBufferLostFailure { +} diff --git a/temporal/api/namespace/v1/message.proto b/temporal/api/namespace/v1/message.proto index 4b722147d..ee0c0418d 100644 --- a/temporal/api/namespace/v1/message.proto +++ b/temporal/api/namespace/v1/message.proto @@ -56,6 +56,10 @@ message NamespaceInfo { bool standalone_nexus_operation = 11; // True if the namespace supports attaching callbacks on workflow updates bool workflow_update_callbacks = 12; + // True if the namespace supports paginated workflow task completion, i.e. + // `RespondWorkflowTaskCompleted` requests split across multiple pages. SDKs must check this + // capability before sending a request with `intermediate_page` set to true. + bool workflow_task_completion_pagination = 13; } // Namespace configured limits diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 01ab68159..91471b0d0 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -424,6 +424,16 @@ message RespondWorkflowTaskCompletedRequest { // tasks (e.g. activity cancellation) to this specific worker instance. string worker_control_task_queue = 20; + // 0-indexed page number when the workflow task completion is split across multiple + // requests ("pages"). 0 for single-page requests. May only be set to non-zero value + // when the namespace capability workflow_task_completion_pagination is true. + int32 page_number = 21; + + // True for non-final pages of a paginated workflow task completion. The final page's + // `page_number` tells the server how many intermediate pages (0..page_number-1) preceded it. + // May only be used when the namespace capability workflow_task_completion_pagination is true. + bool intermediate_page = 22; + // SDK capability details. message Capabilities { // True if the SDK can handle speculative workflow task with command events. If true, the