AI-Powered Lead Enrichment & Qualification Agent (n8n + Node.js)
Hey everyone, sharing a project I recently published on GitHub under the MIT License for anyone building lead enrichment or HubSpot routing pipelines.
Most lead enrichment workflows break in one of two ways: they let AI invent company numbers when APIs return blanks, or they flood HubSpot with duplicate records. I built this as both an importable n8n workflow and a standalone Node.js service to solve four specific CRM and outbound headaches:
• Messy webhook inputs: Accepts a raw domain, full URL, or email address, normalizes it cleanly, blocks invalid inputs, and verifies a shared webhook secret (x-webhook-secret) before running.
• AI guessing headcount and revenue: Pulls company details from Apollo and uses OpenAI or Anthropic strictly for 0–100 ICP scoring, fit tiering (Tier 1 to Disqualified), reasoning, and a 2-sentence outreach opener. If Apollo has no headcount or revenue data, those fields stay blank in HubSpot instead of being guessed.
• Duplicate company records: Searches HubSpot by domain first to update existing companies or create new ones, and includes a setup script (npm run setup:hubspot) to provision the custom properties (icp_score, fit_tier, estimated_revenue, personalization_hook, enrichment_reasoning, enriched_at).
• Risky live deployments: Ships with dry-run mode turned on by default and 50 unit tests (npm test) so you can inspect payloads safely before writing live data to your CRM.
Repo & Setup Guide: github.com/dhrobinsystems/n8n-ai-lead-enrichment-agent
Would love any feedback from folks running n8n + HubSpot in production, especially on how you handle fallback enrichment or field-level overwrite rules.