Skip to main content

Automated Lead Generation with AI Agents: Scrape → Enrich → Score → Close (2026 Playbook)

· 10 min read
Yassine El Haddad
Software Developer & Automation Specialist

I build production AI agents, web scrapers, and automation pipelines. Most of what I publish here comes from the actual problems they run into: proxies that get banned, anti-bot stacks that fingerprint your client, RAG that drifts when the underlying data moves. Stack: Python, TypeScript, Go, FastAPI, LangChain, Crawlee, Playwright, deployed on AWS, GCP, and Cloudflare.

The key is not just scraping data — it is building a complete pipeline that goes from raw web data to scored, enriched leads in your CRM, automatically.

This playbook covers the architecture, tool-by-tool setup, cost model, and compliance framework for building an AI lead generation system in 2026.

TL;DR:

Pipeline stageToolWhat it does
SourceApify Google Maps, LinkedIn, directory scrapersCollect raw lead data from public sources
EnrichClaude API / Ollama (local)Add company data, tech stack, revenue estimates
ScoreClaude API / OllamaRate leads 1–10 against your Ideal Customer Profile (ICP)
RouteClay, HubSpot, Google SheetsPush scored leads to CRM
Orchestraten8n / Make.comAutomate the entire pipeline on schedule

Prerequisites:

  • Apify account (Starter plan: $29/mo for production use)
  • Claude API key or self-hosted Ollama (see Self-Host AI Stack)
  • CRM account (HubSpot free, Clay, or Google Sheets)
  • n8n or Make.com for orchestration

The 2026 AI lead gen architecture

┌───────────────────────────────────────────────────────────────────────┐
│ AI Lead Generation Pipeline │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ SOURCE │──▶│ ENRICH │──▶│ SCORE │──▶│ ROUTE │ │
│ │ │ │ │ │ │ │ │ │
│ │ Apify │ │ Claude/ │ │ Claude/ │ │ Clay / │ │
│ │ Scrapers │ │ Ollama │ │ Ollama │ │ HubSpot │ │
│ │ │ │ │ │ │ │ │ │
│ │ Google │ │ Company │ │ ICP fit │ │ Auto- │ │
│ │ Maps, │ │ data, │ │ score │ │ assign │ │
│ │ LinkedIn, │ │ tech │ │ 1-10 │ │ to rep │ │
│ │ dirs │ │ stack │ │ │ │ │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ │
│ ┌──────────────────────────────────────────────────────────────┐ │
│ │ n8n / Make.com (Orchestrator) │ │
│ │ Schedules, retries, error handling, alerts │ │
│ └──────────────────────────────────────────────────────────────┘ │
└───────────────────────────────────────────────────────────────────────┘

Step 1: Define your ICP (Ideal Customer Profile)

Before scraping anything, define who you're looking for. This drives every downstream decision.

Use this Claude prompt template to construct your ICP:

Based on [your company]'s product and pricing, define our Ideal Customer Profile:

1. Company size: [10-200 employees]
2. Industry: [B2B SaaS, e-commerce, fintech]
3. Revenue range: [$1M-$50M ARR]
4. Geography: [US, EU, UK]
5. Tech stack signals: [Uses Stripe, AWS, React]
6. Buying signals: [Recently raised funding, hiring engineers, expanding product]
7. Disqualifiers: [Government, enterprise >5000, outside target geo]

In that template, ARR stands for Annual Recurring Revenue — a common shorthand for company scale. Store your ICP as a structured prompt that feeds into the scoring step.


Step 2: Source identification and Apify scraping

Google Maps leads (local businesses, agencies, services)

The Google Maps Scraper is the highest-value Apify Actor for lead generation:

{
"searchStringsArray": ["marketing agencies in Austin TX", "SaaS companies in San Francisco"],
"maxCrawledPlacesPerSearch": 100,
"language": "en",
"includeWebResults": true
}

Verify includeWebResults and other fields against the current Google Maps Scraper input schema — Actor inputs change over time.

Output per lead: company name, address, phone, website, rating, review count, category, opening hours.

LinkedIn leads (B2B professionals)

Use Apify's LinkedIn scrapers from the Apify Store:

  • Company profiles — employee count, industry, headquarters, recent posts
  • Job postings — hiring signals (AI, engineering expansion)
  • People profiles — decision-makers in target companies
LinkedIn compliance

LinkedIn actively blocks scraping. Use residential proxies, low concurrency (1-2 requests/second), and comply with LinkedIn's Terms of Service. For high-volume enterprise use, consider LinkedIn Sales Navigator API. See Best Proxies for LinkedIn Scraping.

Industry directories and websites

Use the Website Content Crawler for:

  • SaaS directory listings (G2, Capterra, ProductHunt)
  • Industry association member pages
  • Conference attendee lists (publicly available)

For the complete scraping guide, see Web Scraping Lead Generation Guide.


Step 3: AI enrichment

For each scraped lead, enrich with additional data using Claude or Ollama.

Enrichment prompt

Analyze this company based on their website content and available data.
Extract and return as JSON:

{
"company_name": "string",
"employee_estimate": "number or range",
"industry": "string",
"tech_stack_signals": ["list of technologies detected"],
"revenue_tier": "pre-revenue | <$1M | $1M-$10M | $10M-$50M | $50M+",
"business_model": "B2B SaaS | B2C | marketplace | services | other",
"recent_news": "string (latest announcement or milestone)",
"key_decision_makers": ["list of C-level/VP titles found"]
}

Company website content:
[scraped content here]

Implementation options

OptionCostQualitySpeed
Claude API (Sonnet)~$0.003-$0.01 per leadHigh2-5 sec/lead
Claude API (Haiku)~$0.0005-$0.002 per leadMedium1-2 sec/lead
Ollama (Llama 3.1 8B)$0 (self-hosted VPS cost)Medium3-10 sec/lead

For high-volume enrichment (1,000+ leads/day), self-hosted Ollama is the most cost-effective. See Self-Host Ollama + n8n + Coolify.


Step 4: AI lead scoring

Score each enriched lead against your ICP from Step 1.

Scoring prompt

You are a B2B sales qualification expert.

Score this lead 1-10 against our ICP:
- Target: B2B SaaS companies, 10-200 employees, $1M-$50M ARR
- Geography: US or EU
- Tech signals: Uses cloud infrastructure, modern web stack
- Buying signals: Recently hired, raised funding, expanding product

Lead data:
[enriched lead JSON]

Respond with ONLY this JSON:
{
"score": 8,
"reasoning": "One sentence explaining the score",
"recommended_outreach": "personalized | template | skip",
"outreach_angle": "One sentence on best approach"
}

Score distribution targets

ScoreMeaningActionExpected % of leads
9–10Perfect ICP fit + buying signalsPriority outreach (personalized)5–10%
7–8Good ICP fitStandard outreach (semi-personalized)15–25%
5–6Partial fitNurture sequence25–35%
1–4Poor fitSkip or archive30–50%

Step 5: CRM push

Option A: Clay

Clay is built for AI-enriched lead workflows:

  1. Create a Clay table with columns matching your enrichment schema
  2. Use Clay's API integration to push enriched leads
  3. Clay handles deduplication and further enrichment automatically

See Apify + Clay Integration and Clay CRM Review 2026.

Option B: HubSpot

Push scored leads to HubSpot via their API:

# Note: `ai_fit_score` is not a default HubSpot property.
# Before running this, create a custom contact property in HubSpot:
# Settings → Properties → Create property → Contact → Number type → Name: ai_fit_score
# Then use the internal name you chose (e.g., "ai_fit_score") in your API calls.
{
"url": "https://api.hubapi.com/crm/v3/objects/contacts",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR_HUBSPOT_TOKEN",
"Content-Type": "application/json"
},
"body": {
"properties": {
"email": "lead@company.com",
"company": "Acme Corp",
"ai_fit_score": "8",
"lead_source": "ai_pipeline"
}
}
}

See Make.com + HubSpot CRM Automation.

Option C: Google Sheets

For teams not ready for a CRM, Google Sheets works:

  • Push enriched leads as new rows
  • Use conditional formatting for score-based highlighting
  • Share with the team for manual follow-up

Step 6: Orchestration with n8n or Make.com

n8n workflow

[Schedule: Daily 06:00]
→ [Apify API: Run Google Maps Scraper]
→ [Wait for completion]
→ [Apify API: Fetch dataset]
→ [Loop: For each lead]
→ [HTTP: Scrape company website via Apify]
→ [HTTP: Call Ollama/Claude for enrichment]
→ [HTTP: Call Ollama/Claude for scoring]
→ [IF: Score >= 7]
→ [HTTP: Push to HubSpot]
→ [Slack: Alert "New qualified lead"]
→ [ELSE]
→ [Google Sheets: Archive]

Make.com workflow

The same logic in Make.com with visual modules. See Make.com Lead Generation Pipeline for step-by-step.


Cost model

Projected costs per 500 leads processed:

ComponentCost per 500 leadsNotes
Apify scraping (Google Maps)~$5–10~100 CU (compute units, Apify's usage billing unit) for 500 listings
Apify scraping (company websites)~$10–20Website Content Crawler, 5 pages each
Claude API enrichment (Sonnet)~$1.50–5~1,000 tokens/lead
Claude API scoring~$0.50–2~300 tokens/lead
CRM$0–49HubSpot free, Clay $149+
Orchestration$0–49n8n self-hosted free, Make.com $9+
Total per 500 leads~$17–85
Cost per lead$0.03–0.17vs $5–15 for manual research

With self-hosted Ollama replacing Claude API, the enrichment and scoring cost drops to $0, bringing the per-lead cost to $0.02–0.06.


Compliance: General Data Protection Regulation (GDPR), CAN-SPAM, and ethical scraping

RegulationWhat it coversYour obligation
GDPR (gdpr.eu)EU personal dataLegitimate interest basis for B2B prospecting; right to deletion; data minimization
CAN-SPAMUS commercial emailOpt-out mechanism, physical address, no deceptive headers
CCPACalifornia consumer dataRight to know, right to delete, right to opt-out
Ethical scrapingApify compliance guideRespect robots.txt, rate limits, no login circumvention

Practical guidelines:

  1. Only scrape publicly available business data
  2. Never scrape behind login walls without permission
  3. Include unsubscribe links in all outreach emails
  4. Implement a deletion process for GDPR requests
  5. Minimize personal data: collect only what you need
  6. Document your legitimate interest basis for B2B prospecting

Frequently Asked Questions

With the recommended setup: 200-1,000 leads/day on Apify Starter plan ($29/month). Bottleneck is usually the Apify compute units, not the AI processing. For higher volume, upgrade to Apify Scale or use multiple Actor instances.

Google Maps data is publicly accessible and scraping for business purposes is generally accepted. LinkedIn's Terms of Service prohibit scraping; enforcement varies. For LinkedIn, consider official APIs (Sales Navigator) or accept the risk of account restrictions. Always consult legal counsel for your specific jurisdiction.

On well-defined ICP criteria with good enrichment data, expect 70-85% agreement with human scoring. The main failure mode is insufficient data — if the company website is sparse, the score is unreliable. Mitigate by adding a confidence field to your scoring prompt and flagging low-confidence scores for human review.

Claude API (Sonnet) produces higher quality enrichments but costs $0.003-$0.01 per lead. Self-hosted Ollama (Llama 3.1 8B) is free per-lead but requires a $12-25/month VPS and produces slightly lower quality output. Use Claude for high-value leads (under 100/day), Ollama for bulk processing (1,000+/day).

Implement deduplication at the pipeline level: hash email + company name as a unique identifier. Use upsert (update-or-insert) operations instead of creates. Clay handles deduplication natively. For HubSpot, use the search-before-create pattern.

Google Maps Scraper for local businesses and agencies. Website Content Crawler for company data enrichment. Google Search Scraper for finding company websites by name. See our Best Lead Generation Actors guide for the complete list.

Yes, but add compliance safeguards: verify email addresses before sending, include unsubscribe links, and honor opt-out requests within **10 business days** as required by **CAN-SPAM** — confirm current FTC guidance at ftc.gov CAN-SPAM compliance. Never send to purchased lists without legal review. The scoring step should filter leads where outreach is inappropriate.

ZoomInfo ($15,000-$30,000/year) and Apollo ($49-$119/month) provide pre-built databases. This pipeline builds a custom database from public sources at $17-85 per 500 leads. The trade-off: you invest setup time but get fresher data, custom enrichment, and no per-seat licensing.


AI lead generation in 2026 is not about replacing sales people — it is about giving them better data, faster. The pipeline above processes raw web data into scored, enriched CRM records at $0.03–$0.17 per lead, compared to $5–15 for manual research.

Start with one source (Google Maps is the fastest to set up), build the pipeline end-to-end, validate lead quality, then expand to LinkedIn and directories.

Sign up on Apify to start scraping leads today. For visual pipeline building, create a Make.com account. For AI-powered CRM, evaluate Clay.

Common mistakes and fixes

LinkedIn scraper returns empty results.

LinkedIn aggressively blocks scrapers. Use residential proxies (Bright Data or IPRoyal), reduce concurrency to 1-2, and add 5-10 second delays. Consider LinkedIn's official Sales Navigator API for enterprise use.

Lead scoring returns inconsistent results.

Add few-shot examples to your scoring prompt. Include 3-5 examples of scored leads with reasoning. Pin the model version (e.g., llama3.1:8b, not llama3.1:latest).

CRM push fails with 'duplicate record' errors.

Implement deduplication before CRM push: hash email + company name for unique ID. Use upsert (update-or-insert) instead of insert for idempotent writes.