1. Treat the deadline as a business rule
Define a small, documented mapping from lead stage to review interval. Avoid hiding timing rules across several nodes. A single mapping is easier to test, change, and explain.
{
"new": 1,
"contacted": 3,
"qualified": 2,
"nurture": 14
}
The numbers above are only an example in days. Your team should choose intervals based on its process, applicable rules, working hours, and service expectations.
2. Validate the input before calculating
Require a stable lead identifier, a known stage, a reference timestamp, and the consent state needed by your process. Reject unknown stages instead of assigning an arbitrary default that may create an incorrect task.
- Normalize the stage before looking it up.
- Parse the timestamp explicitly and reject invalid dates.
- Keep timezone assumptions documented.
- Block the outreach-related route when the required consent signal is missing.
3. Return a review task, not an outbound message
The workflow output can describe what needs review without contacting the lead. A useful response includes the lead identifier, calculated due time, normalized stage, and a status such as reminder_due or scheduled_for_review.
Do not attach email, SMS, advertising, or telemarketing nodes until the buyer has approved the channel, message, consent rules, suppression handling, and credentials.
4. Test time boundaries
Use synthetic fixtures for a reminder that is already due and for a case that must be blocked. Additional tests should cover an unknown stage, a malformed date, and a deadline exactly at the current comparison time.
- Freeze or document the test reference time.
- Calculate the expected deadline manually.
- Run the fixture and compare the exact timestamp.
- Confirm that missing consent produces a visible blocked result.
- Keep the workflow inactive until these checks pass in the buyer's environment.
5. Decide who owns the final action
A person, CRM queue, or separately approved automation may consume the review task. The template should not decide that governance question for the buyer. Document who may approve contact, which channel is allowed, and how opt-outs and suppression lists are enforced.