Skip to main content

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

· 16 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: $19/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 (optional: the one-chat version needs neither)

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 │ │
│ └──────────────────────────────────────────────────────────────┘ │
└───────────────────────────────────────────────────────────────────────┘

No n8n: do it in one Claude chat​

The full pipeline below is built for volume: thousands of leads a day, on a schedule, with retries. If you need 20 to 200 leads for one campaign, you can run the same four stages (source, score, dedupe, push) in a single Claude chat with two connectors: Apify for the scraping and HubSpot's official connector for the CRM. There is nothing to orchestrate, because you are the orchestrator: Claude does a step, shows you the result, and waits.

When to use which:

One Claude chatn8n or Make.com pipeline
VolumeTens to a few hundred leads per runHundreds to thousands per day
ScheduleWhen you ask (or a Cowork scheduled task)Cron, with retries and alerts
ReviewYou see every lead before it is writtenRules decide; you review samples
SetupTwo connectors, one promptWorkflow build, API keys, error handling

Worked example: dentists in Austin​

Say you sell patient-booking software to independent dental practices. The prompt below has Claude find practices in Austin on Google Maps, score them against that offer, remove duplicates already in your CRM, and create the rest in HubSpot after you approve the list.

Build a scored lead list in one Claude chatInteractive setupPaste into Claude

Claude asks for your offer and target market, runs a priced 5-place test on Google Maps, then scores, dedupes and pushes approved leads to HubSpot or a CSV. It asks before every paid run and every CRM write.

  1. Asks what you sell, the business type, the area and how many leads you want
  2. Checks the Apify and HubSpot connectors and reads the Google Maps Actor's current inputs
  3. Runs a 5-place test and shows the results and the cost
  4. Runs the full search, scores each place and shows you a ranked table
  5. Checks HubSpot for duplicates by domain and creates only the leads you approve
Help me build a scored local-business lead list in this chat, using the Apify
connector and (if connected) HubSpot. Ask me ONE question at a time, and never
spend money or write to my CRM without my explicit OK.

1. INTERVIEW. Ask me, one at a time:
- what I sell, in one sentence
- the business type to search for (e.g. "dentist") and the area
(e.g. "Austin, Texas, USA")
- how many places I want (suggest starting with 50)
- what makes a good fit for my offer (e.g. independent practice, has a
website, rating, review volume) and what disqualifies a place
- destination: HubSpot companies, or a CSV file

2. CHECK. Confirm you can use the Apify tools (fetch-actor-details, call-actor,
get-dataset-items). If not, tell me to add a custom connector in Claude's
settings (Customize > Connectors > Add custom connector) with:
https://mcp.apify.com?tools=fetch-actor-details,call-actor,get-dataset-items
and wait. If I chose HubSpot, confirm the HubSpot connector is connected.
Then call fetch-actor-details for compass/crawler-google-places and use the
input names and prices it returns.

3. TEST. Tell me the run and its maximum cost, wait for "go", then run
compass/crawler-google-places with searchStringsArray [my business type],
locationQuery [my area], maxCrawledPlacesPerSearch 5, website "withWebsite".
Show the 5 places (name, category, rating, review count, website) and the
cost from the run's charged events. Ask if the results look right.

4. FULL RUN AND SCORE. After my OK, run it with my full count. Then:
- strip tracking parameters (utm_*) from every website and use the bare
domain as the unique key; drop duplicates and permanently closed places
- score each place 1-10 against my fit criteria, with a one-line reason;
if a criterion cannot be judged from the data, say "unknown", don't guess
- show me a table ranked by score

5. PUSH. For places I approve (default: score 7+):
- HubSpot: search companies by domain first; skip any that already exist
and list them. Create the rest as companies with name, domain, phone,
address and a note containing the score, the reason and the Google Maps
URL. Show me the first 5 writes and wait for my OK before continuing.
- CSV: write the approved rows to leads.csv.

Business contact details only. Do not look up individual people, and do not
send any message to anyone.

Claude asks before each change it makes. Read each step before you approve it.

What the test returned​

We ran step 3 on 2026-10-21 (searchStringsArray: ["dentist"], locationQuery: "Austin, Texas, USA", 5 places, websites required, closed places skipped). This is real output from a test run on 2026-10-21, with practice names left out:

CategoryNeighborhoodRatingReviewsWebsite
DentistSouth Brodie4.81,126yes
Cosmetic dentistSouthpark Meadows4.9880yes
DentistCherry Creek4.9500yes
DentistCherry Creek4.9487yes
DentistSouthpark Meadows4.7718yes, with utm_ tracking parameters

Three things worth knowing before the full run:

  • The top of a Maps search is already saturated. All five had 4.7 stars or more and close to 500 reviews or more. If your offer is "get more reviews", these are your worst prospects; ask Claude to sort by fewer reviews instead.
  • Websites from Maps carry tracking parameters. One came back with utm_source=google.com&utm_medium=business+profile. Dedupe on the raw URL and the same practice can appear twice in your CRM, which is why the prompt strips them and keys on the domain.
  • Filters are billed per place. The run was charged 5 place events and 10 filter events: two filters on, five places. On a paid plan that was about $0.015 for the places, $0.010 for the filters and $0.0002 in start fees: the filters were 40% of the bill. "Websites only" is worth paying for if you would otherwise discard many places. Closed places are rare, so it is cheaper to let Claude drop them than to pay the filter on every place.

At list prices as of October 2026, a 50-place run with the website filter costs about $0.25 on the free plan ($0.004 per place subject to change · verified 2026-10-21 plus $0.001 per filter per place).

On HubSpot: HubSpot's connector for Claude can create and update companies, contacts and deals and log notes and tasks, on all HubSpot tiers, with a paid Claude plan. It respects the permissions set in HubSpot. We found no documentation saying whether it can create custom properties, so the prompt writes the score into a note instead of the custom ai_fit_score property used in Step 5.

Once a list exists, watching those accounts for hiring, funding and tech changes is a different job: see buying signals with Claude.


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 ($19/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.

Advertise on this page