Auto-Enrich Inbound Leads with an n8n Agent
For Sales and RevOps teams · Based on Alejandro AO Agentic RAG n8n Build
// TL;DR
Sales and RevOps teams can auto-enrich inbound leads in n8n by combining internal product knowledge with live company research in one agent. You build an Ingestion Workflow that embeds product docs into a vector store, then a Retrieval Workflow triggered by a Webhook (POST from your CRM). The AI Agent gets two tools: a Knowledge Base Search on your product docs and a Firecrawl MCP tool for live research on the lead's company. The agent returns structured enrichment JSON, and the webhook response delivers it straight back to the CRM — automatically, at open-model prices.
Why use a dual-tool agent for lead enrichment?
Inbound leads need two kinds of context: your internal product knowledge (which product fits this lead?) and live external intelligence (who is this company, what do they do?). A single Agentic RAG agent handles both. Give it a Knowledge Base Search tool for internal docs and a Firecrawl MCP tool for live web research, and it decides autonomously which to call — often both, multiple times — before returning enrichment data.
This beats a hard-coded Manual RAG pipeline because the agent adapts to each lead: a lead with a clear company name triggers web research, while a product-fit question triggers document lookup.
How do you ingest product documentation?
Build the Ingestion Workflow with an n8n Form trigger (or Google Drive) to upload product docs, spec sheets, and pricing PDFs. Connect a Document Loader, chunk with a structure-aware splitter for production quality, attach a Hugging Face embeddings node (e.g. BAAI/bge-m3), and insert into a persistent vector store like Qdrant or Chroma. Record the collection ID.
Test ingestion end-to-end: execute the trigger, then the vector store node, and confirm the output panel shows chunks equal to the extracted content before moving on.
How do you wire the CRM to the agent?
Build the Retrieval Workflow with a Webhook trigger — a POST endpoint your CRM calls on new lead submission. Add authentication since it's internet-facing. Connect an AI Agent node with an OpenAI Chat Model routed to router.huggingface.co/v1 running an open model like GLM 5.1 or Deep Seek V4.
Attach two tools: (1) the Knowledge Base Search tool pointing at your product Qdrant collection, with the exact same embedding model used at ingestion; and (2) the Firecrawl MCP Client Tool for live company research. Write precise tool descriptions so the agent knows the vector store holds product docs and Firecrawl handles company lookups.
How do you return structured data to the CRM?
In the system prompt, instruct the agent to return enrichment as structured JSON — fields like recommended_product, company_summary, employee_count, and fit_score. The webhook response node delivers this JSON back to the CRM, which maps it onto the lead record. Because the agent produces consistent structure, downstream automation stays reliable.
Test by sending a sample POST and inspecting execution logs: confirm the agent calls both tools when appropriate and returns valid JSON. Watch for the agent scraping oversized pages — add a heuristic to prevent context overflow.
What results can RevOps expect?
Every inbound lead auto-enriched within seconds: matched to the right product from your docs and augmented with live company intelligence, delivered as clean JSON to the CRM. No manual research, no rep time spent Googling companies. Running on open models with free embeddings keeps per-lead cost negligible.
Next step: Deploy n8n on a secured VPS, ingest your product docs into a persistent Qdrant collection, then build the webhook-triggered agent with both tools. Send test POSTs to validate the JSON output before pointing your CRM at the live endpoint.
// FREQUENTLY ASKED QUESTIONS
How does the agent decide whether to search docs or the web?
It reads each tool's description. Give the Knowledge Base Search tool a description like 'internal product documentation — use to match leads to products' and the Firecrawl MCP tool 'live web research — use to look up the lead's company.' The agent autonomously calls whichever fits the query, and can call both for a single lead before returning results.
Can the agent return structured JSON my CRM can parse?
Yes. Instruct the agent in its system prompt to output enrichment as structured JSON with specific fields (recommended_product, company_summary, fit_score, etc.). The webhook response node sends this JSON back to the CRM. Consistent structure in the prompt keeps downstream field-mapping reliable across every lead.
How do I secure the webhook endpoint the CRM calls?
Add authentication to the Webhook trigger — Basic Auth or n8n's built-in auth — since it's internet-facing. Without it, anyone who discovers the URL could trigger enrichment runs and burn your API quota. Deploy n8n behind a reverse proxy with auth and validate incoming requests before the agent runs.