In one of my case, I want to create multiple child workflows from one parent workflow. In the workflow implementation method, should I add some logic to handle the retry and failure of child workflow creation? For example, I want to create 10 child workflows with id from 1 to 10 in a for loop. If during the loop, one workflow failed to create, should I utilize some way to retry that and avoid duplicated creation?
The only reason the child workflow creation fails is the existence of another workflow with the same workflow ID. If you use default IDs, which are guaranteed to be unique, there is no need to do any failure handling logic around child creation.
Thank you for explaining that. One of my concern is, for example, if I try the following code in workflow implementation:
for (int i = 0; i < 10; i++) {
createChildWorkflow(i);
}
But during the execution, one child workflow failed to create because of the network issue when i equals 4. Then part of the child workflows get created successfully. Now should I utilize some way to rerun the process and skip the created workflows? Or is this the case that will never happen?
, one child workflow failed to create because of the network issue
Child workflow creation cannot fail due to network issue. Temporal internally retries it until it succeeds.