cschleiden / go-workflows

Embedded durable workflows for Golang similar to DTFx/Cadence/Temporal
https://cschleiden.github.io/go-workflows/
MIT License
229 stars 49 forks source link

questions about versioning, migrations and stop/resume use cases #356

Closed rullyalves closed 4 months ago

rullyalves commented 4 months ago

Hello, first I would like to thank you for the great library, it offered me a great way to solve a problem that was causing me pain

I have some questions about implementation and specific use cases, could you help me?

1 - there are use cases where a workflow can be started, paused for a long time and then resume execution, if an activity calculates a volatile value, such as a user's account balance, is there any way to restart the workflow if it takes a long time to execute? I thought about using "continueAsNew" for this, but it would restart the entire workflow and not just specific activities I thought about using continueAsNew to enable migrations without filling the code with if/else conditions, would it be viable to use continueAsNew for this? Or would it be better to keep previous versions of activities/workflows?

2 - about migrations, previously you answered that you could send the version as a parameter, but how do I know that all the workflows in the previous version have already been executed and that I can remove the old code without generating problems?

3 - I'm working with multiple instances, in case of migrations, what would be the best way to synchronize migrations between instances? Do I have any risks if I don't synchronize them?

Finally, how could I contribute to the library? I thought the work was really magnificent and I would like to help with the features

rullyalves commented 4 months ago

I'm moving this to discussions