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 2a5b395 commit 410f8e0
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 0 deletions.
32 changes: 32 additions & 0 deletions openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -6552,6 +6552,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 @@ -9975,6 +9979,18 @@
},
"description": "Nexus operation timed out."
},
"v1OnConflictOptions": {
"type": "object",
"properties": {
"attachRequestId": {
"type": "boolean"
},
"attachCompletionCallbacks": {
"type": "boolean"
}
},
"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 @@ -12004,6 +12020,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 @@ -13074,6 +13094,18 @@
"versioningOverride": {
"$ref": "#/definitions/v1VersioningOverride",
"description": "Versioning override in the mutable state after event has been applied."
},
"attachedRequestId": {
"type": "string",
"description": "Attached request ID to the running workflow execution so that additional requests with same\nrequest ID will be deduped."
},
"attachedCompletionCallbacks": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/v1Callback"
},
"description": "Attached completion callbacks to the running workflow execution."
}
}
},
Expand Down
29 changes: 29 additions & 0 deletions openapi/openapiv3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7443,6 +7443,17 @@ components:
type: string
description: The request ID allocated at schedule time.
description: Nexus operation timed out.
OnConflictOptions:
type: object
properties:
attachRequestId:
type: boolean
attachCompletionCallbacks:
type: boolean
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 +9390,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 +10589,16 @@ components:
allOf:
- $ref: '#/components/schemas/VersioningOverride'
description: Versioning override in the mutable state after event has been applied.
attachedRequestId:
type: string
description: |-
Attached request ID to the running workflow execution so that additional requests with same
request ID will be deduped.
attachedCompletionCallbacks:
type: array
items:
$ref: '#/components/schemas/Callback'
description: Attached 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;
// Attached request ID to the running workflow execution so that additional requests with same
// request ID will be deduped.
string attached_request_id = 2;
// Attached completion callbacks to the running workflow execution.
repeated temporal.api.common.v1.Callback attached_completion_callbacks = 3;
}

// Not used anywhere. Use case is replaced by WorkflowExecutionOptionsUpdatedEventAttributes
Expand Down
8 changes: 8 additions & 0 deletions temporal/api/workflow/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,11 @@ 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 {
bool attach_request_id = 1;
bool attach_completion_callbacks = 2;
}
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 410f8e0

Please sign in to comment.