/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/Abilities/Tasks/AbilityTask.h
This is a lot of steps but in general, AbilityTask_SpawnActor() gives a clear, minimal example. Latent tasks are waiting on something. This is to differeniate waiting on the user to do something vs waiting on the game to do something. Tasks start WaitingOnGame, and are set to WaitingOnUser when appropriate (see WaitTargetData, WaitIiputPress, etc)
enum EAbilityTaskWaitState { WaitingOnGame = 0x01, WaitingOnUser = 0x02, WaitingOnAvatar = 0x04, }