1. Opening Problem Statement
Meet Mutasem, a growth marketer at a SaaS company who juggles dozens of incoming lead submissions daily. Each lead arrives via a simple contact form but verifying the lead’s email, scoring their potential value, and pushing the info into HubSpot for outreach used to take hours manually. Sometimes invalid emails clogged the pipeline, and unqualified leads wasted the sales team’s time. This led to missed opportunities and slower follow-ups, costing the company both momentum and revenue.
Mutasem needed a reliable automated solution that would filter out invalid leads, intelligently score lead quality, and trigger personalized outreach—all without manual intervention.
2. What This Automation Does
This n8n workflow transforms how you process incoming leads by automatically handling key steps from contact form submission to outreach:
- Validates email addresses instantly using the Hunter node, preventing follow-ups to invalid contacts.
- Scores leads leveraging MadKudu’s predictive analytics API to assess lead quality scientifically.
- Filters out low-scoring or unqualified leads so your sales team focuses only on prospects with a fit score above 60.
- Retrieves and updates lead data in HubSpot CRM via authenticated OAuth2 access.
- Automatically sends personalized outreach emails using Gmail when lead quality passes threshold.
- Records all engagement activities in HubSpot, maintaining accurate contact logs and improving reporting.
By automating these steps, you save hours of manual work daily and increase engagement quality dramatically.
3. Prerequisites ⚙️
- n8n account (cloud or self-hosted) 🔌
- MadKudu API access and HTTP Header Auth credentials 🔐
- Hunter API key for email verification 🔐
- Google Gmail OAuth2 account linked to n8n 📧
- HubSpot OAuth2 credentials for API integration 🔑
- Basic understanding of OAuth2 authentication and API calls
4. Step-by-Step Guide
Step 1: Setup n8n Form Trigger Node for Lead Collection
Navigate to Nodes → Add Node → Trigger → Form Trigger. Configure the form path (use “0bf8840f-1cc4-46a9-86af-a3fa8da80608”) and form fields with a business email input labeled “What’s your business email?”. This node will expose a webhook URL to embed as your contact form’s endpoint.
You’ll see the form live preview allowing testing. This triggers the whole workflow when users submit their email.
Common Mistake: Forgetting to set form path or leaving required email field unlabeled causes no data submission.
Step 2: Verify Email with Hunter Node
Add the Hunter node and connect it to the Form Trigger. Set the email field dynamically with {{ $json['What's your business email?'] }}. Select the operation “emailVerifier”.
Enter your Hunter API credentials under the credentials tab.
This node pings Hunter’s API to classify the email validity.
Common Mistake: Not adding valid API key disables verification.
Step 3: Check Email Validity with IF Node
Add an IF node named “Check if the email is valid”. Configure condition to check if {{$json.status}} equals “valid”. Connect the Hunter node output to this IF node.
If true, the workflow continues to MadKudu scoring. If false, it routes to a No Operation node “Email is not valid, do nothing” to gracefully stop processing.
Step 4: Score Lead with MadKudu HTTP Request
Add an HTTP Request node “Score lead with MadKudu” connected from the IF node’s true branch. Set the URL to https://api.madkudu.com/v1/persons?email={{ $json.email }}.
Choose HTTP header authentication and configure your MadKudu credentials. This node calls MadKudu’s API, which returns a customer fit score.
Step 5: Filter Leads Based on Score (IF Node)
Add an IF node labeled “if customer fit score > 60”. Configure it to check if {{$json.properties.customer_fit.score}} is greater than 60.
The true branch proceeds to HubSpot update, false branch leads to “Not interesting enough” NoOp node.
Step 6: Fetch Lead in HubSpot CRM
Add a HubSpot node configured with OAuth2 to search contacts by email dynamically ({{$json.email}}).
This node fetches lead details to associate further engagement.
Step 7: Set Email and Message Content (Set Node)
Add a Set node “Set keys” to prepare outreach email fields: set “html” content, “subject”, recipient email “to”, and HubSpot contact ID “id” dynamically from previous data.
Example message: Hello, Thank you for filling out our form. We are excited to help you. Feel free to schedule a 30-minute call with me here: www.calendly.com/schedule/mutasem Cheers, Mutasem
Step 8: Send Outreach Email Using Gmail
Add a Gmail node with OAuth2 credentials linked. Configuration: send email to {{$json.to}}, use {{$json.html}} for the body, subject from {{$json.subject}}. Include sender name “Mutasem from n8n” and disable attribution append.
This node sends a personalized email once lead qualifies.
Step 9: Record Engagement in HubSpot CRM
Add another HubSpot node to create an engagement type “email” linked to the contact ID. Fill metadata fields such as subject, HTML content, recipient and sender emails, and first name.
Maintaining engagement history enhances CRM tracking and reporting.
5. Customizations ✏️
- Change Form Fields: Replace the Form Trigger’s “What’s your business email?” field label to collect other lead data like phone or company name.
- Adjust Lead Score Threshold: In the IF node “if customer fit score > 60”, change the numeric threshold to a custom value fitting your sales strategy.
- Personalize Outreach Email: Modify the Set node “Set keys” HTML or subject text to align with different campaigns or brands.
- Switch Email Provider: Replace the Gmail node with any other email integration supported by n8n, adjusting credentials accordingly.
- Integrate Other CRMs: Substitute HubSpot nodes with other CRM API nodes like Salesforce, depending on your stack.
6. Troubleshooting 🔧
Problem: “Email verification always fails or shows invalid status”
Cause: Incorrect Hunter API key or exceeding API quota.
Solution: Confirm your key in Hunter credentials inside n8n, check API usage limits, and regenerate key if needed.
Problem: “MadKudu scoring returns errors or empty response”
Cause: Bad API endpoint or missing authentication.
Solution: Verify the HTTP Request URL and ensure HTTP header auth includes the right token. Test with sample emails in Postman or n8n manual runs.
Problem: “Emails not sent after lead is qualified”
Cause: Gmail OAuth2 token expired or misconfigured recipient address.
Solution: Reauthorize your Gmail account in n8n, and confirm the “to” field in Set node is correctly populated from HubSpot output.
7. Pre-Production Checklist ✅
- Test form submission with valid and invalid emails.
- Validate Hunter email verification node returns expected “valid” or “invalid” status.
- Confirm MadKudu HTTP Request node returns a numeric customer fit score.
- Verify HubSpot nodes can fetch and update contacts with your OAuth2 credentials.
- Trigger Gmail node manually with sample data to ensure email delivery.
- Backup your n8n workflow JSON before activation.
8. Deployment Guide
Activate the workflow in n8n by toggling “Active” status. Embed your form trigger URL in your website or landing page to start collecting leads. Monitor executions on the n8n dashboard for errors or bottlenecks.
Enable logging to capture engagement success. Use n8n’s retry features to handle transient API failures automatically.
10. Conclusion
By implementing this lead scoring and outreach automation workflow with n8n, Mutasem transformed a tedious manual funnel into a smart, scalable process. The workflow validates emails to weed out bad leads, scores prospects scientifically with MadKudu, updates HubSpot CRM, and automates outreach with Gmail—all saving hours weekly and boosting sales team focus on high-potential leads.
Next steps might include integrating chatbots for initial lead qualification or expanding lead source inputs beyond the embedded form. With this foundation, your lead funnel automation is ready to grow and evolve efficiently.