Dynamic scheduling

backend: Xano

im wanting to implement a dynamic scheduling function

I have contacts, groups and flows database in xano

a group has contacts
a flow has a group

a flow looks like

  1. send email after 3 days
  2. send SMS after 6 days
  3. send email after 10 days

i want it to pick up that someone new has been added to the group and will start them at the beginning of the flow.

is this possible?

Yes, Xano makes something like this doable. It also gives you plenty of different approaches.

Is flow always the same schedule or does it change?
If it’s always the same, something like this to get started…

Chron job each hour
JOIN query on Group and Users
Loop over users where User.9day = null

If User.3day(timestamp) = null AND User.Signup(timestamp) > now-3 days

Send Email
Update User.3day = now

If User.3day(timestamp) = notnull AND > now-3days AND User.6day = null

Send SMS
Update User.6day = now

If User.6day(timestamp) > now-4days AND User.9day = null

Send Email
Update User.9day = now

End loop

Build in some error handling should the email or SMS API fail.

Good luck :+1:

@Rozza the user can create the flow themselves they can choose whether it is a SMS or email the content and the amount of time after the contact will receive the email.

I’m very. new with xano so simplifying it would be awesome. I’ve managed to build everything else just struggling with this.

do you think you would have time to show me over a google meet or anything?

OK, more complex perhaps, but I suggest a simpler solution.

When the user is added to the group, loop over flow add rows in a table comms_scheduled

comms_scheduled
user(ref),
flow(ref),
scheduled(date/time),
sent (bool)

then use a chron job to loop over comms_scheduled filtering out those already sent and not due to be sent yet. Fire off the API calls for SMS and Email accordingly. Referencing flow.type[email,sms], flow.title, flow.body etc. You could also add Push notifications fairly easily.

So each user added to a group would create 3 new rows in comms_scheduled
If a user is removed from a group then you will need to delete the rows from comms_scheduled

Yes I’m happy to help if you need some more guidance. To book a slot… Link in my bio.