How to Automate Sales Prospecting: My Real-World Agent Build
Last month, I needed to drastically scale our outbound efforts without hiring more SDRs. We’re a small team, and every minute counts. The goal was clear: figure out how to automate sales prospecting, from finding qualified leads to sending personalized cold emails, all while keeping costs sane and compliance in check. I’ve built enough agents to know the marketing hype usually doesn’t match production reality. This wasn’t about “revolutionary AI” — it was about getting actual leads in the pipeline.
How to Automate Sales Prospecting: The Grind of Building an Outbound Sequence Agent
I started with a specific target: SaaS founders in a niche industry. My agent needed to find their company, identify the founder, dig up their email and LinkedIn, and then draft a genuinely relevant cold email. We couldn’t just blast generic templates. This meant chaining together a few different tools. For initial data scraping and enrichment, I leaned on Clay.com. It’s got a decent set of integrations and you can customize workflows pretty deep, which, yes, is annoying to set up but essential for quality data. I’ve found it to be one of the more flexible options for this kind of data heavy lift.
My agent’s core was built using LangGraph. I picked it over CrewAI because I needed more explicit control over state and transitions, especially when dealing with API rate limits or incomplete data. CrewAI felt a bit too “magic” for a production system that needed predictable retries and error handling. I defined a graph with nodes for:
search_company_data: uses Clay.com to find company info.find_founder_contact: uses more Clay.com magic (and sometimes Hunter.io if Clay struck out) to get email/LinkedIn.draft_email_persona_one: an LLM call to draft the email, tailored to founder persona.review_and_send: human in the loop for final approval, then sends via SendGrid.
The draft_email_persona_one step was where the “how to write cold email” challenge really came in. I fed the LLM a few examples of high-performing cold emails and a detailed persona brief for our target customer. It wasn’t about telling the LLM to “write a good email”; it was about providing structured data: company name, founder name, a specific pain point we solve for their industry, and a clear call to action. Getting the prompt right here, iterative trial and error, was probably 40% of the build time. Honestly, most “AI writing” tools just don’t give you this level of control.
What Broke (and Why You’ll Hate It Too)
Debugging these agents? It’s a nightmare. A silent, expensive nightmare. My biggest concrete gripe was with LangGraph’s observability when things went sideways. When an LLM call failed or an API returned garbage, tracing the exact state and input that led to the error was a brutal exercise. LangSmith helped, sure, but it’s another dashboard to watch, another dependency. I spent hours staring at JSON logs, trying to figure out why an email was drafted with “Dear [Founder Name]” instead of the actual name. Turns out, a subtle data parsing error in an earlier node wasn’t propagating correctly. This is where agents silently fail: they don’t crash, they just produce subtly wrong, unusable output.
Cost overruns were another beast. Each LLM call adds up, especially when you’re iterating on prompts or retrying failed steps. My initial estimates for the draft_email_persona_one step were off by 30% because I underestimated the token usage for complex prompts and the need for multiple re-rolls to get a good draft. You can’t just set it and forget it. I had to implement strict token limits and fallbacks, even if it meant slightly less “perfect” emails sometimes. It’s a constant battle between quality and cost per lead.
And compliance? Oh boy. When you’re dealing with real user data — even publicly available company data and emails — you can’t just wing it. We had to ensure our data sources were compliant (GDPR, CCPA, CAN-SPAM for emails). The agent itself isn’t the compliance problem; it’s the data pipelines feeding it and the actions it takes. If your agent is scraping data, you’d better know where it’s coming from and what you’re allowed to do with it. This isn’t just a technical problem; it’s a legal and ethical one.