375
376
// Get transient/speculative workflow task events if present
378
>
if workflowTask := mutableState.GetPendingWorkflowTask(); workflowTask != nil {
379
transientOrSpeculativeTasks = mutableState.GetTransientWorkflowTaskInfo(workflowTask, "")
380
>
} else if workflowTask := mutableState.GetStartedWorkflowTask(); workflowTask != nil {
get_workflow_util.go
381
transientOrSpeculativeTasks = mutableState.GetTransientWorkflowTaskInfo(workflowTask, "")
382
}
383
385
>
Execution: &commonpb.WorkflowExecution{
386
>
WorkflowId: mutableState.GetExecutionInfo().WorkflowId,
387
>
RunId: mutableState.GetExecutionState().RunId,
388
>
},
389
>
WorkflowType: &commonpb.WorkflowType{Name: executionInfo.WorkflowTypeName},
390
>
LastFirstEventId: lastFirstEventID,
391
>
LastFirstEventTxnId: lastFirstEventTxnID,
392
>
NextEventId: mutableState.GetNextEventID(),
393
>
PreviousStartedEventId: mutableState.GetLastCompletedWorkflowTaskStartedEventId(),
394
>
TaskQueue: &taskqueuepb.TaskQueue{
395
>
Name: executionInfo.TaskQueue,
396
>
Kind: enumspb.TASK_QUEUE_KIND_NORMAL,
397
>
},
398
>
StickyTaskQueue: &taskqueuepb.TaskQueue{
399
>
Name: executionInfo.StickyTaskQueue,
400
>
Kind: enumspb.TASK_QUEUE_KIND_STICKY,
401
>
NormalName: executionInfo.TaskQueue,
402
>
},
403
>
StickyTaskQueueScheduleToStartTimeout: executionInfo.StickyScheduleToStartTimeout,
404
>
CurrentBranchToken: currentBranchToken,
405
>
WorkflowState: workflowState,
406
>
WorkflowStatus: workflowStatus,
407
>
IsStickyTaskQueueEnabled: mutableState.IsStickyTaskQueueSet(),
408
>
VersionHistories: versionhistory.CopyVersionHistories(
409
>
mutableState.GetExecutionInfo().GetVersionHistories(),
410
>
),
411
>
FirstExecutionRunId: executionInfo.FirstExecutionRunId,
412
>
AssignedBuildId: mutableState.GetAssignedBuildId(),
413
>
InheritedBuildId: mutableState.GetInheritedBuildId(),
414
>
MostRecentWorkerVersionStamp: mostRecentWorkerVersionStamp,
415
>
TransitionHistory: transitionhistory.CopyVersionedTransitions(mutableState.GetExecutionInfo().TransitionHistory),
416
>
VersioningInfo: common.CloneProto(mutableState.GetExecutionInfo().VersioningInfo),
417
>
TransientOrSpeculativeTasks: transientOrSpeculativeTasks,
418
>
}, nil
419
}