Probably not exactly what you are thinking of but my project Restate is all about building backends using state machines by saving them and their transitions to the database: https://github.com/fabianlindfors/restate
Thank you for sharing! Any resource to understand how others have solved or approached this problem is valuable.