I am working on a temporal workflow with a few child workflows. I want to update WorkflowID of one of the child workflows while workflows are running.
func (w Workflow) ParentWorkflow(ctx workflow.Context, parentWorkflowRequest models.ParentWorkflowRequest) error {
...
cwo := workflow.ChildWorkflowOptions{
WorkflowTaskTimeout: time.Minute,
}
childctx := workflow.WithChildOptions(ctx, cwo)
err = workflow.ExecuteChildWorkflow(childctx, w.ChildWorkflow, childWorkflowRequest).Get(childctx, nil)
if err != nil {
return err
}
I want change ChildWorkflowOptions from
cwo := workflow.ChildWorkflowOptions{
WorkflowTaskTimeout: time.Minute,
}
to
cwo := workflow.ChildWorkflowOptions{
WorkflowTaskTimeout: time.Minute,
WorkflowID: GetChildWorkflowID("hostname"),
}
I see after changes, workflow fails with following error:
A non-deterministic error has caused the Workflow Task to fail. This usually means the workflow code has a non-backward compatible change without a proper versioning branch.
Can we handle this change with versoning? I do not see a guide or example for workflow option updates that could be supported with versioning.