diff --git a/internal/internal_task_handlers.go b/internal/internal_task_handlers.go index 0dcf44ee5..295b8d46b 100644 --- a/internal/internal_task_handlers.go +++ b/internal/internal_task_handlers.go @@ -576,6 +576,8 @@ func (wth *workflowTaskHandlerImpl) createWorkflowContext(task *workflowservice. ID: workflowID, RunID: runID, }, + OriginalRunID: attributes.OriginalExecutionRunId, + FirstRunID: attributes.FirstExecutionRunId, WorkflowType: WorkflowType{Name: task.WorkflowType.GetName()}, TaskQueueName: taskQueue.GetName(), WorkflowExecutionTimeout: common.DurationValue(attributes.GetWorkflowExecutionTimeout()), diff --git a/internal/workflow.go b/internal/workflow.go index 3abbd86f4..d3f6093d1 100644 --- a/internal/workflow.go +++ b/internal/workflow.go @@ -944,7 +944,11 @@ func (wc *workflowEnvironmentInterceptor) ExecuteChildWorkflow(ctx Context, chil // WorkflowInfo information about currently executing workflow type WorkflowInfo struct { - WorkflowExecution WorkflowExecution + WorkflowExecution WorkflowExecution + // The original runID before resetting. Using it instead of current runID can make workflow decision deterministic after reset. See also FirstRunId + OriginalRunID string + // The very first original RunId of the current Workflow Execution preserved along the chain of ContinueAsNew, Retry, Cron and Reset. Identifies the whole Runs chain of Workflow Execution. + FirstRunID string WorkflowType WorkflowType TaskQueueName string WorkflowExecutionTimeout time.Duration