MQL Qualification Agent
A Slack bot that automatically researches and qualifies new marketing leads in real time, so the marketing team knows which ones are worth pursuing before a rep even looks.
Client: Marq
Project Details
Marq's marketing team had a Python-based Slack bot that automatically researched and qualified inbound MQL notifications from HubSpot. The problem: it ran on a single laptop. Leads only got qualified when that machine was on - no coverage on nights, weekends, or whenever the rep stepped away. I migrated the full pipeline to n8n running 24/7, so every new lead gets researched, qualified, routed to the right rep, and posted back to Slack in real time without anyone needing to be online.
Challenge
The existing Python bot was effective but fragile. It ran locally via a persistent WebSocket connection with no error handling, no execution logs, and no way for anyone else on the team to modify or monitor it. If the script crashed or the laptop went to sleep, MQLs sat in the Slack channel unqualified until someone noticed and restarted it.
The marketing team needed the same pipeline running on shared infrastructure, 24/7, without rewriting the core qualification logic from scratch.
Approach
I started by reviewing the existing Python codebase module by module and documenting the full pipeline before writing any n8n nodes. Each Python module mapped to an n8n equivalent: Slack Trigger for the socket listener, Code nodes for parsing and routing logic, HTTP Request for the Claude API call, HubSpot nodes for contact history, and a Slack node for the thread reply.
The workflow triggers on every new MQL message in Slack. It parses the lead data, routes to the correct account executive tier (Corporate for up to 1,000 employees, Enterprise for 1,001+, with a special threshold for real estate brokerages), then calls Claude Sonnet with web search to research the person and company in real time. It pulls the contact's HubSpot history (deals, calls, emails, meetings from the last 12 months) and posts a formatted thread reply with qualification status (green/yellow/red), ICP fit assessment, AE routing, flags, a discovery brief, and recommended next steps.
Delivery was structured in three milestones: codebase review and planning, full build, then testing and iteration with the marketing team using real MQLs.
Results
- Lead qualification now runs 24/7 on Marq's n8n instance with error handling and execution logs, replacing a single-laptop dependency
- Leads researched and qualified in real time as soon as they appear in Slack
- AE routing automated with consistent rule application, including the real estate brokerage edge case
- Marketing team gets structured, actionable qualification summaries directly in the Slack thread
- Currently in testing and review phase before full production activation
Tools Used
n8n, Slack API, Anthropic API (Claude Sonnet with web search), HubSpot API v3
Get Started
Looking to Hire?
I bring 19+ years of cross-functional experience to every role. Connect on LinkedIn to learn more.
Need a Consultant?
Whether it's a short sprint or a long-term engagement, I'm ready to help your team deliver better results.