diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index ddbc48c61..9490580bc 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -14588,6 +14588,10 @@ "pollerScalingDecision": { "$ref": "#/definitions/v1PollerScalingDecision", "description": "Server-advised information the SDK may use to adjust its poller count." + }, + "pollerGroupId": { + "type": "string", + "description": "This poller group ID identifies the owner of the workflow task." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index cd503dccd..f9fc7d2fc 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -11647,6 +11647,9 @@ components: allOf: - $ref: '#/components/schemas/PollerScalingDecision' description: Server-advised information the SDK may use to adjust its poller count. + pollerGroupId: + type: string + description: This poller group ID identifies the owner of the workflow task. PollerInfo: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 2d9dd7b83..08c0a3dfa 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -331,6 +331,8 @@ 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; + // This poller group ID identifies the owner of the workflow task. + string poller_group_id = 17; } message RespondWorkflowTaskCompletedRequest { @@ -1028,6 +1030,9 @@ message RespondQueryTaskCompletedRequest { // Why did the task fail? It's important to note that many of the variants in this enum cannot // apply to worker responses. See the type's doc for more. temporal.api.enums.v1.WorkflowTaskFailedCause cause = 8; + // This poller group ID identifies the owner of the query task. + // This Id should be set in the request header. + string poller_group_id = 9; } message RespondQueryTaskCompletedResponse { @@ -1892,6 +1897,9 @@ 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; + // This poller group ID identifies the owner of the nexus task. + // This Id should be set in RespondNexusTaskCompletedRequest or RespondNexusTaskFailedRequest. + string poller_group_id = 4; } message RespondNexusTaskCompletedRequest { @@ -1902,6 +1910,9 @@ message RespondNexusTaskCompletedRequest { bytes task_token = 3; // Embedded response to be translated into a frontend response. temporal.api.nexus.v1.Response response = 4; + // This poller group ID identifies the owner of the nexus task. + // This Id should be set in the request header. + string poller_group_id = 5; } message RespondNexusTaskCompletedResponse { @@ -1917,6 +1928,9 @@ message RespondNexusTaskFailedRequest { temporal.api.nexus.v1.HandlerError error = 4 [deprecated = true]; // The error the handler failed with. Must contain a NexusHandlerFailureInfo object. temporal.api.failure.v1.Failure failure = 5; + // This poller group ID identifies the owner of the nexus task. + // This Id should be set in the request header. + string poller_group_id = 6; } message RespondNexusTaskFailedResponse { diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index cbd71e2ba..84214abdf 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -618,7 +618,12 @@ service WorkflowService { // // (-- api-linter: core::0127::http-annotation=disabled // aip.dev/not-precedent: We do not expose worker API to HTTP. --) - rpc RespondQueryTaskCompleted (RespondQueryTaskCompletedRequest) returns (RespondQueryTaskCompletedResponse) {} + rpc RespondQueryTaskCompleted (RespondQueryTaskCompletedRequest) returns (RespondQueryTaskCompletedResponse) { + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "poller:{poller_group_id}" + }; + } // ResetStickyTaskQueue resets the sticky task queue related information in the mutable state of // a given workflow. This is prudent for workers to perform if a workflow has been paged out of @@ -1246,12 +1251,20 @@ service WorkflowService { // (-- api-linter: core::0127::http-annotation=disabled // aip.dev/not-precedent: We do not expose worker API to HTTP. --) rpc RespondNexusTaskCompleted(RespondNexusTaskCompletedRequest) returns (RespondNexusTaskCompletedResponse) { + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "poller:{poller_group_id}" + }; } // RespondNexusTaskFailed is called by workers to fail Nexus tasks received via PollNexusTaskQueue. // (-- api-linter: core::0127::http-annotation=disabled // aip.dev/not-precedent: We do not expose worker API to HTTP. --) rpc RespondNexusTaskFailed(RespondNexusTaskFailedRequest) returns (RespondNexusTaskFailedResponse) { + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "poller:{poller_group_id}" + }; } // UpdateActivityOptions is called by the client to update the options of an activity by its ID or type.