Open dhiaayachi opened 2 months ago
Thank you for the feature request! This is a great idea for simplifying the process of handling duplicate workflow IDs.
Currently, Temporal doesn't have a "Queue Duplicate" policy built in. However, you can achieve a similar result by using a combination of a dedicated task queue and a Signal workflow pattern.
This approach will allow you to effectively queue workflows that would otherwise be rejected due to duplicate IDs, while maintaining a degree of observability through the signal workflow's status.
Let me know if you have any other questions!
Thank you for the feature request!
Currently, Temporal doesn't have a "Queue Duplicate" policy built-in. You can achieve a similar behavior using a combination of the "Reject Duplicate" policy with a custom retry policy for your Workflow.
Here's a potential approach:
This way, if a duplicate Workflow ID is submitted, Temporal will reject the request, and your Workflow will retry after a designated delay. This can be useful to ensure that all tasks are eventually processed.
Please let me know if you have any other questions.
Thank you for the feature request! This is a great suggestion for making it easier to manage duplicate workflows.
While we don't have this functionality built-in yet, you can achieve a similar effect using the "master-workflow + signal + child-workflow" pattern you mentioned. While this adds some complexity, it allows you to maintain control over the queued workflows:
This approach provides a way to handle duplicate workflows while maintaining observability and flexibility. Let us know if you have any other questions.
Is your feature request related to a problem? Please describe. N/A
Describe the solution you'd like Currently, when a duplicate Workflow ID is submitted and the "Reject Duplicate" policy is used (default), the SDK raises an exception, which is the desired behavior. It would be useful to add a new reuse policy like "Queue Duplicate" where the workflow would be queued (with a new state like "Queued").
Describe alternatives you've considered The alternative is to use the "master-workflow + signal + child-workflow" recipe, which reduces the observability (i.e. the UI can't be used to see what workflows are queued) and increases the design complexity for simple use-cases.
Additional context N/A