Perpetual workflows - one per customer

I am currently evaluating Temporal and I’m considering how to use it in our domain - Utilities.

Would it be a bad design to treat every customer we have (millions) as an individual separate and perpetual workflow? As long as they remain a customer.

We would have a number of child workflows that require human intervention (signals) either by our customers or by internal employees:

  • double opt in
  • various during the onboarding / sales process
  • risk management
  • extending customer delivery contracts

Or is there a better way to model this?

It is hard to give 100% reliable recommendation without understanding the details of the use case. Having a perpetual workflow per customer (we call them entity workflow) is a common pattern. Temporal has no performance problems with billions of open workflows. So millions is absolutely fine.

1 Like