36
firstRunID string,
37
originalRunID string,
39
>
event := b.createHistoryEvent(enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_STARTED, startTime)
40
>
req := request.StartRequest
41
>
42
>
// Versioning override might be set on the workflow service request if a user passes it to
43
>
// StartWorkflow options, or it might be set on the history service request if a workflow is
44
>
// continuing-as-new and inheriting a Pinned override. Use whichever of the two is non-nil.
45
>
nonNilVersioningOverride := req.GetVersioningOverride() // From user.
46
>
if nonNilVersioningOverride == nil {
47
>
nonNilVersioningOverride = request.GetVersioningOverride() // From server during continue-as-new.
48
>
}
49
50
>
attributes := &historypb.WorkflowExecutionStartedEventAttributes{
event_factory.go
51
>
WorkflowType: req.WorkflowType,
52
>
TaskQueue: req.TaskQueue,
53
>
Header: req.Header,
54
>
Input: req.Input,
55
>
WorkflowRunTimeout: req.WorkflowRunTimeout,
56
>
WorkflowExecutionTimeout: req.WorkflowExecutionTimeout,
57
>
WorkflowTaskTimeout: req.WorkflowTaskTimeout,
58
>
ContinuedExecutionRunId: prevRunID,
59
>
PrevAutoResetPoints: resetPoints,
60
>
Identity: req.Identity,
61
>
RetryPolicy: req.RetryPolicy,
62
>
Attempt: request.GetAttempt(),
63
>
WorkflowExecutionExpirationTime: request.WorkflowExecutionExpirationTime,
64
>
CronSchedule: req.CronSchedule,
65
>
LastCompletionResult: request.LastCompletionResult,
66
>
ContinuedFailure: request.GetContinuedFailure(),
67
>
Initiator: request.ContinueAsNewInitiator,
68
>
FirstWorkflowTaskBackoff: request.FirstWorkflowTaskBackoff,
69
>
FirstExecutionRunId: firstRunID,
70
>
OriginalExecutionRunId: originalRunID,
71
>
// Filter nil values here rather than in the API layer because not all
72
>
// creation paths go through the frontend (e.g. continue-as-new, child workflows, replication).
73
>
Memo: payload.FilterNilMemo(req.Memo),
74
>
SearchAttributes: payload.FilterNilSearchAttributes(req.SearchAttributes),
75
>
WorkflowId: req.WorkflowId,
76
>
SourceVersionStamp: request.SourceVersionStamp,
77
>
CompletionCallbacks: req.CompletionCallbacks,
78
>
RootWorkflowExecution: request.RootExecutionInfo.GetExecution(),
79
>
InheritedBuildId: request.InheritedBuildId,
80
>
VersioningOverride: worker_versioning.ConvertOverrideToV32(nonNilVersioningOverride),
81
>
Priority: req.GetPriority(),
82
>
InheritedPinnedVersion: request.InheritedPinnedVersion,
83
>
// We expect the API handler to unset RequestEagerExecution if eager execution cannot be accepted.
84
>
EagerExecutionAccepted: req.GetRequestEagerExecution(),
85
>
InheritedAutoUpgradeInfo: request.InheritedAutoUpgradeInfo,
86
>
DeclinedTargetVersionUpgrade: request.DeclinedTargetVersionUpgrade,
87
>
TimeSkippingConfig: req.GetTimeSkippingConfig(),
88
>
TimeSkippingStatePropagation: request.GetTimeSkippingStatePropagation(),
89
>
}
90
>
91
>
parentInfo := request.ParentExecutionInfo
92
>
if parentInfo != nil {
93
attributes.ParentWorkflowNamespaceId = parentInfo.NamespaceId
94
attributes.ParentWorkflowNamespace = parentInfo.Namespace