ai-powered lead scoring with n8n + Apollo.io (part 2 of 4)
Easily Score 500 Leads Based on Website Analysis and Business Fit in Under 20 Minutes
In our previous guide, we built an automation that pulls leads from Apollo.io and generates personalized icebreakers. Today, we're taking it to the next level with intelligent lead scoring that tells you exactly which prospects to pursue first.
This is Day 2 of our Lead Generation Automation Series, where we build on the foundation from Day 1 to create a complete lead qualification system.
By the end of this tutorial, you'll have a sophisticated lead scoring automation that:
✅ Pulls 500 targeted leads from Apollo.io with website URLs
✅ Scrapes and analyzes each company's website content
✅ Scores leads on 5 key criteria (0-100 points)
✅ Provides actionable recommendations for each lead
✅ Automatically organizes everything in Google Sheets
Download the complete n8n template: apollo-lead-scoring.json
Why AI Lead Scoring Changes the Game
Manual lead qualification wastes 15+ hours per week on:
Visiting hundreds of websites individually
Guessing at company size and budget
Missing key buying signals
Pursuing poor-fit prospects
This automation analyzes websites in seconds and scores leads based on:
Industry fit for digital marketing services
Company size and budget potential
Current marketing sophistication
Decision-maker authority
Business clarity and market positioning
What You'll Need
Same requirements as Day 1, plus:
n8n (self-hosted or cloud version)
Apify account with Apollo.io scraper
Google Sheets API enabled
OpenAI API key (for lead scoring analysis)
Apollo.io search URL (must include companies with websites)
Setup time: 15-20 minutes
Cost: ~$1.20 per 500 scored leads
Step 1: Start with the Same Foundation
We begin exactly like Day 1, but with a crucial difference in our filtering.
Add a Manual Trigger and Create Google Sheet node just like before:
Resource: Spreadsheet
Operation: Create
Title:
New Run - {{ $now }}
Step 2: Pull Leads from Apollo (With a Twist)
The Apify configuration is identical to Day 1:
{
"method": "POST",
"url": "https://api.apify.com/v2/acts/code_crafter~apollo-io-scraper/run-sync-get-dataset-items",
"headers": {
"Authorization": "Bearer YOUR_APIFY_TOKEN"
},
"body": {
"cleanOutput": false,
"totalRecords": 500,
"url": "YOUR_APOLLO_SEARCH_URL"
}
}
Key difference: Make sure your Apollo search includes companies likely to have websites (avoid solopreneurs or very small operations).
Step 3: Filter for Website AND Email
This is where we diverge from Day 1's approach.
Configure your Filter node to check:
Email is not empty (AND)
Website URL is not empty
🎯 Pro tip: We need websites for scoring, so this filter
is stricter than Day 1's LinkedIn + email requirement.
Step 4: Limit During Testing
Same as before - start with 5 leads during testing:
Add a Limit node:
Max Items: 5 (scale to 500 after testing)
Step 5: Save Initial Data to Google Sheets
Before enrichment, save the raw Apollo data:
This creates your baseline dataset that we'll enhance with scoring data.
Step 6: Scrape Website Content (NEW!)
Here's where the magic begins. We'll fetch each company's website to analyze their business.
Add an HTTP Request node:
URL:
{{ $json.organization.website_url }}
Method: GET
On Error: Continue (some sites may be down)
This pulls the raw HTML from each lead's website.
Step 7: Extract Clean Website Text
Raw HTML is messy. We need clean text for AI analysis.
Add an HTML node:
Operation: Extract HTML Content
CSS Selector:
body
Options:
✅ Trim values
✅ Clean up text
This strips out all the CSS, JavaScript, and formatting, leaving pure content.
💡 Why this matters: Clean text = 75% fewer tokens =
lower API costs and better AI analysis
Step 8: AI-Powered Lead Scoring
This is the heart of our system - an intelligent scoring algorithm.
Configure the OpenAI node with our scoring framework (full prompt on apollo-lead-scoring.json)
The AI analyzes each lead based on:
Scoring Criteria (100 points total):
1. Industry Fit (30 points)
High-growth sectors (SaaS, E-commerce): 25-30 points
Traditional businesses going digital: 15-24 points
Low-margin or restricted industries: 0-14 points
2. Company Size/Budget (25 points)
10-200 employees (sweet spot): 20-25 points
5-9 or 201-500 employees: 10-19 points
Very small or enterprise: 0-9 points
3. Marketing Opportunity (25 points)
Basic website, clear gaps: 20-25 points
Some efforts, room to grow: 10-19 points
Already sophisticated: 0-9 points
4. Decision Maker (15 points)
C-level or VP Marketing: 12-15 points
Marketing Manager: 6-11 points
Non-decision maker: 0-5 points
5. Business Clarity (5 points)
Clear offering and audience: 4-5 points
Somewhat clear: 2-3 points
Confusing or too niche: 0-1 points
Step 9: Structure the Results
The AI returns a comprehensive JSON object with:
{
"total_score": 78,
"potential_client_profile_match_status": "High Potential Client",
"summary_recommendation": "High potential client. SaaS company in growth phase with clear digital marketing needs. Prioritize outreach.",
"score_breakdown": [
{
"criterion": "Industry Fit",
"points_awarded": 26,
"max_points": 30,
"rationale": "SaaS company with subscription model..."
}
// ... other criteria
]
}
Step 10: Add Scoring Headers
Before saving, we need to add our new scoring columns:
Extend the headers from Day 1 to include:
total_score
potential_client_profile_match_status
summary_recommendation
score_breakdown
Step 11: Save Complete Scored Data
Finally, append all data including scores to your sheet:
Map the scoring data from the AI analysis to your spreadsheet columns.
Understanding Your Results
Your final spreadsheet will show:
Score 80-100: 🔥 Hot leads - Immediate outreach priority
Score 60-79: 🟢 Good leads - Worth pursuing with tailored approach
Score 40-59: 🟡 Medium leads - Qualify further before investing time
Score 0-39: 🔴 Poor fit - Deprioritize or remove from campaigns
Boost your lead scoring with:
🎯 Industry-Specific Scoring
Tailor rubrics per vertical (B2B vs. B2C)🥊 Competitor Detection
Score higher if they mention competitors you’ve beaten🔌 Tech Stack Analysis
Identify their martech for integration opportunities🔍 Buying Signal Alerts
Flag keywords: “looking for” / “evaluating” / “considering”
Troubleshooting Common Issues
"Request failed" on website scraping:
Some sites block automated requests
Add user-agent headers to your HTTP request
Use "Continue on Error" to skip problematic sites
Scoring seems inconsistent:
Ensure website text is properly extracted
Check that all lead data is passing to the AI node
Review sites manually to calibrate scoring
AI returns invalid JSON:
Enable "JSON Output" in OpenAI node settings
Ensure your prompt explicitly requests JSON format
✅ Your Final Deliverable
A ready-to-use Google Sheets file with:
Apollo.io lead data with verified emails
Website analysis and content extraction
AI-powered scores (0-100) for each lead
Detailed scoring breakdowns and recommendations
Priority status labels (Hot/Good/Medium/Poor)
Combining with Day 1
Power move: Run both workflows in sequence:
First: Lead enrichment with icebreakers (Day 1)
Then: Lead scoring (Day 2)
Result: Personalized outreach to pre-qualified prospects
Or combine them into a single mega-workflow that does both!
Download the Template
Ready to implement intelligent lead scoring? Download the complete workflow and start prioritizing the right prospects.
Download apollo-lead-scoring.json
The template includes:
✅ All nodes pre-configured
✅ Comprehensive scoring logic
✅ Error handling for failed websites
✅ Clear documentation
What's Next?
You now have enriched leads (Day 1) and intelligent scoring (Day 2). Tomorrow, we'll complete the trifecta with automated outreach.
Coming next in the series:
Step 3: Automated LinkedIn Connection Requests
Step 4: Multi-Channel Lead Nurturing
Want to implement the entire 5-day automation suite? Book a free Agency Ops Audit to see how we can save your team 30+ hours per week with intelligent automation.