Open sfmskywalker opened 3 years ago
We will still keep publishing notifications from the workflow runner, but these would be handled by (optional) handlers.
Glad to hear this since I just wrote one big handler to bunch of workflow notifications writing stuff to logs and publishin execution metrics to external system :)
Yes, that’s exactly the kind of thing events will stick around for :)
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.