elsa-workflows / elsa-workflows/elsa-core
Revise Workflow Runner with Chain of Command strategy
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
Currently, the `WorkflowRunner` publishes a bunch of notifications (using MediatR) at various stages of activity execution. A great advantage of this is that many aspects of workflow execution become decoupled. For example, persisting workflow instances after a burst of execution is handled by a notification handler.
But this implementation also poses some challenges. The biggest one being unable to control the order in which event handlers execute for the same event as discussed in #1204.
This is a clear sign that the event model isn't the most appropriate one for handling key-workflow engine steps.
Instead, a Chain of Command strategy seems more appropriate to orchestrate key-steps, since it allows not only extensibility of the workflow processing, but also the order in which they occur.
We will still keep publishing notifications from the workflow runner, but these would be handled by (optional) handlers.
Contributor guide
Assessment
This issue has not been assessed yet.