Adding Multiple Safety Guards to My Reminder System
Scheduling is not the difficult part
Creating a reminder for ten minutes or a day later is straightforward. The hard question is whether it is still appropriate when it becomes due.
Between planning and delivery, a lead may reply, ask for an appointment, choose a slot, opt out, close the conversation, or receive another reminder. A valid future action can become an inappropriate one without anything being wrong with its original schedule.
Re-evaluate reality
I prefer several eligibility checks rather than one optimistic decision at planning time:
plan reminder
โ load due candidate
โ validate current lead state and rule
โ final send guard
โ send
The final check is closest to the irreversible action. It should refuse to send if the lead is closed, opted out, already handled, or in a state where the reminder would interrupt another task.
Appointment selection is the clear example. If somebody is choosing from proposed slots, a qualification reminder is no longer helpful, even if an older reminder record is technically due.
Why repetition is appropriate here
I normally avoid duplicated business logic. Safety checks are different. A planner can prevent most invalid work, but a dispatcher should still refuse an invalid send. It is the same idea as validating input at an API boundary after a user interface already validated it.
What I learned
Scheduled automation cannot rely only on the world as it was when the action was planned. It must check the world that exists immediately before it acts.
What should happen next
I want incompatible reminders to be explicitly cancelled when a lead enters appointment selection or closes, rather than merely skipped when their due time arrives.