Call child workflow(with 2 activities) asynchronously and Wait for signal from child workflow’s activity1
Child workflow finishes activity 1, signals parent workflow to continue
Child workflow now continues with activity 2 while parent workflow continues with its execution
I am able to implement the same, but the issue is when activity 1 in child workflow throws a Application Failure, the same is not getting propagated to parent workflow at all.
Could you please let me know how the failure can be propagated to parent here. Any ref impls will help too.
I am able to implement the same, but the issue is when activity 1 in child workflow throws a Application Failure, the same is not getting propagated to parent workflow at all.
catch the application failure thrown by activity1 (note that depending on your activity options the activity might retry if application failure is retryable)
signal the parent workflow, to let it know the activity1 has failed.
rethrown the exception thrown by activity1 if you want to fail the child workflow
Thanks for replying Antonio.
I did try signalling the failure and then re throwing it, but in that case saga methods are not getting called correctly. The async workflow’s saga compensation doesn’t get called.
Anyways, I had similar use case for activities as well.
Call a long running activity asynchronously
Block parent until signal is received from this activity
Once signalled, proceed with other tasks
Here its the same again, if the async activity fails then parent is getting blocked waiting for the signal and eventually fails only when the heartbeat timeout occurs. But we would like to fail the workflow with correct failure and not the timeout that happened because of it.
Could you please let me know if there is any way of accomplishing this.