What happens with long automation if HA restarts?

FWIW, I use two different methods for ensuring a time delay survives a restart:

  1. The one Hellis81 described (future-dating an input_datetime used by a Time Trigger).

  2. Timers that survive restarts using this system.

The method I use depends on whichever one is easier to implement for a given application.