Skip to content

Commit 5f21385

Browse files
committed
add on conflict options for standalone activities
1 parent 6f298e7 commit 5f21385

4 files changed

Lines changed: 65 additions & 26 deletions

File tree

openapi/openapiv2.json

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10464,6 +10464,10 @@
1046410464
"$ref": "#/definitions/apiCommonV1Link"
1046510465
},
1046610466
"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."
10467+
},
10468+
"onConflictOptions": {
10469+
"$ref": "#/definitions/apiActivityV1OnConflictOptions",
10470+
"description": "Options for handling conflicts when using ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING."
1046710471
}
1046810472
}
1046910473
},
@@ -10618,7 +10622,7 @@
1061810622
"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."
1061910623
},
1062010624
"onConflictOptions": {
10621-
"$ref": "#/definitions/v1OnConflictOptions",
10625+
"$ref": "#/definitions/apiWorkflowV1OnConflictOptions",
1062210626
"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."
1062310627
},
1062410628
"priority": {
@@ -11133,6 +11137,24 @@
1113311137
}
1113411138
}
1113511139
},
11140+
"apiActivityV1OnConflictOptions": {
11141+
"type": "object",
11142+
"properties": {
11143+
"attachRequestId": {
11144+
"type": "boolean",
11145+
"description": "Attaches the request ID to the running activity."
11146+
},
11147+
"attachCompletionCallbacks": {
11148+
"type": "boolean",
11149+
"description": "Attaches the completion callbacks to the running activity."
11150+
},
11151+
"attachLinks": {
11152+
"type": "boolean",
11153+
"description": "Attaches the links to the running activity."
11154+
}
11155+
},
11156+
"description": "When StartActivityExecution uses the conflict policy ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING and\nthere is already an existing running activity, OnConflictOptions defines actions to be taken on\nthe existing running activity."
11157+
},
1113611158
"apiCallbackV1CallbackInfo": {
1113711159
"type": "object",
1113811160
"properties": {
@@ -11228,6 +11250,24 @@
1122811250
}
1122911251
}
1123011252
},
11253+
"apiWorkflowV1OnConflictOptions": {
11254+
"type": "object",
11255+
"properties": {
11256+
"attachRequestId": {
11257+
"type": "boolean",
11258+
"description": "Attaches the request ID to the running workflow."
11259+
},
11260+
"attachCompletionCallbacks": {
11261+
"type": "boolean",
11262+
"description": "Attaches the completion callbacks to the running workflow."
11263+
},
11264+
"attachLinks": {
11265+
"type": "boolean",
11266+
"description": "Attaches the links to the WorkflowExecutionOptionsUpdatedEvent history event."
11267+
}
11268+
},
11269+
"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."
11270+
},
1123111271
"protobufAny": {
1123211272
"type": "object",
1123311273
"properties": {
@@ -14924,24 +14964,6 @@
1492414964
},
1492514965
"description": "Nexus operation timed out."
1492614966
},
14927-
"v1OnConflictOptions": {
14928-
"type": "object",
14929-
"properties": {
14930-
"attachRequestId": {
14931-
"type": "boolean",
14932-
"description": "Attaches the request ID to the running workflow."
14933-
},
14934-
"attachCompletionCallbacks": {
14935-
"type": "boolean",
14936-
"description": "Attaches the completion callbacks to the running workflow."
14937-
},
14938-
"attachLinks": {
14939-
"type": "boolean",
14940-
"description": "Attaches the links to the WorkflowExecutionOptionsUpdatedEvent history event."
14941-
}
14942-
},
14943-
"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."
14944-
},
1494514967
"v1Outcome": {
1494614968
"type": "object",
1494714969
"properties": {

openapi/openapiv3.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11724,18 +11724,17 @@ components:
1172411724
properties:
1172511725
attachRequestId:
1172611726
type: boolean
11727-
description: Attaches the request ID to the running workflow.
11727+
description: Attaches the request ID to the running activity.
1172811728
attachCompletionCallbacks:
1172911729
type: boolean
11730-
description: Attaches the completion callbacks to the running workflow.
11730+
description: Attaches the completion callbacks to the running activity.
1173111731
attachLinks:
1173211732
type: boolean
11733-
description: Attaches the links to the WorkflowExecutionOptionsUpdatedEvent history event.
11733+
description: Attaches the links to the running activity.
1173411734
description: |-
11735-
When StartWorkflowExecution uses the conflict policy WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING and
11736-
there is already an existing running workflow, OnConflictOptions defines actions to be taken on
11737-
the existing running workflow. In this case, it will create a WorkflowExecutionOptionsUpdatedEvent
11738-
history event in the running workflow with the changes requested in this object.
11735+
When StartActivityExecution uses the conflict policy ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING and
11736+
there is already an existing running activity, OnConflictOptions defines actions to be taken on
11737+
the existing running activity.
1173911738
Outcome:
1174011739
type: object
1174111740
properties:
@@ -14323,6 +14322,10 @@ components:
1432314322
description: |-
1432414323
Links to be associated with the activity. Callbacks may also have associated links;
1432514324
links already included with a callback should not be duplicated here.
14325+
onConflictOptions:
14326+
allOf:
14327+
- $ref: '#/components/schemas/OnConflictOptions'
14328+
description: Options for handling conflicts when using ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING.
1432614329
StartActivityExecutionResponse:
1432714330
type: object
1432814331
properties:

temporal/api/activity/v1/message.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,18 @@ message ActivityExecutionListInfo {
200200
google.protobuf.Duration execution_duration = 11;
201201
}
202202

203+
// When StartActivityExecution uses the conflict policy ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING and
204+
// there is already an existing running activity, OnConflictOptions defines actions to be taken on
205+
// the existing running activity.
206+
message OnConflictOptions {
207+
// Attaches the request ID to the running activity.
208+
bool attach_request_id = 1;
209+
// Attaches the completion callbacks to the running activity.
210+
bool attach_completion_callbacks = 2;
211+
// Attaches the links to the running activity.
212+
bool attach_links = 3;
213+
}
214+
203215
// CallbackInfo contains the state of an attached activity callback.
204216
message CallbackInfo {
205217
// Trigger for when the activity is closed.

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2937,6 +2937,8 @@ message StartActivityExecutionRequest {
29372937
// Links to be associated with the activity. Callbacks may also have associated links;
29382938
// links already included with a callback should not be duplicated here.
29392939
repeated temporal.api.common.v1.Link links = 20;
2940+
// Options for handling conflicts when using ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING.
2941+
temporal.api.activity.v1.OnConflictOptions on_conflict_options = 21;
29402942
}
29412943

29422944
message StartActivityExecutionResponse {

0 commit comments

Comments
 (0)