Shang provides automaton - a special data type that is a program with its own variables, whose execution can be halted and resumed, with running status and values of local variables retained. Automatons function as computers and can communicate with each other. They can help implement complicated control flows and event-driven programs.