Description
What content needs to be created or modified?
There is a particular nuance in Dapr Workflows (and Azure Durable Functions too) which leads people to believe that when the code is awaiting multiple external event Tasks in a when any pattern, once a single Task has been completed and a winner has been determined, then the non-winning task won't consume an event.
This is not true. The non-winning Task will continue to consume an event if such a matching event was to be raised throughout the life of the workflow instance, even though the workflow has advanced beyond the initial when any.
This problem is particularly evident when waiting for the same event (same event name) in a loop, here is an example an individual suspecting this is a bug, however it is not. - It's worth adding that this issue was created off the back of a user on Discord relaying their concern.
The guidance should be to use an Eternal Workflow pattern with ContinueAsNew
, as this will remove any incomplete tasks and ensure that tasks are allocated correctly.
Describe the solution you'd like
Better docs to outline the above problem. The problem is almost touched on here, but this particular nuance is missed
Where should the new material be placed?
possibly here
The associated pull request from dapr/dapr, dapr/components-contrib, or other Dapr code repos