Child workflow call on failed activity

Hello.

I have an use case that is not clear to me the best way to solved.
I know that exist 2 ways to retry an Activity, one using RetryPolicy on activity options and another one using a custom function checking the activity result and executing the activity again till success or reach a threshold set by this custom method.

Now i’m using the first method, using activity options, but i want to execute a child workflow when the activity fails on the second retry for example, but i want that the activity keeps retrying until success or reach threshold.

Case #1 option where i don’t have to wait the child workflow response
In this case i just need a confirmation that the child workflow start an execution, but i don’t need the response. I choose a child workflow to maintain a history tied to the main workflow, and that child workflow is going to have their own retry mechanism but i don’t want to block the main workflow execution.

Case #2 I have to wait the child workflow to finish
If the case is that to continue the activity retries i have to wait the child workflow to finish to maintain the history.

What case is the correct one and how to achieve the goal to execute the child workflow.

thx

1 Like

I don’t understand how the options provided are related to the use case.

I see two ways to start a child workflow when an activity fails a specified number of times.

  1. Run the activity with a retry policy that specifies the number of retries after which the child has to be started. Then start a child workflow and then start the activity again with a retry policy that has no such limit.
  2. Workflow can wait on both activity completion and a signal. And the activity signals the workflow when is retried the configured number of times.