546
// Mirrors the gate in closeTransactionHandleWorkflowTaskScheduling.
547
if ms.IsWorkflowExecutionRunning() && !ms.IsWorkflowExecutionStatusPaused() {
548
>
if request.GetForceCreateNewWorkflowTask() || // Heartbeat WT is always of Normal type.
api.go
549
>
wtFailedShouldCreateNewTask ||
550
>
hasBufferedEventsOrMessages ||
551
>
activityNotStartedCancelled ||
552
>
// If the workflow has an ongoing transition to another deployment version, we should ensure
553
>
// it has a pending wft so it does not remain in the transition phase for long.
554
>
ms.GetDeploymentTransition() != nil {
555
556
newWorkflowTaskType = enumsspb.WORKFLOW_TASK_TYPE_NORMAL
557
558
>
} else if updateRegistry.HasOutgoingMessages(true) {
api.go
559
// There shouldn't be any sent updates in the registry because
560
// all sent but not processed updates were rejected by server.