-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OnConflictOptions to StartWorkflowExecutionRequest #510
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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 { | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this message be used anywhere else except start workflow? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe in schedules? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no ID conflict policy in schedules (by intention as I understand it due to how schedules set IDs) |
||||||||||
bool attach_completion_callbacks = 1; | ||||||||||
bool attach_links = 2; | ||||||||||
Comment on lines
+448
to
+449
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think this may be clearer terminology (assuming it is actually "appending") There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This works for me although I prefer the term attach over append but don't have a strong opinion on that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For callbacks, "append" makes sense since we adding to the workflow execution. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think what each of these do to existing values may need to be documented here because it is clearly confusing. What does "attach" mean for links? If links are set in the history event and immutable, then where in history are these new ones set? Or are there now two kinds of links, start links and post-start links, and they manifest in different ways? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree we should document these options. The link would essentially be linked to the new event but conceptually they're considered attached to the workflow. flowchart LR
CallerWorkflowA --> HandlerWorkflow
CallerWorkflowB --> HandlerWorkflow
The callback is added to the list of completion callbacks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which new event? I am under the impression that a use-existing conflict policy will not make any new events if the workflow already exists. |
||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 object, it will attach the RequestID to the | ||
// existing running workflow (for deduping), and perform actions specified in the object. | ||
// 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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this needed for signal-with-start? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so, because for signal with start we're thinking that you care more about the signal than the start and we don't plan on attaching the Nexus operation to the workflow's lifecycle. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But this is a general purpose concept not specific to Nexus. In general everywhere a conflict policy is applied it'd make sense to apply conflict options IMO. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the case of signal with start, the goal is to signal the workflow if it's already running, not update it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the general idea of this being paired with a conflict policy makes sense for consistency reasons. I think your question could be rephrased as "does conflict policy make sense on signal with start", but since it was decided it does however that was decided, I think these options should go alongside them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see a use case for attaching callbacks and links to a running workflow on signal-with-start. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On conflict options is about what do to on conflict. Whether a use case exists for these first couple of options I don't think affects the fact that everywhere a conflict policy is applied, its conflict options should apply. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would still rather add this later. We don't plan on adding server support for this quite yet. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do think conflict policy and options need to be married (arguably if we needed both at the same time they would not have been separate objects). Supporting different conflict behaviors on different start calls is confusing. |
||
} | ||
|
||
message StartWorkflowExecutionResponse { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd mention that we plan to add options here as needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm adding explicitly the behaviors we want to implement at first already, so I think no need to update comment.