Duck
Tutorials8 min read

Building AI Agents for Lead Generation: The Operator's Playbook

Samet Turan— Editor··8 min read

Stop manually researching leads. Learn to build autonomous AI agents that find, qualify, and personalize outreach, so you can focus on closing deals. A practical guide.

You’re Wasting Time on Manual Lead Research

Let’s be direct. If you’re still manually copy-pasting company names into a spreadsheet and then visiting each website to see if they’re a fit, you’re burning your most valuable asset: time. The entire process is repetitive, slow, and soul-crushing. You can build a system of AI agents for lead generation that does 90% of this work for you. After reading this, you’ll understand the components, know how to structure the prompts that actually work, and recognize why these systems break—and how to fix them.

The Minimum Viable Stack

Forget the complex diagrams and theoretical frameworks. To get a lead generation agent running by this afternoon, you need three things:

🤖
Recommended Reading

AI Side Hustles

12 Ways to Earn with AI

Practical setups for building real income streams with AI tools. No coding needed. 12 tested models with real numbers.


Get the Guide → $14

★★★★★ (89)

  • A Data Source: This is where your raw, unfiltered leads come from. You can start with a list of domains in a Google Sheet. For more firepower, a tool like Apollo.io is the standard. Its free tier is decent enough to get started, giving you a pool of companies to sift through.
  • An Orchestrator: This is the assembly line that moves data between services. It’s the glue. Make.com is my pick for this. It’s more visual and, I find, more intuitive for complex workflows than Zapier. The free plan is a joke for anything serious, but the Core plan at $9/mo is fair and gives you enough operations to run meaningful tests.
  • A Brain (LLM): This is the AI that does the actual thinking. You’ll need an API key from a provider like OpenAI (GPT-4o) or Anthropic (Claude 3 Sonnet). Sonnet is faster and cheaper, making it a great choice for this kind of classification task. Don’t try to use the free ChatGPT interface for this; you need API access to automate it.

That’s it. A data source, an orchestrator, and a brain. This simple stack can qualify thousands of leads while you sleep.

What Most Guides on AI Agents for Lead Generation Get Wrong

Almost every tutorial I’ve seen makes the same critical mistake. They show a simplistic prompt like: "Is this company a good fit for my agency? Here's their website content: [content]". This will fail spectacularly in production.

Why? Because you’re asking the LLM to do two things at once: analyze the data and decide on the output format. The result is inconsistent, unreliable garbage. Sometimes you’ll get “Yes, it seems like a good fit.” Other times you’ll get a full paragraph. You can’t build an automation on top of that.

The key is to force the LLM to return structured data. JSON is the goal. My favorite technique is to wrap my instructions in XML-like tags. The model sees the structure and is much more likely to follow it.

Here’s a better prompt structure:

You are a lead qualification expert for a marketing agency that specializes in B2B SaaS companies with 50-200 employees. Your task is to analyze the provided website text and determine if the company is a good fit. Respond ONLY with a valid JSON object.[Insert scraped website text here]{"is_qualified": boolean, "reasoning": "string (explain your decision in one sentence)", "industry": "string (e.g., 'FinTech', 'MarTech')", "employee_count_estimated": "string (e.g., '50-200')"}

This is an order, not a request. You’re giving it a role, a clear task, the data, and a non-negotiable output format. This is the foundation of a reliable ai agent framework.

Step-by-Step: Building Your Qualification Agent in Make.com

Let’s build the first agent. Its only job is to look at a company website and decide if it meets our Ideal Customer Profile (ICP). For this example, our ICP is: B2B SaaS companies, 50-200 employees, based in North America.

  1. The Trigger: Start with a Google Sheet. Create columns for `company_domain`, `status`, `is_qualified`, and `reasoning`. The Make.com scenario will use the “Watch New Rows” module to trigger every time you add a new domain.
  2. The Scrape: Next, add an `HTTP > Make a request` module. Plug in the `company_domain` from the Google Sheet. This module will fetch the raw HTML from the company’s homepage. This is the simplest way to get the content.
  3. The Brain: Add an `OpenAI` or `Anthropic` module. In the prompt section, use the structured prompt from the previous section. Map the HTML content from the HTTP module into the `[Insert scraped website text here]` part of your prompt.
  4. The Write-Back: The LLM will output a JSON string. Use a `JSON > Parse JSON` module in Make to turn this string into usable data fields. Then, add a `Google Sheets > Update a Row` module. Find the original row and update the `is_qualified` and `reasoning` columns with the parsed data from the LLM. Set the `status` to “Processed”.

You now have a closed-loop system. Add a domain to the sheet, and a few seconds later, the sheet updates with the qualification result. This is a real, working AI agent.

Why Does This System Break at Scale?

Because the real world is messy. The simple system we just designed will work for 10 leads. It will start to fall apart with 100, and it will be a dumpster fire with 1,000.

Here’s what breaks.

The simple HTTP request module can’t handle websites built with modern JavaScript frameworks (like React or Vue). It just gets the initial loading script, not the actual content. My biggest gripe with this entire process is getting clean text from websites. You’ll feed the LLM a bunch of JavaScript gibberish, and it will confidently tell you the company sells “user-centric solutions,” which is useless. You’ll need a more advanced scraping tool like ScrapingBee or run your own headless browser using a service like Browserless.io. This adds cost and complexity.

You’ll also hit rate limits. Your orchestrator, your data source, and your LLM provider all have limits on how many requests you can make per minute. A naive loop will get you temporarily banned. You need to add error handling and delays between your steps (which, yes, is annoying but necessary).

Finally, cost. While a single run might be cheap ($0.03 per lead), failed runs still cost money. If your scraper fails on 20% of your list, you just paid for nothing. This is the part of the operator playbook nobody talks about: you spend as much time optimizing for cost and failure as you do building the core logic.

From Qualification to Personalization: The Second Agent

This is where things get interesting. Once a lead is marked as `is_qualified: true`, you can trigger a second agent to write a personalized opening line for a cold email.

This is my favorite part of the whole system.

This agent follows a similar pattern, but its goal is different. It scrapes the “About Us,” “Blog,” or “Case Studies” page and looks for something specific: a recent funding announcement, a new product launch, a specific customer success story. You feed that context to another, more creative LLM prompt.

A prompt for this might look like:

You are a world-class copywriter specializing in cold outreach. Based on the following text from a company's website, write one compelling, specific, and slightly informal opening sentence for a cold email. The sentence should mention a specific detail from the text. Do not start with "I saw..." or "I noticed...". Output only the sentence.

The output is a hyper-personalized line like, “The recent launch of your new compliance dashboard for FinTechs seems perfectly timed.” That’s an opener that gets a reply. Chaining these agents together—one for qualification, one for personalization—is how you build a powerful no code AI engine for your business.

A Practical Debugging Workflow

When it breaks, don’t panic. Debugging these systems is methodical.

  • Isolate the failure point. Make.com’s visual interface is great for this. You can see exactly which module turned red and failed. Click on it and inspect the input and output data.
  • Did the scrape work? 90% of the time, the problem is the scrape. Check the output of your HTTP module. Is it clean HTML or JavaScript soup? If it’s the latter, you need a better scraping tool.
  • Is the LLM getting good data? Look at the exact prompt that was sent to the LLM. Did the data from the previous step map correctly? Sometimes a variable is empty, and you’re sending a blank request.
  • Is the LLM outputting valid JSON? Occasionally, even with a strong prompt, the LLM will mess up and return a malformed string. You need to add an error-handling route in your Make scenario to catch these and either retry or flag them for manual review.

If you find yourself constantly fighting the scraping and data cleaning part, it might be time to look at a more integrated platform. A tool like Clay combines the data sourcing, scraping, and AI enrichment in one place. Honestly, Clay is probably the best integrated tool for this, but at $349/month for their Explorer plan, it’s a commitment. You’re paying a premium to avoid the headaches of building it yourself.

We cover this in more depth elsewhere — deeper coverage of AI agent platforms.

Building this system from scratch forces you to understand every moving part. It’s a valuable skill. If you’d rather skip the build and deploy a working version in an afternoon, we’ve packaged this entire workflow as a production-ready ai automation blueprint. It includes the prompts, the error handling, and the step-by-step configuration. You can find the AI Agent Builder Kit at deepusecase.com/vault/ai-agent-builder-kit.

— The Colophon

One AI tool. Tested. Reviewed.
In your inbox every Sunday.

~3 minute read. Real outcomes from operators, not marketers.

Free. One email per Sunday. Unsubscribe in one click.