From 2c1176caba40fc18ee2ccc36c441fbe80bf411b2 Mon Sep 17 00:00:00 2001 From: Carly de Frondeville Date: Tue, 19 Nov 2024 19:17:34 -0500 Subject: [PATCH] Add VersioningBehaviorOverride to StartWorkflowExecutionRequest (#477) * add VersioningBehaviorOverride to StartWorkflowExecutionRequest, schedules, signal with start --- openapi/openapiv2.json | 24 ++++++++++++++-- openapi/openapiv3.yaml | 28 ++++++++++++++++--- temporal/api/history/v1/message.proto | 4 ++- temporal/api/workflow/v1/message.proto | 6 ++-- .../workflowservice/v1/request_response.proto | 7 ++++- 5 files changed, 59 insertions(+), 10 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index f9281e7a..e8ec83d4 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -6059,6 +6059,10 @@ "$ref": "#/definitions/apicommonv1Link" }, "description": "Links to be associated with the WorkflowExecutionStarted and WorkflowExecutionSignaled events." + }, + "versioningOverride": { + "$ref": "#/definitions/v1VersioningOverride", + "description": "If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.\nTo unset the override after the workflow is running, use UpdateWorkflowExecutionOptions." } } }, @@ -6244,6 +6248,10 @@ "$ref": "#/definitions/apicommonv1Link" }, "description": "Links to be associated with the workflow." + }, + "versioningOverride": { + "$ref": "#/definitions/v1VersioningOverride", + "description": "If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.\nTo unset the override after the workflow is running, use UpdateWorkflowExecutionOptions." } } }, @@ -9393,6 +9401,10 @@ "userMetadata": { "$ref": "#/definitions/v1UserMetadata", "description": "Metadata on the workflow if it is started. This is carried over to the WorkflowExecutionConfig\nfor use by user interfaces to display the fixed as-of-start summary and details of the\nworkflow." + }, + "versioningOverride": { + "$ref": "#/definitions/v1VersioningOverride", + "description": "If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.\nTo unset the override after the workflow is running, use UpdateWorkflowExecutionOptions." } }, "description": "NewWorkflowExecutionInfo is a shared message that encapsulates all the\nrequired arguments to starting a workflow in different contexts." @@ -11616,6 +11628,10 @@ "$ref": "#/definitions/apicommonv1Link" }, "description": "Links to be associated with the workflow." + }, + "versioningOverride": { + "$ref": "#/definitions/v1VersioningOverride", + "description": "If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.\nTo unset the override after the workflow is running, use UpdateWorkflowExecutionOptions." } } }, @@ -12646,7 +12662,7 @@ "properties": { "versioningOverride": { "$ref": "#/definitions/v1VersioningOverride", - "description": "If set, takes precedence over the sdk-sent Versioning Behavior for the specific Workflow\nExecution it is set on." + "description": "If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion." } } }, @@ -12654,7 +12670,7 @@ "type": "object", "properties": { "versioningOverride": { - "$ref": "#/definitions/v1VersioningBehaviorOverride", + "$ref": "#/definitions/v1VersioningOverride", "description": "Versioning override in the mutable state after event has been applied." } } @@ -12815,6 +12831,10 @@ "inheritedBuildId": { "type": "string", "title": "When present, this execution is assigned to the build ID of its parent or previous execution.\nDeprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]" + }, + "versioningOverride": { + "$ref": "#/definitions/v1VersioningOverride", + "description": "Versioning override applied to this workflow when it was started." } }, "title": "Always the first event in workflow history" diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 0dcf1308..eda26f44 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -6976,6 +6976,12 @@ components: Metadata on the workflow if it is started. This is carried over to the WorkflowExecutionConfig for use by user interfaces to display the fixed as-of-start summary and details of the workflow. + versioningOverride: + allOf: + - $ref: '#/components/schemas/VersioningOverride' + description: |- + If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion. + To unset the override after the workflow is running, use UpdateWorkflowExecutionOptions. description: |- NewWorkflowExecutionInfo is a shared message that encapsulates all the required arguments to starting a workflow in different contexts. @@ -8662,6 +8668,12 @@ components: items: $ref: '#/components/schemas/Link' description: Links to be associated with the WorkflowExecutionStarted and WorkflowExecutionSignaled events. + versioningOverride: + allOf: + - $ref: '#/components/schemas/VersioningOverride' + description: |- + If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion. + To unset the override after the workflow is running, use UpdateWorkflowExecutionOptions. SignalWithStartWorkflowExecutionResponse: type: object properties: @@ -8978,6 +8990,12 @@ components: items: $ref: '#/components/schemas/Link' description: Links to be associated with the workflow. + versioningOverride: + allOf: + - $ref: '#/components/schemas/VersioningOverride' + description: |- + If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion. + To unset the override after the workflow is running, use UpdateWorkflowExecutionOptions. StartWorkflowExecutionResponse: type: object properties: @@ -10140,15 +10158,13 @@ components: versioningOverride: allOf: - $ref: '#/components/schemas/VersioningOverride' - description: |- - If set, takes precedence over the sdk-sent Versioning Behavior for the specific Workflow - Execution it is set on. + description: If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion. WorkflowExecutionOptionsUpdatedEventAttributes: type: object properties: versioningOverride: allOf: - - $ref: '#/components/schemas/VersioningBehaviorOverride' + - $ref: '#/components/schemas/VersioningOverride' description: Versioning override in the mutable state after event has been applied. WorkflowExecutionSignaledEventAttributes: type: object @@ -10319,6 +10335,10 @@ components: description: |- When present, this execution is assigned to the build ID of its parent or previous execution. Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv] + versioningOverride: + allOf: + - $ref: '#/components/schemas/VersioningOverride' + description: Versioning override applied to this workflow when it was started. description: Always the first event in workflow history WorkflowExecutionTerminatedEventAttributes: type: object diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index 0665049b..81c8dd71 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -131,6 +131,8 @@ message WorkflowExecutionStartedEventAttributes { // When present, this execution is assigned to the build ID of its parent or previous execution. // Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv] string inherited_build_id = 32; + // Versioning override applied to this workflow when it was started. + temporal.api.workflow.v1.VersioningOverride versioning_override = 33; } message WorkflowExecutionCompletedEventAttributes { @@ -759,7 +761,7 @@ message ChildWorkflowExecutionTerminatedEventAttributes { message WorkflowExecutionOptionsUpdatedEventAttributes { // Versioning override in the mutable state after event has been applied. - temporal.api.common.v1.VersioningBehaviorOverride versioning_override = 1; + temporal.api.workflow.v1.VersioningOverride versioning_override = 1; } // Not used anywhere. Use case is replaced by WorkflowExecutionOptionsUpdatedEventAttributes diff --git a/temporal/api/workflow/v1/message.proto b/temporal/api/workflow/v1/message.proto index 4d142eae..876af024 100644 --- a/temporal/api/workflow/v1/message.proto +++ b/temporal/api/workflow/v1/message.proto @@ -267,6 +267,9 @@ message NewWorkflowExecutionInfo { // for use by user interfaces to display the fixed as-of-start summary and details of the // workflow. temporal.api.sdk.v1.UserMetadata user_metadata = 14; + // If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion. + // To unset the override after the workflow is running, use UpdateWorkflowExecutionOptions. + VersioningOverride versioning_override = 15; } // CallbackInfo contains the state of an attached workflow callback. @@ -362,8 +365,7 @@ message NexusOperationCancellationInfo { } message WorkflowExecutionOptions { - // If set, takes precedence over the sdk-sent Versioning Behavior for the specific Workflow - // Execution it is set on. + // If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion. VersioningOverride versioning_override = 1; } diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 51f3364b..63b85853 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -203,6 +203,9 @@ message StartWorkflowExecutionRequest { temporal.api.sdk.v1.UserMetadata user_metadata = 23; // Links to be associated with the workflow. repeated temporal.api.common.v1.Link links = 24; + // If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion. + // To unset the override after the workflow is running, use UpdateWorkflowExecutionOptions. + temporal.api.workflow.v1.VersioningOverride versioning_override = 25; } message StartWorkflowExecutionResponse { @@ -712,9 +715,11 @@ message SignalWithStartWorkflowExecutionRequest { // for use by user interfaces to display the fixed as-of-start summary and details of the // workflow. temporal.api.sdk.v1.UserMetadata user_metadata = 23; - // Links to be associated with the WorkflowExecutionStarted and WorkflowExecutionSignaled events. repeated temporal.api.common.v1.Link links = 24; + // If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion. + // To unset the override after the workflow is running, use UpdateWorkflowExecutionOptions. + temporal.api.workflow.v1.VersioningOverride versioning_override = 25; } message SignalWithStartWorkflowExecutionResponse {