Closed stephanos closed 6 months ago
(I have avoided this PR because it is not marked ready for review, but let me know if we should review anyways)
@cretz I was going to open the PR for review once I implemented the Server implementation, as I understand that's minimum requirement to get API changes merged. Having said that, I don't mind getting feedback now.
I just pushed another set of changes to StartWorkflowExecutionResponse
and SignalWithStartWorkflowExecutionResponse
. It now includes details about what action(s) were actually taken by the operation.
I'd appreciate another review of that new addition.
What changed?
Introducing the
WorkflowIdConflictPolicy
enum to define the dedup behavior of Start Workflow for a running workflow - and solidifying theWorkflowIdReusePolicy
as the dedup behavior for closed workflows.NOTE: Terminate-If-Running will be deprecated once all API, Server and SDK changes have been merged since otherwise users wouldn't be able to use the new enum but see a deprecation notice already.
Implementations:
Why?
This is in preparation for Update-With-Start; so that the user can indicate that an already-running Workflow is not a failure. By adding this conflict resolution mechanism directly to Start Workflow itself, it allows to combine arbitrary operations, such as Update and Signal, with Start - instead of requiring hard-coded top-level APIs like Signal-With-Start.
Without the new enum, the Server wouldn't know whether the user requested a "Maybe Start" (ie continue when Start failed because of another running Workflow with the same ID) or a "Require Start" (ie stop when Start failed because of another running Workflow with the same ID).
Breaking changes