Skip to content

Commit ae2d377

Browse files
committed
Ensure subworkflow schedule commands use right workflow instance on replay
1 parent f5b5caf commit ae2d377

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/workflow/executor.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,10 @@ func (e *executor) handleSubWorkflowScheduled(event history.Event, a *history.Su
434434
return fmt.Errorf("previous workflow execution scheduled different type of sub workflow: %s, %s", a.Name, sswc.Name)
435435
}
436436

437+
// If we are replaying this event, the command will have generated a new instance ID. Ensure we use the same one as
438+
// when the command was originally committed.
439+
sswc.Instance = a.SubWorkflowInstance
440+
437441
c.Done()
438442

439443
return nil

0 commit comments

Comments
 (0)