@@ -647,8 +647,11 @@ type (
647
647
// When WorkflowExecutionErrorWhenAlreadyStarted is true, Client.ExecuteWorkflow will return an error if the
648
648
// workflow id has already been used and WorkflowIDReusePolicy or WorkflowIDConflictPolicy would
649
649
// disallow a re-run. If it is set to false, rather than erroring a WorkflowRun instance representing
650
- // the current or last run will be returned. However, when WithStartOperation is set, this field is ignored and
651
- // the WorkflowIDConflictPolicy UseExisting must be used instead to prevent erroring.
650
+ // the current or last run will be returned. However, this field is ignored in the following cases:
651
+ // - when WithStartOperation is set;
652
+ // - in the Nexus WorkflowRunOperation.
653
+ // When this field is ignored, you must set WorkflowIDConflictPolicy to UseExisting to prevent
654
+ // erroring.
652
655
//
653
656
// Optional: defaults to false
654
657
WorkflowExecutionErrorWhenAlreadyStarted bool
@@ -742,6 +745,14 @@ type (
742
745
callbacks []* commonpb.Callback
743
746
// links. Only settable by the SDK - e.g. [temporalnexus.workflowRunOperation].
744
747
links []* commonpb.Link
748
+
749
+ // OnConflictOptions - Optional workflow ID conflict options used in conjunction with conflict policy
750
+ // WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING. If onConflictOptions is set and a workflow is already
751
+ // running, the options specifies the actions to be taken on the running workflow. If not set or use
752
+ // together with any other WorkflowIDConflictPolicy, this parameter is ignored.
753
+ //
754
+ // NOTE: Only settable by the SDK -- e.g. [temporalnexus.workflowRunOperation].
755
+ onConflictOptions * OnConflictOptions
745
756
}
746
757
747
758
// WithStartWorkflowOperation defines how to start a workflow when using UpdateWithStartWorkflow.
@@ -1195,3 +1206,14 @@ func SetCallbacksOnStartWorkflowOptions(opts *StartWorkflowOptions, callbacks []
1195
1206
func SetLinksOnStartWorkflowOptions (opts * StartWorkflowOptions , links []* commonpb.Link ) {
1196
1207
opts .links = links
1197
1208
}
1209
+
1210
+ // SetOnConflictOptionsOnStartWorkflowOptions is an internal only method for setting conflict
1211
+ // options on StartWorkflowOptions.
1212
+ // OnConflictOptions are purposefully not exposed to users for the time being.
1213
+ func SetOnConflictOptionsOnStartWorkflowOptions (opts * StartWorkflowOptions ) {
1214
+ opts .onConflictOptions = & OnConflictOptions {
1215
+ AttachRequestID : true ,
1216
+ AttachCompletionCallbacks : true ,
1217
+ AttachLinks : true ,
1218
+ }
1219
+ }
0 commit comments