I making a PoC with temporal which include a main workflow which spawn a child workflow. I used the SAGA pattern to compensate the activities in the main workflow, but I’m wondering how I could compensate the activities in the child workflow.
Changing the ParentClosePolicy does not seem to have an impact on the child, as the child finish before the end of the parent workflow.
And as you cannot have several methods in a workflow, I can’t call a compensate method in the child workflow.
So I guess I have to write another child workflow for compensation which will try to erase any steps that may have be done by the first child workflow. And I would need to call this compensation workflow in the error handling of the main workflow.
But is there a better way to do it ?