Super State Machine gives you utilities to build finite state machines.
conda install nsls2forge::super_state_machine