Scheduling a lot of workflows vs A single Cron

So we have a use case where we want to schedule notifications for our users.

The admin sets up a target audience with a message body and schedules it to be sent in one of tow ways:

  1. One time delayed execution
  2. Periodic execution

The immediate design I came up with is to link the definition of the schedule one to one with a scheduled workflow and update the workflow whenever the relevant definition change or delete it when the scheduled notification is deleted.

We use k8 and temporal is deployed as part of our k8 cluster

I was wondering is there a computation concern or limit to the amount of scheduled workflows. I assume each schedule has its timer that can take up resources… Maybe something else …

Any way there is another option I am Les fund of and it’s to create a single 10 min interval that will fetch from our db the required notifications to be sent and the send them, that way we have a single timer but the resolution of the schedule is 10 min, most of the time we will scan our DB for nothing and finally we batch messages into 10 min which can cause in some cases rate limit invocation from our 3rd party like MailChimp …

Would love to hear from any who has similar experience.

There is no limit to the number of scheduled workflows. Most Temporal systems have to be provisioned to run a needed number of actions per second, so if all of your schedules fire at the same time, you can overload a system.

1 Like