From 34cd45cd633e6a89a291b765f2ad950f1e5d8c6a Mon Sep 17 00:00:00 2001 From: Austin Ward Date: Wed, 7 Jan 2026 22:35:14 -0500 Subject: [PATCH 1/4] Add reset options to the ResetWorkflowExecution rpc --- temporal/api/common/v1/message.proto | 5 +++++ temporal/api/workflowservice/v1/request_response.proto | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index aa5b3f370..6842b4d96 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -160,6 +160,11 @@ message ResetOptions { // Note that by default, this reset is allowed to be to a prior run in a chain of // continue-as-new. string build_id = 4; + // Resets to the last workflow task completed in the previous run before the current run + // was continued-as-new. This only works if the current workflow was continued from another + // workflow (has a continued_execution_run_id). If the workflow was not continued from + // another workflow, or the last workflow task can't be determined, no reset will be performed. + google.protobuf.Empty last_continued_as_new = 5; } // Deprecated. Use `options`. diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 18c27d854..6ea6fcf29 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -830,6 +830,10 @@ message ResetWorkflowExecutionRequest { repeated temporal.api.workflow.v1.PostResetOperation post_reset_operations = 8; // The identity of the worker/client string identity = 9; + // Describes where to reset to and how. If set, `workflow_task_finish_event_id` is ignored. + // This allows specifying reset targets like first/last workflow task, build ID, or last continued-as-new + // without needing to know the exact event ID. + temporal.api.common.v1.ResetOptions reset_options = 10; } message ResetWorkflowExecutionResponse { From edd0e26de485352c60556fa2861973b1396741ac Mon Sep 17 00:00:00 2001 From: Austin Ward Date: Wed, 7 Jan 2026 22:49:38 -0500 Subject: [PATCH 2/4] Remove last_continued_as_new, as the existing `last_workflow_task` covers that case --- openapi/openapiv2.json | 9 +++++++++ openapi/openapiv3.yaml | 7 +++++++ temporal/api/common/v1/message.proto | 5 ----- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 5fe09704e..530f4e89d 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -8936,6 +8936,10 @@ "identity": { "type": "string", "title": "The identity of the worker/client" + }, + "resetOptions": { + "$ref": "#/definitions/v1ResetOptions", + "description": "Describes where to reset to and how. If set, `workflow_task_finish_event_id` is ignored.\nThis allows specifying reset targets like first/last workflow task, build ID, or last continued-as-new\nwithout needing to know the exact event ID." } } }, @@ -14373,6 +14377,11 @@ "type": "string", "description": "Resets to the first workflow task processed by this build id.\nIf the workflow was not processed by the build id, or the workflow task can't be\ndetermined, no reset will be performed.\nNote that by default, this reset is allowed to be to a prior run in a chain of\ncontinue-as-new." }, + "lastContinuedAsNew": { + "type": "object", + "properties": {}, + "description": "Resets to the last workflow task completed in the previous run before the current run\nwas continued-as-new. This only works if the current workflow was continued from another\nworkflow (has a continued_execution_run_id). If the workflow was not continued from\nanother workflow, or the last workflow task can't be determined, no reset will be performed." + }, "resetReapplyType": { "$ref": "#/definitions/v1ResetReapplyType", "title": "Deprecated. Use `options`.\nDefault: RESET_REAPPLY_TYPE_SIGNAL" diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 51d896b69..7c9bc62c6 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -11898,6 +11898,13 @@ components: identity: type: string description: The identity of the worker/client + resetOptions: + allOf: + - $ref: '#/components/schemas/ResetOptions' + description: |- + Describes where to reset to and how. If set, `workflow_task_finish_event_id` is ignored. + This allows specifying reset targets like first/last workflow task, build ID, or last continued-as-new + without needing to know the exact event ID. ResetWorkflowExecutionResponse: type: object properties: diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index 6842b4d96..aa5b3f370 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -160,11 +160,6 @@ message ResetOptions { // Note that by default, this reset is allowed to be to a prior run in a chain of // continue-as-new. string build_id = 4; - // Resets to the last workflow task completed in the previous run before the current run - // was continued-as-new. This only works if the current workflow was continued from another - // workflow (has a continued_execution_run_id). If the workflow was not continued from - // another workflow, or the last workflow task can't be determined, no reset will be performed. - google.protobuf.Empty last_continued_as_new = 5; } // Deprecated. Use `options`. From 89ac3e3c102de6a1b41681d4d4eda6dfce45ae10 Mon Sep 17 00:00:00 2001 From: Austin Ward Date: Wed, 7 Jan 2026 22:53:58 -0500 Subject: [PATCH 3/4] Update generated files --- openapi/openapiv2.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 530f4e89d..ee6a735ad 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -14377,11 +14377,6 @@ "type": "string", "description": "Resets to the first workflow task processed by this build id.\nIf the workflow was not processed by the build id, or the workflow task can't be\ndetermined, no reset will be performed.\nNote that by default, this reset is allowed to be to a prior run in a chain of\ncontinue-as-new." }, - "lastContinuedAsNew": { - "type": "object", - "properties": {}, - "description": "Resets to the last workflow task completed in the previous run before the current run\nwas continued-as-new. This only works if the current workflow was continued from another\nworkflow (has a continued_execution_run_id). If the workflow was not continued from\nanother workflow, or the last workflow task can't be determined, no reset will be performed." - }, "resetReapplyType": { "$ref": "#/definitions/v1ResetReapplyType", "title": "Deprecated. Use `options`.\nDefault: RESET_REAPPLY_TYPE_SIGNAL" From b94191182685f2d859a45e5d4fe89a5445f4ac4b Mon Sep 17 00:00:00 2001 From: Austin Ward Date: Wed, 7 Jan 2026 23:01:39 -0500 Subject: [PATCH 4/4] Match description of other reset options usage --- openapi/openapiv2.json | 2 +- openapi/openapiv3.yaml | 5 +---- temporal/api/workflowservice/v1/request_response.proto | 2 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index ee6a735ad..3fc37019d 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -8939,7 +8939,7 @@ }, "resetOptions": { "$ref": "#/definitions/v1ResetOptions", - "description": "Describes where to reset to and how. If set, `workflow_task_finish_event_id` is ignored.\nThis allows specifying reset targets like first/last workflow task, build ID, or last continued-as-new\nwithout needing to know the exact event ID." + "description": "Describes where to reset to and how. If set, `workflow_task_finish_event_id` is ignored." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 7c9bc62c6..94fc256c6 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -11901,10 +11901,7 @@ components: resetOptions: allOf: - $ref: '#/components/schemas/ResetOptions' - description: |- - Describes where to reset to and how. If set, `workflow_task_finish_event_id` is ignored. - This allows specifying reset targets like first/last workflow task, build ID, or last continued-as-new - without needing to know the exact event ID. + description: Describes where to reset to and how. If set, `workflow_task_finish_event_id` is ignored. ResetWorkflowExecutionResponse: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 6ea6fcf29..652a0ffaa 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -831,8 +831,6 @@ message ResetWorkflowExecutionRequest { // The identity of the worker/client string identity = 9; // Describes where to reset to and how. If set, `workflow_task_finish_event_id` is ignored. - // This allows specifying reset targets like first/last workflow task, build ID, or last continued-as-new - // without needing to know the exact event ID. temporal.api.common.v1.ResetOptions reset_options = 10; }