Scheduled API WF, recurring event, or cronjob?

From my understnding, there are 3 ways to do scheduled tasks, e.g. sending a reminder for a task ends.

  1. When creating a task, create a scheduled API WF before the task’s end date. Save the API WF ID. When the end date is updated, delete the scheduled API WF and schedule another WF and save the ID.

  2. Create a recursive WF API to get all the tasks that are ending and set up a daily recurring event that executes the WF.

  3. Create a public recursive WF API to get all the tasks that are ending and set up an external cronjob that executes the WF.

I am leaning toword option 3. What is your thought?

Why overcomplicate it?

For 1, have a DB trigger that watches the Task and runs only when Task know’s date is not Task before change’s date.

Then, cancel the scheduled workflow (the ID should be saved to the task), and schedule a new one to run X days before the new date, saving the new scheduled workflow ID to the Task.

No need to add actions in the frontend, just create the task, and any time the date is modified from anywhere in the app, the reminder will be updated

1 Like