Skip to content

Commit

Permalink
Moving original / first run id from WorkflowExecution to WorkflowInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
edmondop committed Apr 16, 2023
1 parent 3d0f9be commit f509d36
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions internal/internal_task_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,11 +573,11 @@ func (wth *workflowTaskHandlerImpl) createWorkflowContext(task *workflowservice.
}
workflowInfo := &WorkflowInfo{
WorkflowExecution: WorkflowExecution{
ID: workflowID,
RunID: runID,
OriginalRunID: attributes.OriginalExecutionRunId,
FirstRunID: attributes.FirstExecutionRunId,
ID: workflowID,
RunID: runID,
},
OriginalRunID: attributes.OriginalExecutionRunId,
FirstRunID: attributes.FirstExecutionRunId,
WorkflowType: WorkflowType{Name: task.WorkflowType.GetName()},
TaskQueueName: taskQueue.GetName(),
WorkflowExecutionTimeout: common.DurationValue(attributes.GetWorkflowExecutionTimeout()),
Expand Down
8 changes: 4 additions & 4 deletions internal/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,8 @@ type (

// WorkflowExecution details.
WorkflowExecution struct {
ID string
RunID string
OriginalRunID string // The original runID before resetting. Using it instead of current runID can make workflow decision determinstic after reset. See also FirstRunId
FirstRunID 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.
ID string
RunID string
}

// EncodedValue is type used to encapsulate/extract encoded result from workflow/activity.
Expand Down Expand Up @@ -947,6 +945,8 @@ func (wc *workflowEnvironmentInterceptor) ExecuteChildWorkflow(ctx Context, chil
// WorkflowInfo information about currently executing workflow
type WorkflowInfo struct {
WorkflowExecution WorkflowExecution
OriginalRunID string // The original runID before resetting. Using it instead of current runID can make workflow decision determinstic after reset. See also FirstRunId
FirstRunID 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.
WorkflowType WorkflowType
TaskQueueName string
WorkflowExecutionTimeout time.Duration
Expand Down

0 comments on commit f509d36

Please sign in to comment.