From 865e27d83a173b2dec4f4364a33d167c1d0d7e25 Mon Sep 17 00:00:00 2001 From: rodrigozhou Date: Thu, 26 Dec 2024 12:03:58 -0800 Subject: [PATCH] Add OnConflictOptions to StartWorkflowExecutionRequest --- openapi/openapiv2.json | 24 ++++++++++++++++++ openapi/openapiv3.yaml | 25 +++++++++++++++++++ temporal/api/history/v1/message.proto | 5 ++++ temporal/api/workflow/v1/message.proto | 6 +++++ .../workflowservice/v1/request_response.proto | 5 ++++ 5 files changed, 65 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index ca105596..278bb92b 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -6545,6 +6545,10 @@ "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." + }, + "onConflictOptions": { + "$ref": "#/definitions/v1OnConflictOptions", + "description": "It defines behaviors to be executed when the WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING\nconflict policy is used. If set to non-nil empty object, it will attach the completion\ncallbacks to the existing running workflow. If not set (ie., nil value), it won't do anything\nto the existing running workflow." } } }, @@ -9968,6 +9972,10 @@ }, "description": "Nexus operation timed out." }, + "v1OnConflictOptions": { + "type": "object", + "description": "When StartWorkflowExecution uses the WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING conflict policy and\nthere is already an existing running workflow, OnConflictOptions defines actions to be taken on\nthe existing running workflow." + }, "v1Outcome": { "type": "object", "properties": { @@ -11997,6 +12005,10 @@ "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." + }, + "onConflictOptions": { + "$ref": "#/definitions/v1OnConflictOptions", + "description": "It defines behaviors to be executed when the WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING\nconflict policy is used. If set to non-nil empty object, it will attach the completion\ncallbacks to the existing running workflow. If not set (ie., nil value), it won't do anything\nto the existing running workflow." } } }, @@ -13067,6 +13079,18 @@ "versioningOverride": { "$ref": "#/definitions/v1VersioningOverride", "description": "Versioning override in the mutable state after event has been applied." + }, + "attachRequestId": { + "type": "string", + "description": "Attach request ID to the running workflow execution so that additional requests with same\nrequest ID will be deduped." + }, + "addCompletionCallbacks": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Callback" + }, + "description": "Add completion callbacks to the running workflow execution." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 01547435..2de7eb8a 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -7443,6 +7443,13 @@ components: type: string description: The request ID allocated at schedule time. description: Nexus operation timed out. + OnConflictOptions: + type: object + properties: {} + description: |- + When StartWorkflowExecution uses the WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING conflict policy and + there is already an existing running workflow, OnConflictOptions defines actions to be taken on + the existing running workflow. Outcome: type: object properties: @@ -9379,6 +9386,14 @@ components: 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. + onConflictOptions: + allOf: + - $ref: '#/components/schemas/OnConflictOptions' + description: |- + It defines behaviors to be executed when the WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING + conflict policy is used. If set to non-nil empty object, it will attach the completion + callbacks to the existing running workflow. If not set (ie., nil value), it won't do anything + to the existing running workflow. StartWorkflowExecutionResponse: type: object properties: @@ -10570,6 +10585,16 @@ components: allOf: - $ref: '#/components/schemas/VersioningOverride' description: Versioning override in the mutable state after event has been applied. + attachRequestId: + type: string + description: |- + Attach request ID to the running workflow execution so that additional requests with same + request ID will be deduped. + addCompletionCallbacks: + type: array + items: + $ref: '#/components/schemas/Callback' + description: Add completion callbacks to the running workflow execution. WorkflowExecutionSignaledEventAttributes: type: object properties: diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index 065f2bba..ef9fd989 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -743,6 +743,11 @@ message ChildWorkflowExecutionTerminatedEventAttributes { message WorkflowExecutionOptionsUpdatedEventAttributes { // Versioning override in the mutable state after event has been applied. temporal.api.workflow.v1.VersioningOverride versioning_override = 1; + // Attach request ID to the running workflow execution so that additional requests with same + // request ID will be deduped. + string attach_request_id = 2; + // Add completion callbacks to the running workflow execution. + repeated temporal.api.common.v1.Callback add_completion_callbacks = 3; } // 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 ec5162fa..cd5fcb66 100644 --- a/temporal/api/workflow/v1/message.proto +++ b/temporal/api/workflow/v1/message.proto @@ -440,3 +440,9 @@ message VersioningOverride { // Identifies the worker deployment to pin the workflow to. temporal.api.deployment.v1.Deployment deployment = 2; } + +// When StartWorkflowExecution uses the WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING conflict policy and +// there is already an existing running workflow, OnConflictOptions defines actions to be taken on +// the existing running workflow. +message OnConflictOptions { +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index f84e3e2c..d666f453 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -206,6 +206,11 @@ message StartWorkflowExecutionRequest { // 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; + // It defines behaviors to be executed when the WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING + // conflict policy is used. If set to non-nil empty object, it will attach the completion + // callbacks to the existing running workflow. If not set (ie., nil value), it won't do anything + // to the existing running workflow. + temporal.api.workflow.v1.OnConflictOptions on_conflict_options = 26; } message StartWorkflowExecutionResponse {