Skip to main content
MindStudio
Pricing
BlogAbout
My Workspace

How to Use AI Agents for Lead Generation: Find Prospects and Draft Personalized Emails

AI agents can research leads, find contact details, and draft personalized outreach emails saved directly to Gmail drafts. Here's a step-by-step workflow.

MindStudio Team RSS
How to Use AI Agents for Lead Generation: Find Prospects and Draft Personalized Emails

The Manual Lead Gen Problem Most Sales Teams Are Still Living With

Sales reps spend an average of 21% of their day writing emails, and another chunk of time hunting for contact info, researching prospects, and copying data between tools. That’s time not spent selling.

AI agents for lead generation change that equation. Instead of a rep manually Googling a company, finding a LinkedIn profile, pulling an email address, and writing a personalized pitch — an agent does all of it in sequence, automatically, and saves a draft directly to Gmail ready to review and send.

This guide walks through how that actually works: what the workflow looks like, what each step does, and how to build it yourself without writing a single line of code.


What AI Agents Actually Do in a Lead Gen Workflow

An AI agent isn’t a chatbot. It’s a sequence of automated steps — searching the web, pulling data from APIs, reasoning about what it finds, and taking action — all strung together to complete a multi-step task.

In a lead generation context, a well-built agent can:

  • Accept a target company name or URL as input
  • Research the company’s industry, size, recent news, and product focus
  • Find the right contact (job title match, decision-maker level)
  • Locate or verify an email address
  • Write a personalized outreach email based on everything it found
  • Save that email as a draft in Gmail (or send it directly, if you prefer)
REMY IS NOT
  • a coding agent
  • no-code
  • vibe coding
  • a faster Cursor
IT IS
a general contractor for software

The one that tells the coding agents what to build.

The key difference from a simple automation is the reasoning layer. The agent doesn’t just fetch and paste — it reads what it finds, decides what’s relevant, and writes something that sounds like a human did the research.


Before You Build: What You Need

This workflow is achievable with a no-code setup. Before starting, gather the following:

Inputs you’ll define:

  • Target company name or website URL
  • Ideal contact job title (e.g., “Head of Marketing,” “VP of Sales”)
  • Your value proposition (2–3 sentences the agent uses to personalize the pitch)
  • Your name and sender details

Integrations you’ll connect:

  • A web search tool (to research the company and find LinkedIn profiles)
  • An email finder tool or API (Hunter.io, Apollo, or similar)
  • Gmail or another email client (to save the draft)

Optional but useful:

  • A CRM like HubSpot or Airtable (to log the lead after the draft is created)
  • A list input (so the agent can process a batch of companies at once)

You don’t need to set up all of these at once. A good starting point is: search → research → write → save draft. Add CRM logging and email verification once the core loop works.


Step-by-Step: Building the Lead Research Workflow

Step 1: Define Your Ideal Customer Profile

Before the agent can find good leads, you need to tell it what a good lead looks like. This isn’t something AI agents guess — they follow the criteria you give them.

Write a short description that includes:

  • Industry or niche
  • Company size range (headcount or revenue)
  • Geography if relevant
  • Job titles that indicate a decision-maker for your offer
  • Pain points your product or service addresses

This description becomes part of the agent’s system prompt. The clearer it is, the more relevant the research output will be.

Step 2: Build a Company Research Step

The first functional step in your workflow is a web search that pulls key information about the target company.

Give the agent a prompt like:

“Research [Company Name]. Find: their primary product or service, approximate team size, recent news or announcements from the past 6 months, and any public signals of growth or pain points relevant to [your offer]. Return this as structured notes.”

The agent searches the web, reads the top results, and extracts what matters. It skips irrelevant content and surfaces only what’s useful for the outreach step.

This single step replaces 10–15 minutes of manual Googling per prospect.

Step 3: Find the Right Contact

Once the company is researched, the agent needs a specific person to reach out to.

This step typically combines two sources:

  1. LinkedIn search — The agent searches for “[Job Title] at [Company Name]” and identifies likely candidates based on public profile data
  2. Email finder API — Tools like Hunter.io, Apollo, or Snov.io have APIs that accept a company domain and a full name and return a verified (or confidence-scored) email address

The agent passes the contact name and domain to the email finder, gets the best available email, and appends it to the research notes from Step 2.

If no email is found with high confidence, you can instruct the agent to flag the lead for manual review rather than guess.

Step 4: Draft the Personalized Email

Everyone else built a construction worker.
We built the contractor.

🦺
CODING AGENT
Types the code you tell it to.
One file at a time.
🧠
CONTRACTOR · REMY
Runs the entire build.
UI, API, database, deploy.

This is where the agent earns its keep. Using everything it gathered — company background, recent news, contact name and role — it writes a tailored cold outreach email.

Your prompt for this step should specify:

  • Tone: Conversational, professional, or somewhere in between
  • Length: Short works better for cold outreach — aim for 100–150 words
  • Structure: Opening hook (tie to something specific about the company), value prop, clear call to action
  • What to avoid: Generic phrases, feature lists, overselling

A prompt that works well looks like this:

“Write a cold outreach email to [Contact Name], [Title] at [Company Name]. Use the research notes below to open with something specific to their business — a recent announcement, a relevant challenge, or a clear fit between their work and what we offer. Keep it under 150 words. Do not use filler phrases. End with a single, low-friction ask (a short call or a question). Sign off as [Your Name].”

The resulting draft should sound like you wrote it after spending 20 minutes researching the prospect — because the agent did.

Step 5: Save the Draft to Gmail

Once the email is written, the agent sends it to Gmail as a draft. It doesn’t send it automatically — that would be dangerous at scale without a human in the loop.

The Gmail integration accepts:

  • Recipient email address
  • Email subject line
  • Email body

The agent populates all three from its previous steps and creates the draft. You or your SDR reviews a queue of pre-written, pre-researched drafts each morning and sends the ones that look good.

This flips the model: instead of writing emails, your team is reviewing and approving them.


Making It Work at Scale: Batch Processing

Running this workflow on a single company is useful for testing. Running it on a list of 50 or 100 companies is where it becomes a real time-saver.

To batch-process, add a list input step at the beginning:

  • Pull company names from a Google Sheet, Airtable base, or CSV upload
  • Loop through each company and run the research → contact → draft → save pipeline
  • Log each result (company, contact, email address, draft status) back to your spreadsheet

A workflow like this can process dozens of leads overnight, leaving your team with a full Gmail drafts folder ready to review each morning.

One important note: some email finder tools charge per lookup, so build in a deduplication check. If a contact already exists in your CRM or has already been emailed, skip the lookup and move to the next company.


How to Personalize at Scale Without Sounding Generic

Personalization is only valuable if it’s specific. “I saw you recently raised a Series B — congrats!” is barely better than nothing if that’s the only personal touch.

A few approaches that make AI-drafted emails actually feel personal:

Anchor to a specific event Instruct the agent to search for company news from the past 90 days. A new product launch, a job posting for a specific role, or a leadership change all give you something concrete to reference.

Remy doesn't build the plumbing. It inherits it.

Other agents wire up auth, databases, models, and integrations from scratch every time you ask them to build something.

200+
AI MODELS
GPT · Claude · Gemini · Llama
1,000+
INTEGRATIONS
Slack · Stripe · Notion · HubSpot
MANAGED DB
AUTH
PAYMENTS
CRONS

Remy ships with all of it from MindStudio — so every cycle goes into the app you actually want.

Reference their stack or tools If your offer integrates with or competes with a specific tool, knowing a company uses that tool makes your email immediately relevant. Some email enrichment tools surface technographic data you can feed into the agent.

Match the pitch to the role A VP of Marketing and a Head of Operations have different priorities. Build role-specific value proposition templates and instruct the agent to select the right one based on the contact’s title.

Keep the template light The more templated your email, the more it reads like a template. Give the agent flexibility to rewrite the opening based on what it finds — even if the middle and CTA stay consistent.


How MindStudio Handles This Workflow

MindStudio is where this kind of workflow is actually easy to build. It’s a no-code agent builder with over 1,000 pre-built integrations — including Gmail, Google Sheets, Hunter.io, Apollo, and web search — all accessible without writing code or managing API keys separately.

You build the lead gen workflow described above visually, step by step:

  1. Define your inputs (company name, target title, your value prop)
  2. Add a web search step for company research
  3. Connect an email finder integration
  4. Add an AI step with your email drafting prompt — choosing from 200+ models including Claude, GPT-4o, or Gemini
  5. Connect the Gmail integration to save the draft
  6. Optionally loop over a list from Google Sheets or Airtable

The average workflow like this takes under an hour to build on MindStudio. Once it’s running, you can trigger it manually for individual prospects or set it to run on a schedule — processing a batch of companies from a shared list every weekday morning.

If you want to go further, MindStudio supports autonomous background agents that run on a schedule without any manual trigger, and you can add CRM logging to HubSpot or Salesforce in a few clicks. You can also build a simple UI on top of the workflow so anyone on your team can submit a company name and get a draft back in minutes.

You can try MindStudio free at mindstudio.ai.


Common Mistakes to Avoid

Even well-designed AI agent workflows for lead generation can fail in predictable ways. Here’s what to watch for:

Over-automating the send step Sending cold emails automatically at scale without review is a fast path to spam complaints and deliverability problems. Keep a human in the review loop, especially early on.

Using low-confidence email addresses Most email finders return a confidence score. Set a threshold (80% or higher is reasonable) and route anything below that to a manual review queue rather than drafting an email to a likely-wrong address.

Generic prompts produce generic emails If your drafting prompt doesn’t give the agent specific instructions about what to reference, it will default to vague, templated-sounding output. Be explicit: tell it what to look for, what to avoid, and how long the email should be.

Skipping deduplication If the same contact appears in multiple lists, you’ll draft duplicate emails and waste lookup credits. Add a CRM check at the start of your workflow to skip anyone already in your pipeline.

Plans first. Then code.

PROJECTYOUR APP
SCREENS12
DB TABLES6
BUILT BYREMY
1280 px · TYP.
yourapp.msagent.ai
A · UI · FRONT END

Remy writes the spec, manages the build, and ships the app.

Ignoring output review early on The first few dozen emails an agent drafts should be reviewed carefully. You’ll spot patterns — things it gets right and things it consistently misses — and you can refine the prompt before running larger batches.


Frequently Asked Questions

Can AI agents actually find accurate email addresses?

Yes, with caveats. AI agents don’t guess email addresses — they connect to email finder APIs like Hunter.io, Apollo, or Snov.io that use pattern matching, public data, and verification to return addresses. Accuracy varies by company size and data availability. Larger companies with common email formats (firstname.lastname@company.com) tend to have higher hit rates. You should always include a confidence threshold in your workflow and route low-confidence results to manual review.

It depends on your jurisdiction and how you use it. In the US, the CAN-SPAM Act applies to commercial email and requires accurate sender info, a physical address, and an easy opt-out mechanism. In the EU and UK, GDPR and PECR impose stricter rules around consent for cold outreach. The legality generally hinges on whether you have a “legitimate interest” basis for contacting someone. AI-generated content isn’t inherently illegal — the legal requirements apply the same way they do to manually written emails. Consult a legal professional if you’re scaling into regulated markets.

How do I make AI-drafted emails sound less robotic?

The key is specificity in your prompt. Tell the agent exactly what to reference (a company announcement, a specific pain point, a tool they use), how long the email should be, and what tone to use. Avoid prompts that just say “write a personalized email” — the agent needs guardrails. It also helps to write a few example emails yourself and include them in the prompt as style references. Reviewing and lightly editing early drafts will help you spot patterns and refine the prompt over time.

What’s the difference between this and a mail merge tool?

Mail merge tools fill in a name and company in a static template. That’s variable substitution, not personalization. An AI agent reads real information about each prospect and writes something contextually relevant to that specific company and contact. The emails are different from each other — not because the fields are different, but because the content is generated fresh based on what the agent found. The output quality is higher, and the emails are much harder to identify as templated at a glance.

Can I integrate this workflow with my CRM?

Yes. Most CRM platforms — HubSpot, Salesforce, Pipedrive — have APIs that let you log new contacts, update deal stages, or add activity notes. You can add a CRM logging step at the end of your workflow that creates a new contact record and attaches the drafted email as a note. This keeps your pipeline current without any manual data entry.

How many leads can an AI agent process at once?

Other agents ship a demo. Remy ships an app.

UI
React + Tailwind ✓ LIVE
API
REST · typed contracts ✓ LIVE
DATABASE
real SQL, not mocked ✓ LIVE
AUTH
roles · sessions · tokens ✓ LIVE
DEPLOY
git-backed, live URL ✓ LIVE

Real backend. Real database. Real auth. Real plumbing. Remy has it all.

That depends on your tool limits and API rate limits, not the agent itself. Web search APIs, email finders, and Gmail all have rate limits. A well-built batch workflow will respect these by adding delays between requests and processing in chunks. Practically, a workflow running overnight can typically process hundreds of leads. If you need to scale into thousands, you’ll want to check the rate limits on each service you’re connecting.


Key Takeaways

  • AI agents for lead generation handle the full sequence: company research, contact finding, email drafting, and saving to Gmail — with no manual work between steps.
  • The most valuable step is the AI drafting layer — it writes context-specific emails based on real research, not templates with swapped-in names.
  • Keep humans in the review loop before sending. Drafts go to Gmail; a person decides what gets sent.
  • Specificity in your prompts is the biggest lever for output quality. Generic instructions produce generic emails.
  • Batch processing lets you scale the same workflow across hundreds of prospects overnight, reviewed each morning.

If you want to build this workflow without managing code or API configurations, MindStudio gives you the integrations, AI models, and visual builder to set it up in under an hour. Start building for free at mindstudio.ai.

Related Articles

How to Use AI Agents for Lead Generation: Find Prospects and Draft Personalized Emails

Learn how to use AI agents to research leads, personalize cold emails at scale, and save drafts directly to Gmail without manual effort.

AutomationSales & MarketingWorkflows

Contact Goat: How Printing Press Finds Verified Emails via LinkedIn Without a Public API

Contact Goat cross-checks LinkedIn with Happenstand and runs deep email verification — all without a public API. Here's how to use it inside Claude Code.

WorkflowsAutomationSales & Marketing

How to Sell AI Automations to Local Businesses: 6 Claude Code Skills That Actually Work

Learn the six Claude Code skills—from skill creator to GSD—that businesses actually pay for, and how to pitch them as time-saving outcomes.

WorkflowsAutomationUse Cases

How to Build a Go-to-Market Strategy Tool With Replit Agent 4 and Parallel Agents

Use Replit Agent 4 to run competitive analysis, generate marketing assets, and build landing pages with parallel agents working simultaneously.

WorkflowsAutomationSales & Marketing

7 Agentic Loop Use Cases You Can Run Today: From SEO Audits to Error Sweeps

From overnight docs sweeps to production error detection, these 7 agent loop templates automate real business tasks without constant human prompting.

WorkflowsAutomationUse Cases

How to Build an AI Agent Loop for Recurring Business Tasks: A Practical Guide

AI agent loops handle recurring jobs with memory so you stop re-prompting the same tasks. Learn how to identify, design, and deploy loops for your workflows.

WorkflowsAutomationUse Cases

Presented by MindStudio

No spam. Unsubscribe anytime.