diff --git a/service/history/historyEngine.go b/service/history/historyEngine.go index f68c64bb5ce..9ff63f4d898 100644 --- a/service/history/historyEngine.go +++ b/service/history/historyEngine.go @@ -1,4 +1,5 @@ -// Copyright (c) 2017 Uber Technologies, Inc. +// Copyright (c) 2017-2021 Uber Technologies, Inc. +// Portions of the Software are attributed to Copyright (c) 2021 Temporal Technologies Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -2399,6 +2400,9 @@ func (e *historyEngineImpl) RecordChildExecutionCompleted( if !isRunning || ci.StartedID == common.EmptyEventID { return &types.EntityNotExistsError{Message: "Pending child execution not found."} } + if ci.StartedWorkflowID != completedExecution.GetWorkflowID() { + return &types.EntityNotExistsError{Message: "Pending child execution not found."} + } switch *completionEvent.EventType { case types.EventTypeWorkflowExecutionCompleted: