Rollback a long workflow transaction in case of any failure. (reposted from slack channel) #4648
-
My question is around compensation logic and rollback in case of failures in activities. Consider a scenario like this. I have a workflow which is listening for some signal. When that signal is received, I need to perform ‘n’ number of operations which include making some external API calls, making some DB updates and updating the workflow state. I would like to have different activities to perform these tasks. Now lets say there is an error while doing any of these tasks, I would like to roll back to the previous state of my workflow, including DB rollbacks(if I have made any). What would be the best way to implement such logic inside my workflow? I was looking at the compensation example but that example is handling failures in individual activities, in my case, I want to roll back potentially several activities at once. I am using Java SDK |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Some points from myself:
|
Beta Was this translation helpful? Give feedback.
Some points from myself: