Follow-up — Automated Re-engagement
Purpose
This page explains HUPH's Follow-up system: automation that sends re-engagement messages to leads who fall silent at critical funnel stages (e.g. applied but forgot to pay). Intended for marketing staff and counselors who configure re-engagement rules and monitor the send queue.
Prerequisites
- Logged in as marketing or counselor
- Understand Leads pipeline — stages and enum
- Aware of the WhatsApp 24h window constraint (explained below)
The WhatsApp 24h Window Constraint
The WhatsApp Business API (360dialog) has strict rules:
- Within 24 hours of the last user message → free-form text allowed (anything)
- After 24 hours → must use pre-approved Template Messages (Meta review takes 2–7 days)
HUPH's follow-up system accounts for this — re-engagement rules always check the last-message timestamp and pick the right template.
Steps
1. Open Follow-up
Click Follow-up in the sidebar (URL: /admin/follow-up). The
page has 3 tabs: Queue, Rules, Stats.
2. Queue tab — send queue
┌───────────────────────────────────────────────────┐
│ Follow-up — Queue │
│ │
│ Target Rule Scheduled Status │
│ ───────────────────────────────────────────────── │
│ Rudi H. apply-remind-24h 10:30 queued │
│ Siti A. qualified-day2 11:00 sending │
│ Budi S. drop-day3 09:15 sent │
└───────────────────────────────────────────────────┘
Possible statuses:
- queued — waiting for scheduled send
- sending — in flight (usually < 5 seconds)
- sent — delivered successfully
- failed — error (check the
errorcolumn for the reason) - responded — user replied after receiving (success!)
- opted_out — user previously asked to stop; rule not executed
The queue auto-refreshes via realtime trigger (Socket.io) — new rows appear without reload.
3. Rules tab — re-engagement rules
Around 24 rules are deployed covering key funnel transitions. Each rule has:
- Trigger condition — e.g. lead stage =
newand no counselor message in the last 24 hours - Delay — how long to wait before sending (e.g. 1 hour, 1 day, 3 days)
- Template — message template to send (free-form within the WA 24h window or Meta-approved template)
- Active toggle — on/off
Click a rule row to edit it. Marketing can change delay, template, or toggle off a rule that fires too often.
4. Stats tab — effectiveness metrics
The Stats tab shows:
- Total follow-ups sent this week
- Response rate per rule (what % of users respond after receiving a follow-up)
- Opt-out rate (must be watched for WA compliance)
- Conversion: how many leads advance a stage after a follow-up
Rules with response rate < 5% or opt-out rate > 2% should be reviewed or toggled off.
5. Manual follow-up trigger
Sometimes a counselor wants to send a follow-up to a specific lead
right away without waiting for the scheduler. From the lead detail
page (/admin/leads-v2/[id]) there is a Send Follow-up Now
button → pick a rule → send. A queue entry is created with
status=queued and the next scheduler tick will execute it.
6. Hourly scheduler job
The scheduler runs every hour in the background. On each tick:
- Evaluate all active rules
- Query leads matching the trigger condition
- Check the 24h window → pick the appropriate template
- Check opt-out → skip opted_out users
- Insert into queue with
status=queued - The worker picks up queued entries → sends via 360dialog → updates the status
Because it runs hourly, there is up to a 60-minute lag between the trigger condition and message delivery. For instant sends, use the manual trigger (step 5).
Example scenarios
Re-engage a lead that applied but hasn't paid in 3 days. The
rule apply-paid-day3 fires automatically: lead with stage
qualified (derived from "already applied" analysis) but with no
payment confirmation. Template: "Hi {name}, your UPH application
is almost complete. Please pay the form fee so we can process it".
Marketing monitors stats: 18% response rate, 7 out of 40 sent leads
converted to enrolled.
Toggle off an annoying rule. The rule daily-checkin sends a
message daily to new leads — response rate only 2%, opt-out rate
4%. Marketing clicks the rule → Toggle Off → pending queue
entries still go out (not auto-canceled), but no new entries get
queued.
Troubleshooting
Queue doesn't auto-update. Symptom: new entries don't appear.
Cause: Socket.io trigger follow-up_queue is disconnected or the
tab is stale. Fix: refresh the page; if recurring, contact dev team
(trigger is registered in the DB).
Follow-up fails with "session window expired". Symptom: status
failed, error mentions 24h window. Cause: the user hasn't chatted
in the last 24 hours and the rule doesn't use a Meta-approved
template. Fix: mark the rule's template as Meta-approved; or create
a new rule that only uses Meta templates.
Opt-out rate suddenly spikes. Symptom: stats show opt-out rising from 1% to 5% in one day. Cause: a new rule that is too aggressive (too frequent / wrong timing) or template that feels too salesy. Fix: toggle off the suspicious rule, review the template with marketing, re-enable after revision.
Manual trigger doesn't send immediately. Symptom: click "Send
Follow-up Now" but status is stuck at queued for more than 1
hour. Cause: scheduler hasn't ticked yet (hourly). Fix: wait for the
next tick. For emergency sends, contact dev team to manually trigger
a scheduler run.
See also
- Leads pipeline — the lead source targeted by follow-up
- Inbox — see the user response after a follow-up lands
- Troubleshooting — more common issues