What exactly is the difference between workflows and sagas? What are the pros and cons of each?
Thanks!
For reference, I'm using the NServiceBus Saga definition here: https://docs.particular.net/nservicebus/sagas/
At the highest level, workflows tend to be modeled as a set of activities invoked in some sequence where the completion of one activity flows directly into the start of the next activity.
Sagas tend to be modeled as a statefull "object" where changes to that state are triggered by discrete messages - the completion of handling one message does not flow directly into the handling of another message.
While both sagas and workflows can be used to model various types of processes, sagas tend to shine when it comes to long-running processes as well as those processes requiring a high degree of consistency (like in a collaborative environment).