Use DFA(deterministic finite automaton) to calculate node situation to show running status. Try to use transitions library.