Hi,
Have a look at my Raft Concensus State Machine demo. This may give you some inspiration…In this FSM, each process instance is in states leader, follower, election…hence as events come in, the way each process reacts depends on the state its in…
regards
Rob