Learn how to build an AI-powered lead gen pipeline that scrapes, enriches, and emails prospects—complete with real prompts, tool costs, and debugging tips.
Last month I needed to fill a sales calendar for a new consulting offer and realized my manual outreach was eating up three hours a day. I decided to automate the whole flow: scrape LinkedIn, enrich with email finders, write personalized lines with an LLM, and send via SMTP. After a few false starts I got a working system that now runs while I sleep.
What most guides get wrong about AI-powered lead gen
Most tutorials treat the AI step as a magic black box: drop a prompt, get perfect copy, and move on. They ignore the fact that language models hallucinate company names, mix up personas, and produce tone‑deaf lines if you don’t give them tight constraints. The result is a list of emails that look plausible but get flagged as spam or, worse, embarrass the sender.
What they also skip is the data hygiene step. Scraped profiles often come with missing fields, duplicate entries, or weird characters that break downstream templates. If you feed that raw junk into the model you’ll get garbage out, no matter how fancy the prompt.
Finally, many guides assume you can run everything on a free tier forever. They show a Zapier workflow with five steps and never mention that the premium scraper or the AI API will start charging after a few hundred calls.
A concrete named example: tools, prompts, and cost
Here’s the stack I actually run, with first‑mention tool names bolded.
- Apify – runs a LinkedIn scraper that returns name, title, company, and profile URL. I use the “LinkedIn Search Export” actor, set to 100 results per run.
- Hunter.io – takes the company domain from Apify and returns a verified work email. I call it via their API with a simple GET.
- OpenAI GPT-4 – receives a JSON blob with prospect details and a short instruction set (see code block). It outputs a personalized first line and a subject line.
- Make.com – orchestrates the whole flow: triggers the Apify actor, waits for the dataset, loops over each record, calls Hunter, calls OpenAI, assembles the email, and sends via SMTP2Go.
- SMTP2Go – handles delivery and gives me open/click stats for $10/mo.
The prompt I feed to GPT-4 looks like this:
You are a senior sales copywriter. Write ONE subject line (max 60 characters) and ONE opening sentence (max 20 words) for a cold email to the prospect below. Keep the tone professional but friendly, avoid flattery, and reference a specific detail from their LinkedIn headline or recent post.
Prospect data:
{ "first_name": "${firstName}", "last_name": "${lastName}", "title": "${title}", "company": "${company}", "linkedin_headline": "${headline}" }
Return ONLY a JSON object with keys "subject" and "opening". No extra text.
I store this prompt as a constant in Make and pass the scraped fields as variables. The model reliably returns valid JSON because I constrain the output format and limit the length.
Cost breakdown (monthly, based on my current volume of 1,500 prospects):
- Apify actor runtime: $15 (500k compute units)
- Hunter.io API: $49 (5,000 lookups)
- OpenAI API: $18 (≈120k tokens at $0.15 per 1k)
- Make.com operations: $29 (core plan, 10k operations)
- SMTP2Go: $10 (50k emails)
- **Total**: $121/mo
I think $121/mo is fair for a fully automated pipeline that saves me roughly 12 hours of manual work each week. If you’re just testing, you can drop Apify to the free tier (limited to 50 results) and use Hunter’s free 50 lookups, which brings the cost under $30/mo—enough to validate the idea.
Why does my pipeline stall after 200 leads?
This is the question I kept asking myself when the Make scenario would suddenly stop with a “429 Too Many Requests” error from Hunter. The answer turned out to be threefold.
First, Hunter’s free tier enforces a hard limit of 5 requests per second; my loop was firing calls as fast as Make could iterate, which blew past that threshold.
Second, Apify’s actor returns data in pages; I forgot to add a pause between page fetches, so the scraper would hit LinkedIn’s temporary IP ban after a few hundred profiles.
Third, the OpenAI call was set to “max_tokens”: 150, which is plenty, but I omitted a timeout setting. When the model took longer than 10 seconds (rare but happens under load), Make would retry and eventually exhaust its operation budget.
Fixes I applied:
- Added a 1.2‑second delay after each Hunter call in Make (using the “Sleep” module).
- Configured the Apify actor to request pages with a 2‑second interval between them (built‑in option).
- Set a 20‑second timeout on the OpenAI module and limited retries to one.
Since those tweaks the scenario runs smoothly to completion, even at 3,000 prospects.
Putting it all together: step‑by‑step setup
- Create an Apify account and add the “LinkedIn Search Export” actor to a new task. Set the search keyword (e.g., “VP of Marketing SaaS”) and limit to 100 results per run.
- In Make, add an “Apify Watch Run Results” module pointed at that task. Connect it to a “Router” that splits each record into its own path.
- Add an HTTP “GET” to Hunter.io: https://api.hunter.io/v2/email-finder?domain={company}&api_key=YOUR_KEY. Map the company field from Apify.
- Add another HTTP “POST” to the OpenAI Chat Completions endpoint. Paste the prompt JSON from the code block into the “messages” array, replacing the placeholder variables with the mapped fields from Apify and Hunter.
- Add a “JSON Parse” module to extract the “subject” and “opening” from the model’s response.
- Use the “Email > Send Email” module (SMTP2Go) to assemble the final message: subject line from step 5, opening line from step 5, then a static body with your CTA.
- Set the scenario to run on a schedule (I use 02:00 AM daily) and enable error handling with email alerts.
- Monitor the first few runs in Make’s execution log; look for 429 responses or empty Hunter results and adjust delays as needed.
If you’ve tried Zapier, you know what I mean when I say the visual debugger in Make saves hours of guesswork.
Price‑to‑value take
At $121/mo the pipeline pays for itself if it books just one extra consulting call per month (my average deal is $2,000). Even at the low‑end free‑tier experiment you’re spending under $30/mo for a system that runs while you sleep.
I love how the built‑in scheduler in Make lets me launch the pipeline at 2 a.m. without fiddling with cron or a separate server—it just works.
My gripe? The docs for Apify’s actor assume you already know JSON schema and never show a concrete example of the output format, which forced me to reverse‑engineer the fields by trial and error.
(Which, yes, is annoying.)
Adjacent reading: deeper coverage of AI agent platforms.
If you’d rather skip the build and deploy a working version in an afternoon, we’ve packaged this workflow as a blueprint at deepusecase.com/vault.