SDK Reference
Go SDK
Child Workflows

Child Workflows

Child workflows can be spawned from an existing ctx object:

childWorkflow, err := ctx.SpawnWorkflow("child-workflow", childInput, &worker.SpawnWorkflowOpts{})
 
if err != nil {
    return nil, err
}

The SpawnWorkflow method returns a ChildWorkflow object that can be used to wait for the completion of the child workflow:

childResult, err := childWorkflow.Result()
 
if err != nil {
    return nil, err
}