Introducing a newly revised Saga

Hi Ryan,

I think I can piece together your scenario, but I am missing some crucial pointers to be 100% sure what you are actually talking about.
Without diving into those though (guessing I can make the right assumption here), I will just go ahead with giving my recommendation when it comes to changing a Saga between production releases.

As you have rightfully put it, you are essentially changing a Saga, of which several would likely be serialized and stored in the Saga Store, into a new revision.
An option in here is to write upcasters to upcast the Saga instance from one revision to another.
Although doable (I have done this in the past), I can’t say it is a pleasant operation at the moment.

It requires quite some custom code on your end, either in the Serializer or in the SagaStore/SagaRepository to change a Saga from an older to a newer version.
Added, you will be required to build the Upcaster chain on your end too, as the current interfaces focus heavily on Event upcasting.
So, should you upcast a Saga? It is a fun and cool exercise to go through, but there are more pragmatic solutions out there.

The more efficient route you can take on your end is by keeping the old Saga implementation around. Let’s call it FooSaga_v1 for ease of explanation.
Now, you and the team have deduced that FooSaga_v1 doesn’t completely cut it and some additional state or event handlers are needed to correctly reflect this new approach.
Instead of adjusting FooSaga_v1 into FooSaga_v2, I would suggest adding FooSaga_v2 alongside FooSaga_v1.
Key here is to ensure not both v1 and v2 start new Sagas/Transaction upon releasing your product, so you will have to remove the @StartSaga annotation from the old version.

Doing so will mean your old Sagas keep running the complex business transaction they used to do, ending whenever this ends.
As soon as no more FooSaga_v1 entries are present in the saga_entry table you can simply drop the implementation in favor of v2.

That’s my two cents to this scenario. Hope this helps you and your team out Ryan!

Cheers,
Steven

PS. It is important to note that this mailing list will be discontinued as specified in this thread.
Instead of this mailing list we have moved over to use a forum style of communication, at https://discuss-next.axoniq.io/.

Hope to see you there!