n8n portfolio · workflow 2 of 3

AI Lead Qualification Engine

An AI SDR that researches, scores and answers every inbound lead within about a minute, puts hot leads in front of a rep with talking points, and runs a follow-up sequence that stops the moment someone replies. Built for B2B teams whose leads go cold waiting for a reply.

Nodes
57 + canvas notes
Entry points
Webhook · schedule · Gmail · setup
AI
Claude Opus 5 in 5 roles
Integrations
Hunter · Apollo · SerpAPI · HubSpot · Gmail · Slack · Postgres
File
02-ai-lead-qualification-engine.json ↓

Architecture

Three triggers share one config and one router: new leads, a 15-minute sequencer tick, and inbound replies.

① Intake → enrichment → AI qualificationanswers the form in milliseconds, works in the background② Route by tier, then actfour tiers③ Follow-up sequencerevery 15 min, business days only④ Reply intelligencethe sequence stops the moment a human answersleadnot validalready workedscored leadif hotfollow-upsreplyWEBHOOK · API KEYLead formwebsite · ads · TypeformSCHEDULEEvery 15 minutesfollow-up sequencerGMAIL TRIGGERLead repliespolls every minuteSET + SWITCHConfig & routerICP · thresholdscadences · linksCODE + SWITCHValidate & triagenormalise · bot checksPOSTGRESUpsert leadafter a 202 replyHTTP × 3EnrichHunter · Apollo · websiteCODEResearch dossierfails soft per sourceCLAUDE · AI AGENTResearch agentlive web search, ≤ 2 queriesCLAUDE · EXTRACTORQualification scorerstrict JSON · writes email 1CODEHybrid scoreLLM + rules (see below)RESPONDReject quietlyspam: fake 202 · bad: 422SLACKKnown lead againping the current ownerSWITCHRoute by tierscores saved firstPOSTGRESRound-robin rephot leads · SKIP LOCKEDSETMarketing ownerwarm + cold leadsPOSTGRESAudit logdisqualified: no outreachHUBSPOT APIUpsert contactbatch upsert by emailGMAILFirst-touch emailhot + warm, in secondsPOSTGRESEnroll in sequencehot 1/3/6 · warm 3/7/14 daysHUBSPOT + SLACKDeal + hot-lead alerttalking points for the repPOSTGRESClaim due stepsSKIP LOCKED · weekdaysCLAUDE · LLM CHAINWrite follow-up nnew angle every stepGMAILReply in threadsame thread as email 1POSTGRESMark sent / failederror branch keeps statePOSTGRESMatch reply to leadby thread, then emailCLAUDE · CLASSIFIERClassify intentfour labelled outputsSLACK · STOP SEQUENCEInterested: alert repCLAUDE → GMAIL DRAFTQuestion: draft for reviewPOSTGRESNot now: snooze 30 daysPOSTGRES · SUPPRESSIONUnsubscribe: stop for good
Lane ① hands the scored lead to lane ② along the gap between the lanes. Every enrichment call fails soft, so an API outage makes the dossier thinner but never drops a lead.

Hybrid scoring

Claude judges fit and intent. Deterministic rules keep that judgement honest.

× 0.5× 0.3× 0.2CLAUDEFit score 0–100company + persona vs ICPCLAUDEIntent score 0–100message · timeline · budgetCODERule score 0–40 → 0–100seniority · size · demo askWEIGHTED BLEND0.5 fit + 0.3 intent+ 0.2 rulesGUARDRAILS · MODEL CAN'T OVERRIDEDeterministic overridesfloor to 75: VP+ asking for a demo at 50+ staffcap at 74: personal email and no companystop: undeliverable · AI disqualifier · suppressedstop → disqualified: audit log onlyfinal score → tiercoldwarmhot04575100OUTCOMECRM onlyno emailsOUTCOMENurture3 / 7 / 14 daysOUTCOMERep nowdeal + Slack alert
The weights and the 45 / 75 thresholds are the workflow's real defaults, editable in the config node. Overrides run after the blend, so no model output can turn an undeliverable or suppressed address into outreach.

Engineering decisions

Why it is built this way.