Is this the right approach for reminders

Hi,

I have a table which has pet data, one of the field is ‘date_of_birth’. I need to send birthday wishes for these pets. I am thinking of doing it this way. Can you let me know if there is a better way in terms of WUs.

  1. I search for pets whose day is curdate:extract date and month is curdate:extract month and last wished is not curdate:extract year
  2. send a mail
  3. update last wished to curdate:extract year
  4. Schedule this workflow if there exist any pets whose day is curdate:extract date and month is curdate:extract month and last wished is not curdate:extract year

I run this workflow once a day



You are performing one search per pet. That’s underperfoming.

Just do SAWOL (Schedule an API workflow on a list) on API workflow birthdayreminders with the list of Pets fulfilling

  • date = Current date/time:extract date
  • month = Current date/time:extract month

There’s no need for field Pets' LastWished.

This way your are saving yourself of doing N searches when you have N Pets to act on a certain date + modifying Pets records to update the LastWished field.

Total WU saves are

  • 0.3 * (N-1) → Performing one search vs N Not sure if server performs the search just once, as constraints are the same, just like client-side does. It think it does not.
  • 0.5 * N → Modifying N Pets records for updating field LastWished
  • 0.1 * (N-1) → Scheduling one API workflow vs N
1 Like

SAWOL will be fine here up to 100k records per search (doubt you’ll exceed 100k dogs with the same month & date anytime soon)

you’d want to send it using postmark or similar api email provider also so the email sends are managed and spaced out a bit slower than SAWOL might run. and also so you get email log reports and can track opens and manage unsubscribes etc

you may also want to add rules so that emails only send within certain hours or to certain segments (ie users subscribed to marketing)

1 Like

I would have a recursive daily workflow that schedules itself to run every 24 hours.

Have another workflow ‘Send Birthday Email’.

Inside the recursive daily workflow, Schedule API workflow on a list of Pets where

Inside ‘Send Birthday Email’ send the email you want and do whatever you want. As @ademiguel points out, the last wishes is redundant.