diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 8d4538d07..9c54767ac 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10466,6 +10466,10 @@ "$ref": "#/definitions/apiCommonV1Link" }, "description": "Links to be associated with the activity. Callbacks may also have associated links;\nlinks already included with a callback should not be duplicated here." + }, + "onConflictOptions": { + "$ref": "#/definitions/apiCommonV1OnConflictOptions", + "description": "Options for handling conflicts when using ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING." } } }, @@ -10620,7 +10624,7 @@ "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", + "$ref": "#/definitions/apiWorkflowV1OnConflictOptions", "description": "Defines actions to be done to the existing running workflow when the conflict policy\nWORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING is used. If not set (ie., nil value) or set to a\nempty object (ie., all options with default value), it won't do anything to the existing\nrunning workflow. If set, it will add a history event to the running workflow." }, "priority": { @@ -11177,6 +11181,24 @@ }, "description": "Common callback information. Specific CallbackInfo messages should embed this and may include additional fields." }, + "apiCommonV1OnConflictOptions": { + "type": "object", + "properties": { + "attachRequestId": { + "type": "boolean", + "description": "Attaches the request ID to the running execution." + }, + "attachCompletionCallbacks": { + "type": "boolean", + "description": "Attaches the completion callbacks to the running execution." + }, + "attachLinks": { + "type": "boolean", + "description": "Attaches the links to the running execution." + } + }, + "description": "When starting an execution with a conflict policy that uses an existing execution and there is already an existing\nrunning execution, OnConflictOptions defines actions to be taken on the existing running execution." + }, "apiWorkflowV1CallbackInfo": { "type": "object", "properties": { @@ -11230,6 +11252,24 @@ } } }, + "apiWorkflowV1OnConflictOptions": { + "type": "object", + "properties": { + "attachRequestId": { + "type": "boolean", + "description": "Attaches the request ID to the running workflow." + }, + "attachCompletionCallbacks": { + "type": "boolean", + "description": "Attaches the completion callbacks to the running workflow." + }, + "attachLinks": { + "type": "boolean", + "description": "Attaches the links to the WorkflowExecutionOptionsUpdatedEvent history event." + } + }, + "description": "When StartWorkflowExecution uses the conflict policy WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING and\nthere is already an existing running workflow, OnConflictOptions defines actions to be taken on\nthe existing running workflow. In this case, it will create a WorkflowExecutionOptionsUpdatedEvent\nhistory event in the running workflow with the changes requested in this object." + }, "protobufAny": { "type": "object", "properties": { @@ -14926,24 +14966,6 @@ }, "description": "Nexus operation timed out." }, - "v1OnConflictOptions": { - "type": "object", - "properties": { - "attachRequestId": { - "type": "boolean", - "description": "Attaches the request ID to the running workflow." - }, - "attachCompletionCallbacks": { - "type": "boolean", - "description": "Attaches the completion callbacks to the running workflow." - }, - "attachLinks": { - "type": "boolean", - "description": "Attaches the links to the WorkflowExecutionOptionsUpdatedEvent history event." - } - }, - "description": "When StartWorkflowExecution uses the conflict policy WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING and\nthere is already an existing running workflow, OnConflictOptions defines actions to be taken on\nthe existing running workflow. In this case, it will create a WorkflowExecutionOptionsUpdatedEvent\nhistory event in the running workflow with the changes requested in this object." - }, "v1Outcome": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index b40684df7..58d034011 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -11726,18 +11726,16 @@ components: properties: attachRequestId: type: boolean - description: Attaches the request ID to the running workflow. + description: Attaches the request ID to the running execution. attachCompletionCallbacks: type: boolean - description: Attaches the completion callbacks to the running workflow. + description: Attaches the completion callbacks to the running execution. attachLinks: type: boolean - description: Attaches the links to the WorkflowExecutionOptionsUpdatedEvent history event. + description: Attaches the links to the running execution. description: |- - When StartWorkflowExecution uses the conflict policy WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING and - there is already an existing running workflow, OnConflictOptions defines actions to be taken on - the existing running workflow. In this case, it will create a WorkflowExecutionOptionsUpdatedEvent - history event in the running workflow with the changes requested in this object. + When starting an execution with a conflict policy that uses an existing execution and there is already an existing + running execution, OnConflictOptions defines actions to be taken on the existing running execution. Outcome: type: object properties: @@ -14325,6 +14323,10 @@ components: description: |- Links to be associated with the activity. Callbacks may also have associated links; links already included with a callback should not be duplicated here. + onConflictOptions: + allOf: + - $ref: '#/components/schemas/OnConflictOptions' + description: Options for handling conflicts when using ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING. StartActivityExecutionResponse: type: object properties: diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index 419f08f68..d112124f3 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -363,3 +363,14 @@ message WorkerSelector { string worker_instance_key = 1; } } + +// When starting an execution with a conflict policy that uses an existing execution and there is already an existing +// running execution, OnConflictOptions defines actions to be taken on the existing running execution. +message OnConflictOptions { + // Attaches the request ID to the running execution. + bool attach_request_id = 1; + // Attaches the completion callbacks to the running execution. + bool attach_completion_callbacks = 2; + // Attaches the links to the running execution. + bool attach_links = 3; +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 8580b7179..b7d568e35 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2937,6 +2937,8 @@ message StartActivityExecutionRequest { // Links to be associated with the activity. Callbacks may also have associated links; // links already included with a callback should not be duplicated here. repeated temporal.api.common.v1.Link links = 20; + // Options for handling conflicts when using ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING. + temporal.api.common.v1.OnConflictOptions on_conflict_options = 21; } message StartActivityExecutionResponse {