From c9726cbe7e2115f9078c2b2892fd74405eb82abc Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Tue, 17 Mar 2026 10:32:05 -0700 Subject: [PATCH 1/3] Add shutdown_worker_rejected field to poll responses Add a bool field to PollWorkflowTaskQueueResponse, PollActivityTaskQueueResponse, and PollNexusTaskQueueResponse to indicate when an empty poll response was caused by the server rejecting the poll because the worker has been shut down via the ShutdownWorker API. Made-with: Cursor --- openapi/openapiv2.json | 4 ++++ openapi/openapiv3.yaml | 6 ++++++ .../api/workflowservice/v1/request_response.proto | 12 ++++++++++++ 3 files changed, 22 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index ced099f3d..607d0e3e4 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -14580,6 +14580,10 @@ "pollerScalingDecision": { "$ref": "#/definitions/v1PollerScalingDecision", "description": "Server-advised information the SDK may use to adjust its poller count." + }, + "shutdownWorkerRejected": { + "type": "boolean", + "description": "When true, this empty response was caused by the server rejecting the poll\nbecause the worker has been shut down via the ShutdownWorker API. The SDK\nshould stop polling on this task queue." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 364793f13..0cfd9530d 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -11640,6 +11640,12 @@ components: allOf: - $ref: '#/components/schemas/PollerScalingDecision' description: Server-advised information the SDK may use to adjust its poller count. + shutdownWorkerRejected: + type: boolean + description: |- + When true, this empty response was caused by the server rejecting the poll + because the worker has been shut down via the ShutdownWorker API. The SDK + should stop polling on this task queue. PollerInfo: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 2d9dd7b83..bfa804965 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -331,6 +331,10 @@ message PollWorkflowTaskQueueResponse { repeated temporal.api.protocol.v1.Message messages = 15; // Server-advised information the SDK may use to adjust its poller count. temporal.api.taskqueue.v1.PollerScalingDecision poller_scaling_decision = 16; + // When true, this empty response was caused by the server rejecting the poll + // because the worker has been shut down via the ShutdownWorker API. The SDK + // should stop polling on this task queue. + bool shutdown_worker_rejected = 17; } message RespondWorkflowTaskCompletedRequest { @@ -516,6 +520,10 @@ message PollActivityTaskQueueResponse { temporal.api.common.v1.Priority priority = 19; // The run ID of the activity execution, only set for standalone activities. string activity_run_id = 20; + // When true, this empty response was caused by the server rejecting the poll + // because the worker has been shut down via the ShutdownWorker API. The SDK + // should stop polling on this task queue. + bool shutdown_worker_rejected = 21; } message RecordActivityTaskHeartbeatRequest { @@ -1892,6 +1900,10 @@ message PollNexusTaskQueueResponse { temporal.api.nexus.v1.Request request = 2; // Server-advised information the SDK may use to adjust its poller count. temporal.api.taskqueue.v1.PollerScalingDecision poller_scaling_decision = 3; + // When true, this empty response was caused by the server rejecting the poll + // because the worker has been shut down via the ShutdownWorker API. The SDK + // should stop polling on this task queue. + bool shutdown_worker_rejected = 4; } message RespondNexusTaskCompletedRequest { From 4fca1640091a7dbe0fc0b2ec1c4bdfb8d6bc3963 Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Fri, 10 Apr 2026 15:57:39 -0700 Subject: [PATCH 2/3] Rename shutdown_worker_rejected to completed_by_worker_shutdown Aligns the field name with the ShutdownWorker capability name and removes ambiguity from the old name. Co-Authored-By: Claude Opus 4.6 --- .../workflowservice/v1/request_response.proto | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index c75d7c008..ceff6166f 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -338,10 +338,13 @@ message PollWorkflowTaskQueueResponse { repeated temporal.api.protocol.v1.Message messages = 15; // Server-advised information the SDK may use to adjust its poller count. temporal.api.taskqueue.v1.PollerScalingDecision poller_scaling_decision = 16; - // When true, this empty response was caused by the server rejecting the poll + // When true, this empty response was caused by the server completing the poll // because the worker has been shut down via the ShutdownWorker API. The SDK // should stop polling on this task queue. - bool shutdown_worker_rejected = 17; + // + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "by" describes the cause of poll completion. --) + bool completed_by_worker_shutdown = 17; } message RespondWorkflowTaskCompletedRequest { @@ -540,10 +543,13 @@ message PollActivityTaskQueueResponse { temporal.api.common.v1.Priority priority = 19; // The run ID of the activity execution, only set for standalone activities. string activity_run_id = 20; - // When true, this empty response was caused by the server rejecting the poll + // When true, this empty response was caused by the server completing the poll // because the worker has been shut down via the ShutdownWorker API. The SDK // should stop polling on this task queue. - bool shutdown_worker_rejected = 21; + // + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "by" describes the cause of poll completion. --) + bool completed_by_worker_shutdown = 21; } message RecordActivityTaskHeartbeatRequest { @@ -1931,10 +1937,13 @@ message PollNexusTaskQueueResponse { temporal.api.nexus.v1.Request request = 2; // Server-advised information the SDK may use to adjust its poller count. temporal.api.taskqueue.v1.PollerScalingDecision poller_scaling_decision = 3; - // When true, this empty response was caused by the server rejecting the poll + // When true, this empty response was caused by the server completing the poll // because the worker has been shut down via the ShutdownWorker API. The SDK // should stop polling on this task queue. - bool shutdown_worker_rejected = 4; + // + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "by" describes the cause of poll completion. --) + bool completed_by_worker_shutdown = 4; } message RespondNexusTaskCompletedRequest { From d3b45e985974737f1fbc5ca8e1ab79f97d88bcbe Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Fri, 10 Apr 2026 15:57:39 -0700 Subject: [PATCH 3/3] Regenerate openapi specs Co-Authored-By: Claude Opus 4.6 --- openapi/openapiv2.json | 4 ++-- openapi/openapiv3.yaml | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 3e764a6a5..494e42587 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -15356,9 +15356,9 @@ "$ref": "#/definitions/v1PollerScalingDecision", "description": "Server-advised information the SDK may use to adjust its poller count." }, - "shutdownWorkerRejected": { + "completedByWorkerShutdown": { "type": "boolean", - "description": "When true, this empty response was caused by the server rejecting the poll\nbecause the worker has been shut down via the ShutdownWorker API. The SDK\nshould stop polling on this task queue." + "description": "When true, this empty response was caused by the server completing the poll\nbecause the worker has been shut down via the ShutdownWorker API. The SDK\nshould stop polling on this task queue.\n" } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index f7fdb1be8..823bcc1f4 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -12220,12 +12220,15 @@ components: allOf: - $ref: '#/components/schemas/PollerScalingDecision' description: Server-advised information the SDK may use to adjust its poller count. - shutdownWorkerRejected: + completedByWorkerShutdown: type: boolean description: |- - When true, this empty response was caused by the server rejecting the poll + When true, this empty response was caused by the server completing the poll because the worker has been shut down via the ShutdownWorker API. The SDK should stop polling on this task queue. + + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "by" describes the cause of poll completion. --) PollerInfo: type: object properties: