Skip to main content

State Machine


What is it

A finite-state machine (FSM) or finite-state automaton (FSA, plural: automata), finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time.

When to use it

Use it when you have complex flows in your application and want to make sure that that the entity which is moving through your flow can be in exactly one of finite and well defined states at a time (e.g. an auth flow of a user).

How to learn it