Activity Timeouts and child workflows

We have an activity that is responsible for triggering a number of “child” workflows and then waiting for them to all complete before returning. If this activity times out because the worker is not available and then retries again when the worker is available, what is the best way to handle all of the “child” workflows that have already been started.

  1. If the Activity retries the same “child” workflows will be created again.
  2. Is there a way to force the existing child workflows to fail to ensure there are not duplicates running when the activity re-creates them again?

Your best bet here is to simply invoke Child Workflows from the Parent Workflow.
That will solve your problem I believe, because the code that invokes the Child Workflows will never be “executed” twice.

And Workflow Execution Ids are guaranteed to be unique, i.e. if you invoke a Child Workflow Execution with a specific Id, then it won’t ever be “re-invoked” while it is executing. (make sure you are using the proper Workflow Id Reuse Policy Workflows | Temporal documentation )

Thanks Cully