// AddNextStateMachineTimerTask generates a state machine timer task if the first deadline doesn't have a task scheduled
// yet.
// filter out empty timer groups
timers := ms.GetExecutionInfo().StateMachineTimers
timers = slices.DeleteFunc(timers, func(timerGroup *persistencespb.StateMachineTimerGroup) bool {
return len(timerGroup.Infos) == 0
})
if len(timers) == 0 {
return
}