From cc8a67413ceec1b6a57180dedb33e17bc22a9c7c Mon Sep 17 00:00:00 2001 From: Quanzheng Long Date: Tue, 22 Oct 2024 13:42:21 -0700 Subject: [PATCH] Use firstRunId for workflow context (#462) --- service/interpreter/cadence/workflowProvider.go | 2 +- service/interpreter/workflowImpl.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/service/interpreter/cadence/workflowProvider.go b/service/interpreter/cadence/workflowProvider.go index 86900e68..fb02b7f5 100644 --- a/service/interpreter/cadence/workflowProvider.go +++ b/service/interpreter/cadence/workflowProvider.go @@ -85,7 +85,7 @@ func (w *workflowProvider) GetWorkflowInfo(ctx interpreter.UnifiedContext) inter }, WorkflowStartTime: time.UnixMilli(0), // TODO need support from Cadence client: https://github.com/uber-go/cadence-client/issues/1204 WorkflowExecutionTimeout: time.Duration(info.ExecutionStartToCloseTimeoutSeconds) * time.Second, - FirstRunID: "", // Cadence does not provide FirstRunID + FirstRunID: info.WorkflowExecution.RunID, // Cadence does not provide FirstRunID TODO https://github.com/uber-go/cadence-client/issues/1371 use firstRunID when available } } diff --git a/service/interpreter/workflowImpl.go b/service/interpreter/workflowImpl.go index ff85e667..1e02c0b0 100644 --- a/service/interpreter/workflowImpl.go +++ b/service/interpreter/workflowImpl.go @@ -461,10 +461,10 @@ func executeState( executeApi = StateApiExecute } - info := provider.GetWorkflowInfo(ctx) // TODO use firstRunId instead + info := provider.GetWorkflowInfo(ctx) executionContext := iwfidl.Context{ WorkflowId: info.WorkflowExecution.ID, - WorkflowRunId: info.WorkflowExecution.RunID, + WorkflowRunId: info.FirstRunID, WorkflowStartedTimestamp: info.WorkflowStartTime.Unix(), StateExecutionId: &stateExeId, }