Worker with state vs Cache + Worker

I would say when to use gen_statem:

  1. you’re modeling an external “real thing” that you have limited control over, or stateful communications protocol.
  2. there are recurrent events that must be asynchronous (eg you have to check on your external thing and you don’t know when the response will come back)
  3. your model is not transient (if your process crashes you want to recover, and you can’t just throw it away and start from scratch)

If all do not apply, do not use gen_statem.