Skip to content

Commit

Permalink
Add OnConflictOptions to StartWorkflowExecutionRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigozhou committed Jan 14, 2025
1 parent 5e65ea6 commit 865e27d
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
24 changes: 24 additions & 0 deletions openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
},
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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."
}
}
},
Expand Down Expand Up @@ -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."
}
}
},
Expand Down
25 changes: 25 additions & 0 deletions openapi/openapiv3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions temporal/api/history/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions temporal/api/workflow/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
}
5 changes: 5 additions & 0 deletions temporal/api/workflowservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 865e27d

Please sign in to comment.