feat: allow UseExisting conflicts policy#763
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3176fedab5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ($request->getWorkflowIdConflictPolicy() === WorkflowIdConflictPolicy::UseExisting->value) { | ||
| return $execution; |
There was a problem hiding this comment.
Do not treat closed-run reuse failures as UseExisting successes
When UseExisting is set but the duplicate is a previously closed execution, the service can still return WorkflowExecutionAlreadyStartedFailure because the workflow ID reuse policy rejects the closed run (for example the default AllowDuplicateFailedOnly after a successful completion, or RejectDuplicate). This branch checks only the conflict policy, so it returns a handle to that closed run instead of throwing WorkflowExecutionAlreadyStartedException, making start()/signalWithStart() report success even though no running workflow was reused.
Useful? React with 👍 / 👎.
What was changed
Why?
Allows re-use duplicated flows if necessary
Checklist
Closes
How was this tested: