478
newRunID string,
479
command *commandpb.ContinueAsNewWorkflowExecutionCommandAttributes,
481
>
event := b.createHistoryEvent(enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW, b.timeSource.Now())
482
>
attributes := &historypb.WorkflowExecutionContinuedAsNewEventAttributes{
483
>
WorkflowTaskCompletedEventId: workflowTaskCompletedEventID,
484
>
NewExecutionRunId: newRunID,
485
>
WorkflowType: command.WorkflowType,
486
>
TaskQueue: command.TaskQueue,
487
>
Header: command.Header,
488
>
Input: command.Input,
489
>
WorkflowRunTimeout: command.WorkflowRunTimeout,
490
>
WorkflowTaskTimeout: command.WorkflowTaskTimeout,
491
>
BackoffStartInterval: command.BackoffStartInterval,
492
>
Initiator: command.Initiator,
493
>
Failure: command.Failure,
494
>
LastCompletionResult: command.LastCompletionResult,
495
>
// Filter nil values here rather than in the API layer because not all
496
>
// creation paths go through the frontend (continue-as-new, child workflows, replication).
497
>
// This CaN event is created on the source workflow, so we need to filter nil values here.
498
>
Memo: payload.FilterNilMemo(command.Memo),
499
>
SearchAttributes: payload.FilterNilSearchAttributes(command.SearchAttributes),
500
>
InheritBuildId: command.InheritBuildId, //nolint:staticcheck // SA1019: worker versioning v0.2
501
>
}
502
>
event.Attributes = &historypb.HistoryEvent_WorkflowExecutionContinuedAsNewEventAttributes{
503
>
WorkflowExecutionContinuedAsNewEventAttributes: attributes,
504
>
}
505
>
return event
506
>
}
507
508
func (b *EventFactory) CreateTimerStartedEvent(