B2B AI Lead Qualification with RAG and Auto-Booking in n8n by Dmitri KharitonovB2B AI Lead Qualification with RAG and Auto-Booking in n8n by Dmitri Kharitonov

B2B AI Lead Qualification with RAG and Auto-Booking in n8n

Portfolio project
Dmitri Kharitonov
The problem. B2B agencies get inquiries in several channels. Replies take hours, sales reps spend time on leads that will never buy, and prices quoted in chat don't always match the real price list.
What I built. An omnichannel AI assistant in n8n (10 workflows):
Channels: Telegram bot and email (IMAP), WhatsApp-ready channel layer.
Intent routing: spam is closed silently, support questions go to the support team, new leads enter qualification.
RAG answers: the AI answers only from the company knowledge base (vector search over 7 documents, keyword fallback if the vector index is unavailable). Questions the knowledge base can't answer go to a human instead of the AI making something up.
Qualification & scoring: BANT (budget, authority, need, timeline), score 1–10 → HOT / WARM / COLD.
HOT: personal booking link (Cal.com) + instant Telegram card for the team with an AI summary and Take over / Back to AI buttons.
Booking: signed Cal.com webhook moves the HubSpot deal to Meeting Scheduled and sends the manager a pre-call summary. Reschedules and cancellations are handled correctly.
WARM / COLD: HubSpot task for the next business day + nurture messages in the lead's own channel.
HubSpot: contact and deal without duplicates across channels.
Analytics dashboard (password-protected) and nightly data cleanup.
Reliability & security.
Burst messages are merged (per-lead lock), so the AI answers once with full context.
Human takeover is checked before any AI call, after Take over the bot stays silent.
AI outage → neutral reply, conversation switched to human, admin alerted.
Per-lead AI usage cap, rate limiting, webhook signature checks (HMAC), only two public endpoints.
Unverified emails are never used for sending (no spam relay), existing CRM contacts are never overwritten by an unverified email.
Execution data kept 7 days, lead data 90 days.
Tested. Live end-to-end test (real Telegram user, real Cal.com booking and cancellation), independent QA (edge cases, prompt injection, multiple languages, race conditions) and a security review. Prices quoted by the AI matched the price list exactly.
Stack: n8n, AI model / LLM (provider-agnostic), vector search (RAG), HubSpot, Cal.com, Telegram Bot API, IMAP/SMTP.

0 likes · 0 views · Nov 16, 2026

AI answers leads from Telegram and email using only the company knowledge base, scores them with BANT, books calls and keeps HubSpot clean.

Tags