From a653c87635ec6b9ba456f412872c4e56ee3c7380 Mon Sep 17 00:00:00 2001 From: Shivam Saraf Date: Thu, 19 Feb 2026 14:57:12 -0500 Subject: [PATCH 1/3] initial --- openapi/openapiv2.json | 4 ++++ openapi/openapiv3.yaml | 14 ++++++++++++++ temporal/api/workflow/v1/message.proto | 11 +++++++++++ 3 files changed, 29 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 2f21bedcc..d8378dda3 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -17808,6 +17808,10 @@ "type": "string", "format": "int64", "description": "Monotonic counter reflecting the latest routing decision for this workflow execution.\nUsed for staleness detection between history and matching when dispatching tasks to workers.\nIncremented when a workflow execution routes to a new deployment version, which happens\nwhen a worker of the new deployment version completes a workflow task.\nNote: Pinned tasks and sticky tasks send a value of 0 for this field since these tasks do not\nface the problem of inconsistent dispatching that arises from eventual consistency between\ntask queues and their partitions." + }, + "targetVersionOnStart": { + "$ref": "#/definitions/v1WorkerDeploymentVersion", + "description": "The target deployment version (from the task queue's routing config) observed on the\nvery first workflow task of this run. On each subsequent workflow task, this value is\ncompared against the current target deployment version, which is fetched from the task queue's routing config,\nto compute the `target_worker_deployment_version_changed` flag in WorkflowTaskStartedEvent. That\nflag signals pinned workflows that the task queue's current deployment version has\nchanged, allowing them to continue-as-new onto the latest version. Without this\nanchor, the comparison falls back to the workflow's effective deployment, which for\npinned workflows permanently differs from the routing target after a version change,\ncausing the flag to stay true indefinitely and triggering infinite continue-as-new\nloops." } }, "description": "Holds all the information about worker versioning for a particular workflow execution.\nExperimental. Versioning info is experimental and might change in the future." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index c220f6773..9a337224a 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -16658,6 +16658,20 @@ components: Note: Pinned tasks and sticky tasks send a value of 0 for this field since these tasks do not face the problem of inconsistent dispatching that arises from eventual consistency between task queues and their partitions. + targetVersionOnStart: + allOf: + - $ref: '#/components/schemas/WorkerDeploymentVersion' + description: |- + The target deployment version (from the task queue's routing config) observed on the + very first workflow task of this run. On each subsequent workflow task, this value is + compared against the current target deployment version, which is fetched from the task queue's routing config, + to compute the `target_worker_deployment_version_changed` flag in WorkflowTaskStartedEvent. That + flag signals pinned workflows that the task queue's current deployment version has + changed, allowing them to continue-as-new onto the latest version. Without this + anchor, the comparison falls back to the workflow's effective deployment, which for + pinned workflows permanently differs from the routing target after a version change, + causing the flag to stay true indefinitely and triggering infinite continue-as-new + loops. description: |- Holds all the information about worker versioning for a particular workflow execution. Experimental. Versioning info is experimental and might change in the future. diff --git a/temporal/api/workflow/v1/message.proto b/temporal/api/workflow/v1/message.proto index 40753b2ce..aea7c4e82 100644 --- a/temporal/api/workflow/v1/message.proto +++ b/temporal/api/workflow/v1/message.proto @@ -232,6 +232,17 @@ message WorkflowExecutionVersioningInfo { // face the problem of inconsistent dispatching that arises from eventual consistency between // task queues and their partitions. int64 revision_number = 8; + // The target deployment version (from the task queue's routing config) observed on the + // very first workflow task of this run. On each subsequent workflow task, this value is + // compared against the current target deployment version, which is fetched from the task queue's routing config, + // to compute the `target_worker_deployment_version_changed` flag in WorkflowTaskStartedEvent. That + // flag signals pinned workflows that the task queue's current deployment version has + // changed, allowing them to continue-as-new onto the latest version. Without this + // anchor, the comparison falls back to the workflow's effective deployment, which for + // pinned workflows permanently differs from the routing target after a version change, + // causing the flag to stay true indefinitely and triggering infinite continue-as-new + // loops. + temporal.api.deployment.v1.WorkerDeploymentVersion target_version_on_start = 9; } // Holds information about ongoing transition of a workflow execution from one deployment to another. From a9c58d5aa78a2991d275de9a04340251497a5655 Mon Sep 17 00:00:00 2001 From: Shivam Saraf Date: Fri, 20 Feb 2026 09:55:11 -0500 Subject: [PATCH 2/3] adding the field to the event so that reconstruction is possible --- openapi/openapiv2.json | 4 ++++ openapi/openapiv3.yaml | 8 ++++++++ temporal/api/history/v1/message.proto | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index d8378dda3..0d5acd121 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -18183,6 +18183,10 @@ "type": "boolean", "description": "True if Workflow's Target Worker Deployment Version is different from its Pinned Version and\nthe workflow is Pinned.\nExperimental." }, + "targetWorkerDeploymentVersionOnStart": { + "$ref": "#/definitions/v1WorkerDeploymentVersion", + "description": "The target Worker Deployment Version (from the task queue's routing config) observed on the\nvery first workflow task of this run. On each subsequent workflow task, this value is\ncompared against the current target deployment version, which is fetched from the task queue's routing config,\nto compute the `target_worker_deployment_version_changed` flag in WorkflowTaskStartedEvent." + }, "historySizeBytes": { "type": "string", "format": "int64", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 9a337224a..59317b662 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -17084,6 +17084,14 @@ components: True if Workflow's Target Worker Deployment Version is different from its Pinned Version and the workflow is Pinned. Experimental. + targetWorkerDeploymentVersionOnStart: + allOf: + - $ref: '#/components/schemas/WorkerDeploymentVersion' + description: |- + The target Worker Deployment Version (from the task queue's routing config) observed on the + very first workflow task of this run. On each subsequent workflow task, this value is + compared against the current target deployment version, which is fetched from the task queue's routing config, + to compute the `target_worker_deployment_version_changed` flag in WorkflowTaskStartedEvent. historySizeBytes: type: string description: |- diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index 2fb99f7e9..d893c27a6 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -284,6 +284,11 @@ message WorkflowTaskStartedEventAttributes { // the workflow is Pinned. // Experimental. bool target_worker_deployment_version_changed = 9; + // The target Worker Deployment Version (from the task queue's routing config) observed on the + // very first workflow task of this run. On each subsequent workflow task, this value is + // compared against the current target deployment version, which is fetched from the task queue's routing config, + // to compute the `target_worker_deployment_version_changed` flag in WorkflowTaskStartedEvent. + temporal.api.deployment.v1.WorkerDeploymentVersion target_worker_deployment_version_on_start = 10; // Total history size in bytes, which the workflow might use to decide when to // continue-as-new regardless of the suggestion. Note that history event count is // just the event id of this event, so we don't include it explicitly here. From c8f83fee85f54367bb87ac6c55d287f8f8ede4ba Mon Sep 17 00:00:00 2001 From: Shivam Saraf Date: Fri, 20 Feb 2026 10:04:38 -0500 Subject: [PATCH 3/3] some cleanup --- openapi/openapiv2.json | 4 ++-- openapi/openapiv3.yaml | 4 ++-- temporal/api/workflow/v1/message.proto | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 0d5acd121..8ca27d583 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -17809,9 +17809,9 @@ "format": "int64", "description": "Monotonic counter reflecting the latest routing decision for this workflow execution.\nUsed for staleness detection between history and matching when dispatching tasks to workers.\nIncremented when a workflow execution routes to a new deployment version, which happens\nwhen a worker of the new deployment version completes a workflow task.\nNote: Pinned tasks and sticky tasks send a value of 0 for this field since these tasks do not\nface the problem of inconsistent dispatching that arises from eventual consistency between\ntask queues and their partitions." }, - "targetVersionOnStart": { + "targetWorkerDeploymentVersionOnStart": { "$ref": "#/definitions/v1WorkerDeploymentVersion", - "description": "The target deployment version (from the task queue's routing config) observed on the\nvery first workflow task of this run. On each subsequent workflow task, this value is\ncompared against the current target deployment version, which is fetched from the task queue's routing config,\nto compute the `target_worker_deployment_version_changed` flag in WorkflowTaskStartedEvent. That\nflag signals pinned workflows that the task queue's current deployment version has\nchanged, allowing them to continue-as-new onto the latest version. Without this\nanchor, the comparison falls back to the workflow's effective deployment, which for\npinned workflows permanently differs from the routing target after a version change,\ncausing the flag to stay true indefinitely and triggering infinite continue-as-new\nloops." + "description": "The target Worker Deployment Version (from the task queue's routing config) observed on the\nvery first workflow task of this run. On each subsequent workflow task, this value is\ncompared against the current target deployment version, which is fetched from the task queue's routing config,\nto compute the `target_worker_deployment_version_changed` flag in WorkflowTaskStartedEvent. That\nflag signals pinned workflows that the task queue's current deployment version has\nchanged, allowing them to continue-as-new onto the latest version. Without this\nanchor, the comparison falls back to the workflow's effective deployment, which for\npinned workflows permanently differs from the routing target after a version change,\ncausing the flag to stay true indefinitely and triggering infinite continue-as-new\nloops." } }, "description": "Holds all the information about worker versioning for a particular workflow execution.\nExperimental. Versioning info is experimental and might change in the future." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 59317b662..4ebcd726e 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -16658,11 +16658,11 @@ components: Note: Pinned tasks and sticky tasks send a value of 0 for this field since these tasks do not face the problem of inconsistent dispatching that arises from eventual consistency between task queues and their partitions. - targetVersionOnStart: + targetWorkerDeploymentVersionOnStart: allOf: - $ref: '#/components/schemas/WorkerDeploymentVersion' description: |- - The target deployment version (from the task queue's routing config) observed on the + The target Worker Deployment Version (from the task queue's routing config) observed on the very first workflow task of this run. On each subsequent workflow task, this value is compared against the current target deployment version, which is fetched from the task queue's routing config, to compute the `target_worker_deployment_version_changed` flag in WorkflowTaskStartedEvent. That diff --git a/temporal/api/workflow/v1/message.proto b/temporal/api/workflow/v1/message.proto index aea7c4e82..ccb2a394c 100644 --- a/temporal/api/workflow/v1/message.proto +++ b/temporal/api/workflow/v1/message.proto @@ -232,7 +232,7 @@ message WorkflowExecutionVersioningInfo { // face the problem of inconsistent dispatching that arises from eventual consistency between // task queues and their partitions. int64 revision_number = 8; - // The target deployment version (from the task queue's routing config) observed on the + // The target Worker Deployment Version (from the task queue's routing config) observed on the // very first workflow task of this run. On each subsequent workflow task, this value is // compared against the current target deployment version, which is fetched from the task queue's routing config, // to compute the `target_worker_deployment_version_changed` flag in WorkflowTaskStartedEvent. That @@ -242,7 +242,7 @@ message WorkflowExecutionVersioningInfo { // pinned workflows permanently differs from the routing target after a version change, // causing the flag to stay true indefinitely and triggering infinite continue-as-new // loops. - temporal.api.deployment.v1.WorkerDeploymentVersion target_version_on_start = 9; + temporal.api.deployment.v1.WorkerDeploymentVersion target_worker_deployment_version_on_start = 9; } // Holds information about ongoing transition of a workflow execution from one deployment to another.