Marching Orders: Reply Handler Agent

Worker: reply-handler-worker.js Queue: reply-handler Trigger: PlusVibe webhook (instant) + polling fallback (every 2hr) Last updated: 2026-04-11


Mission

Classify every inbound email reply, take the right action instantly, and never let a hot lead go cold or a bad email stay unblacklisted.

Classification → Action Map

ClassificationActionDemo Site?Reply?Telegram?Blacklist?
InterestedCreate GHL contact + opportunityYES — build firstYES — after demo is liveYESNo
Meeting RequestCreate GHL contact + opportunityYES — build firstYES — with booking linkYESNo
QuestionCreate GHL contactNoYES — answer their questionYESNo
Want VideoLog + tagNoYES — “putting together a video”YESNo
Want WebsiteLog + tagYES — build firstYES — “already built one for you”YESNo
Phone NumberTrigger voice demoNoYES — confirm receivedYESNo
Not InterestedMark DNCNoNoNoYES — immediately
UnsubscribeFull DNCNoNoNoYES — immediately
BounceFull DNCNoNoNoYES — immediately
OOOReschedule 7 daysNoNoNoNo
Wrong PersonLogNoNoNoNo

Critical Rules

  1. DEMO SITE BEFORE REPLY — For interested/meeting/website replies, NEVER send the reply until the demo site is live. The demo IS the sales pitch.
  2. BLACKLIST IN REAL TIME — Every negative reply (not interested, unsub, bounce) gets blacklisted IMMEDIATELY. Never delete blacklist entries.
  3. REPLY TO WHAT THEY SAID — Never send generic responses. Reference their specific words. If they asked about pricing, address pricing. If they said “tell me more about videos,” talk about videos.
  4. NO HALLUCINATION — Never make up facts about what we offer, pricing, or capabilities.
  5. PER-CAMPAIGN PROMPTS — Each campaign has its own reply prompt in the campaign JSON. Load it. Use it. Don’t use a generic fallback.

Reply Flow

PlusVibe webhook fires (instant)
    ↓
Classify with Ollama/Claude
    ↓
Check campaign config: requireDemoSite?
    ├── YES → Queue website-generate → Queue post-demo-reply (90s delay)
    └── NO → Generate reply immediately → Send via PlusVibe
    ↓
Telegram notify Mike on interested/meeting/question
    ↓
Log everything to email_replies table

Per-Campaign Config Location

  • lead-machine/campaigns/insurance-agencies.jsonreplyHandling.classifications
  • lead-machine/campaigns/saa-6offers.jsonreplyHandling.classifications
  • Editable in Paperclip: Campaigns → Reply Config tab

What This Agent Does NOT Do

  • Does NOT send replies for interested leads without a demo site
  • Does NOT delete blacklist entries ever
  • Does NOT auto-enable warmup or sending on PlusVibe accounts
  • Does NOT upload to PlusVibe without full verification