From ee34197b84344d867bfb0da54eccf01a4d683292 Mon Sep 17 00:00:00 2001 From: Arithran Thurairetnam Date: Mon, 22 Jul 2024 13:46:37 -0700 Subject: [PATCH] Fix non-deterministic error when resetting a parent workflow with a child workflow Includes the following change from cadence: https://github.com/uber-go/cadence-client/pull/1118 Fixes the following community issue: : https://github.com/temporalio/sdk-go/issues/723 --- internal/internal_event_handlers.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/internal_event_handlers.go b/internal/internal_event_handlers.go index d60e82d2b..538343f85 100644 --- a/internal/internal_event_handlers.go +++ b/internal/internal_event_handlers.go @@ -553,7 +553,11 @@ func (wc *workflowEnvironmentImpl) ExecuteChildWorkflow( params ExecuteWorkflowParams, callback ResultHandler, startedHandler func(r WorkflowExecution, e error), ) { if params.WorkflowID == "" { - params.WorkflowID = wc.workflowInfo.WorkflowExecution.RunID + "_" + wc.GenerateSequenceID() + if wc.workflowInfo.OriginalRunID != "" { + params.WorkflowID = wc.workflowInfo.OriginalRunID + "_" + wc.GenerateSequenceID() + } else { + params.WorkflowID = wc.workflowInfo.WorkflowExecution.RunID + "_" + wc.GenerateSequenceID() + } } memo, err := getWorkflowMemo(params.Memo, wc.dataConverter) if err != nil {