Skip to content

Commit 410f8e0

Browse files
committed
Add OnConflictOptions to StartWorkflowExecutionRequest
1 parent 2a5b395 commit 410f8e0

File tree

5 files changed

+79
-0
lines changed

5 files changed

+79
-0
lines changed

openapi/openapiv2.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6552,6 +6552,10 @@
65526552
"versioningOverride": {
65536553
"$ref": "#/definitions/v1VersioningOverride",
65546554
"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."
6555+
},
6556+
"onConflictOptions": {
6557+
"$ref": "#/definitions/v1OnConflictOptions",
6558+
"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."
65556559
}
65566560
}
65576561
},
@@ -9975,6 +9979,18 @@
99759979
},
99769980
"description": "Nexus operation timed out."
99779981
},
9982+
"v1OnConflictOptions": {
9983+
"type": "object",
9984+
"properties": {
9985+
"attachRequestId": {
9986+
"type": "boolean"
9987+
},
9988+
"attachCompletionCallbacks": {
9989+
"type": "boolean"
9990+
}
9991+
},
9992+
"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."
9993+
},
99789994
"v1Outcome": {
99799995
"type": "object",
99809996
"properties": {
@@ -12004,6 +12020,10 @@
1200412020
"versioningOverride": {
1200512021
"$ref": "#/definitions/v1VersioningOverride",
1200612022
"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."
12023+
},
12024+
"onConflictOptions": {
12025+
"$ref": "#/definitions/v1OnConflictOptions",
12026+
"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."
1200712027
}
1200812028
}
1200912029
},
@@ -13074,6 +13094,18 @@
1307413094
"versioningOverride": {
1307513095
"$ref": "#/definitions/v1VersioningOverride",
1307613096
"description": "Versioning override in the mutable state after event has been applied."
13097+
},
13098+
"attachedRequestId": {
13099+
"type": "string",
13100+
"description": "Attached request ID to the running workflow execution so that additional requests with same\nrequest ID will be deduped."
13101+
},
13102+
"attachedCompletionCallbacks": {
13103+
"type": "array",
13104+
"items": {
13105+
"type": "object",
13106+
"$ref": "#/definitions/v1Callback"
13107+
},
13108+
"description": "Attached completion callbacks to the running workflow execution."
1307713109
}
1307813110
}
1307913111
},

openapi/openapiv3.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7443,6 +7443,17 @@ components:
74437443
type: string
74447444
description: The request ID allocated at schedule time.
74457445
description: Nexus operation timed out.
7446+
OnConflictOptions:
7447+
type: object
7448+
properties:
7449+
attachRequestId:
7450+
type: boolean
7451+
attachCompletionCallbacks:
7452+
type: boolean
7453+
description: |-
7454+
When StartWorkflowExecution uses the WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING conflict policy and
7455+
there is already an existing running workflow, OnConflictOptions defines actions to be taken on
7456+
the existing running workflow.
74467457
Outcome:
74477458
type: object
74487459
properties:
@@ -9379,6 +9390,14 @@ components:
93799390
description: |-
93809391
If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.
93819392
To unset the override after the workflow is running, use UpdateWorkflowExecutionOptions.
9393+
onConflictOptions:
9394+
allOf:
9395+
- $ref: '#/components/schemas/OnConflictOptions'
9396+
description: |-
9397+
It defines behaviors to be executed when the WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING
9398+
conflict policy is used. If set to non-nil empty object, it will attach the completion
9399+
callbacks to the existing running workflow. If not set (ie., nil value), it won't do anything
9400+
to the existing running workflow.
93829401
StartWorkflowExecutionResponse:
93839402
type: object
93849403
properties:
@@ -10570,6 +10589,16 @@ components:
1057010589
allOf:
1057110590
- $ref: '#/components/schemas/VersioningOverride'
1057210591
description: Versioning override in the mutable state after event has been applied.
10592+
attachedRequestId:
10593+
type: string
10594+
description: |-
10595+
Attached request ID to the running workflow execution so that additional requests with same
10596+
request ID will be deduped.
10597+
attachedCompletionCallbacks:
10598+
type: array
10599+
items:
10600+
$ref: '#/components/schemas/Callback'
10601+
description: Attached completion callbacks to the running workflow execution.
1057310602
WorkflowExecutionSignaledEventAttributes:
1057410603
type: object
1057510604
properties:

temporal/api/history/v1/message.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,11 @@ message ChildWorkflowExecutionTerminatedEventAttributes {
743743
message WorkflowExecutionOptionsUpdatedEventAttributes {
744744
// Versioning override in the mutable state after event has been applied.
745745
temporal.api.workflow.v1.VersioningOverride versioning_override = 1;
746+
// Attached request ID to the running workflow execution so that additional requests with same
747+
// request ID will be deduped.
748+
string attached_request_id = 2;
749+
// Attached completion callbacks to the running workflow execution.
750+
repeated temporal.api.common.v1.Callback attached_completion_callbacks = 3;
746751
}
747752

748753
// Not used anywhere. Use case is replaced by WorkflowExecutionOptionsUpdatedEventAttributes

temporal/api/workflow/v1/message.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,3 +440,11 @@ message VersioningOverride {
440440
// Identifies the worker deployment to pin the workflow to.
441441
temporal.api.deployment.v1.Deployment deployment = 2;
442442
}
443+
444+
// When StartWorkflowExecution uses the WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING conflict policy and
445+
// there is already an existing running workflow, OnConflictOptions defines actions to be taken on
446+
// the existing running workflow.
447+
message OnConflictOptions {
448+
bool attach_request_id = 1;
449+
bool attach_completion_callbacks = 2;
450+
}

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ message StartWorkflowExecutionRequest {
206206
// If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.
207207
// To unset the override after the workflow is running, use UpdateWorkflowExecutionOptions.
208208
temporal.api.workflow.v1.VersioningOverride versioning_override = 25;
209+
// It defines behaviors to be executed when the WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING
210+
// conflict policy is used. If set to non-nil empty object, it will attach the completion
211+
// callbacks to the existing running workflow. If not set (ie., nil value), it won't do anything
212+
// to the existing running workflow.
213+
temporal.api.workflow.v1.OnConflictOptions on_conflict_options = 26;
209214
}
210215

211216
message StartWorkflowExecutionResponse {

0 commit comments

Comments
 (0)