Learn how to design, test, and deploy an AI agent swarm for lead generation using real prompts, tools, and a step‑by‑step workflow you can copy today asap
Building an AI Agent Swarm: From Prompts to Production
Running solo outreach feels like juggling ten tabs while the clock ticks. You copy‑paste the same pitch, tweak a line, hit send, and wonder if there’s a smarter way.
After reading this, you’ll be able to sketch a swarm of AI agents that scrape leads, personalize messages, and follow up — all without writing a single line of traditional code.
Why does a single agent choke when you scale to hundreds of leads?
One agent trying to handle every step — scraping, drafting, sending — becomes a bottleneck. The model hits rate limits, the workflow stalls, and you end up babysitting the process instead of letting it run.
Swapping that monolith for a swarm splits the work: a scraper agent pulls fresh URLs, a Writer agent crafts the copy, and a sender agent handles the dispatch. Each piece can run in parallel, retry on its own, and fail without taking down the whole line.
Think of it like a small factory line instead of a single artisan doing everything by hand.
What most guides get wrong about AI agent swarms
Many tutorials treat the swarm as a fancy prompt chain and stop there. They show you how to feed the output of one GPT call into the next and call it a day.
That approach ignores three hard realities: state management, error isolation, and cost control. If the writer agent hallucinates a phone number, the sender will blast a bad message unless you have a validation step.
Most guides also skip the part where you need to persist intermediate results between runs. Without a simple store — think a Google Sheet or Airtable — you lose context when the workflow restarts.
Finally, they rarely mention pricing. Running ten agents per lead can eat through your OpenAI quota fast if you don’t cache embeddings or reuse completions.
A real‑world prompt and tool stack I use
Here’s the exact prompt I give the writer agent when I’m targeting SaaS founders:
You are a concise cold‑email copywriter. Write a 120‑word email that:
– Opens with a specific observation about the prospect’s recent product launch (use the variable {{launch_note}})
– States one tangible benefit of using {{your_product}} for their team
– Includes a low‑pressure call‑to‑action to book a 15‑minute demo
– Keeps the tone friendly, no jargon, no fluff
I store {{launch_note}} in a column of a Google Sheet that the scraper agent fills after pulling the product’s blog post. The sender agent then reads the finished email from the sheet and fires it via SendGrid.
For the scraper I rely on Apify (free tier gives you 10 000 result‑cells per month, enough for a few hundred leads). The workflow orchestrator is the Make platform on the Core plan at $29/mo — fair for the automation minutes you get.
The writer agent calls the OpenAI API with model gpt-4o-mini, temperature 0.2, and max_tokens 250. I cache the completion hash in the sheet so if the same launch note appears again I don’t pay twice.
Setting up the swarm in Make.com
- Create a new scenario and add a Google Sheets module to read the lead list.
- Add an HTTP module that calls the Apify actor for Google Search; map the search query to the lead’s company name.
- Use a Parser module to extract the first result URL and pass it to a second Apify actor that scrapes the page for the latest blog post title.
- Store the scraped title back into the sheet as {{launch_note}}.
- Add an OpenAI module (Create a Completion) with the prompt above; insert {{launch_note}} and {{your_product}} as variables.
- Write the generated email to a new column in the sheet.
- Add a SendGrid module to send the email from the sheet column; set it to run only if the email column is not empty.
- Enable error handling on each module: set “Break on error” to off and route failures to a Slack notifier so you see the raw response.
- Schedule the scenario to run every hour or trigger it via a webhook when you add new leads.
That’s the whole loop. Each step is independent, so if the scraper fails the writer still holds its last good output and the sender won’t fire a blank email.
How to debug when the swarm stalls
First, check the scenario history in Make.com. Look for the module with a red flag and open its output.
If the Apify actor returns an empty array, the problem is usually the search query — maybe the company name changed or the actor hit a usage limit. Adjust the query or add a delay before the call.
If the OpenAI module shows a 429, you’ve hit your rate limit. Either upgrade your tier or add a cache step so repeated launch notes don’t re‑call the model.
When the SendGrid module fails, inspect the raw HTTP response in the Slack notifier. A common issue is a missing “from” address; fix it in the SendGrid module settings and re‑run.
Finally, verify the Google Sheet isn’t hitting its cell limit. A scenario that writes thousands of rows per day will eventually choke; archive old leads to a separate sheet.
Cost snapshot for a solo operator
- Apify free tier: $0 (covers ~300 leads/month)
- Make.com Core: $29/mo (includes 10 000 operations, plenty for hourly runs)
- OpenAI gpt-4o-mini: ~$0.00015 per 1 000 tokens; at 250 tokens per email and 200 emails/day that’s ~$0.75/day or $22/mo
- SendGrid: free tier allows 100 emails/day; beyond that it’s $15/mo for 40 000 emails
- Google Workspace (for Sheets): $6/mo if you don’t already have it
Total: roughly $70‑$80/mo for a fully automated swarm that can handle a few thousand leads each month. I think that’s a fair price for the time saved — though I’ll admit the OpenAI cost can creep up if you forget to cache.
One concrete gripe: the Make.com UI hides the raw HTTP status code unless you dig into the “Data” tab, which feels like a extra click every time you need to see why an API call failed.
One concrete love: I love how the OpenAI API lets you set temperature to 0.2 and still get copy that sounds human but is repeatable enough to A/B test subject lines without worrying about random drift.
If you want the deep cut on this, 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/ai-agent-builder-kit.