Claude API Sales Email Automation Workflow Guide
Why automate sales emails with Claude
A Claude API sales email automation workflow uses Claude to read lead data, draft personalized outreach, and hand off ready-to-send emails to a human or a sending tool — without a rep writing every message from scratch. This matters because generic mail merges get ignored, but fully hand-written sequences don't scale past a few dozen leads a week. Claude sits in the middle: it reads structured context about each lead (company, role, recent activity, pain points) and produces a draft that sounds like a person wrote it, in seconds.
The practical workflow has five parts: pull lead data, generate a draft with Claude, run a quality/compliance check, route for human approval, and send through your existing email tool. Below is a working version of that pipeline you can adapt to your CRM and sending stack.
Architecture of the workflow
- Trigger – a new lead enters your CRM or a scheduled job pulls a batch of leads due for outreach.
- Enrichment – you gather whatever context you already have: company, title, industry, last interaction, product fit signals.
- Draft generation – Claude writes a subject line and body using that context plus your sales playbook as a system prompt.
- Review gate – drafts land in a queue (Slack, a dashboard, or a CRM task) for a rep to approve or edit.
- Send – approved emails go out through your email provider (SendGrid, Gmail API, HubSpot, etc.).
Claude only handles step 3. Everything else is plumbing you likely already have.
Setting up API access
If you already have Claude access through a Pro/Team plan but need it as a plain HTTPS API your automation scripts and internal tools can call, SubToAPI turns that access into application API keys (sub_live_...) with usage metadata and team seats, so you don't have to set up separate billing just to wire Claude into your sales stack. Sign up at /signup and get your key from the dashboard.
Install the SDK or just use fetch/curl directly — SubToAPI speaks the same Messages API shape, documented at /docs/messages.
Step 1: Structure the lead data
Before calling the model, normalize your lead record into a compact JSON object. Keep it short — Claude works better with clean signal than with a dumped CRM export.
{
"name": "Dana Oliveira",
"title": "Head of Engineering",
"company": "Fernbase",
"industry": "logistics software",
"recent_signal": "downloaded API rate limiting whitepaper",
"product": "SubToAPI",
"rep_name": "Alex",
"tone": "direct, no fluff"
}
Step 2: Draft the email with a system prompt
Put your sales playbook — voice, length limits, banned phrases, CTA style — into the system prompt once, and reuse it across every lead.
curl https://api.subtoapi.app/v1/messages \
-H "Authorization: Bearer $SUBTOAPI_KEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4-5",
"max_tokens": 400,
"system": "You write cold outreach emails for a B2B SaaS sales team. Rules: under 120 words, one clear CTA, no buzzwords like synergy or leverage, reference one specific signal about the lead, sign off with the rep name. Output JSON with subject and body fields only.",
"messages": [
{
"role": "user",
"content": "Lead: Dana Oliveira, Head of Engineering at Fernbase (logistics software). Recent signal: downloaded API rate limiting whitepaper. Rep: Alex. Write the outreach email."
}
]
}'
Forcing JSON output (subject and body fields) makes the response trivial to parse and push into your approval queue without extra prompting tricks. For higher-volume batches, see /docs/quickstart for request patterns and rate considerations.
Step 3: Batch it in a script
For a real pipeline you'll loop over leads and call the API for each one. A minimal Node version:
import fs from "fs";
const leads = JSON.parse(fs.readFileSync("leads.json"));
const SYSTEM_PROMPT = fs.readFileSync("playbook.txt", "utf8");
async function draftEmail(lead) {
const res = await fetch("https://api.subtoapi.app/v1/messages", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SUBTOAPI_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({
model: "claude-sonnet-4-5",
max_tokens: 400,
system: SYSTEM_PROMPT,
messages: [{ role: "user", content: JSON.stringify(lead) }],
}),
});
const data = await res.json();
return JSON.parse(data.content[0].text);
}
for (const lead of leads) {
const draft = await draftEmail(lead);
console.log(lead.name, draft.subject);
// push draft into your review queue here
}
Run this against a CSV export nightly, or trigger it from a webhook when a lead hits a specific CRM stage.
Step 4: Add a review gate — don't auto-send
Never send Claude-generated email directly without a human checkpoint. Even with a tight system prompt, models occasionally misread context (wrong name, wrong product tier, overly aggressive tone). Route drafts into:
- A Slack channel with approve/reject buttons
- A lightweight internal dashboard
- A CRM task assigned to the rep who owns the lead
This single step is what separates "automation that scales trust" from "automation that burns leads." It also gives you a feedback loop: track which drafts reps edit heavily and feed common fixes back into the system prompt.
Step 5: Use tool calling for enrichment lookups
If your workflow needs Claude to pull live data — like checking a lead's company size via an internal API before drafting — use tool use instead of stuffing everything into the prompt manually. Define a tool schema for your lookup function and let Claude call it mid-conversation when it needs more context. Details and schema examples are in /docs/tools.
Streaming for interactive review tools
If reps watch drafts generate live in an internal tool rather than waiting for a full response, use streaming so the UI shows tokens as they arrive instead of a blank screen for a few seconds. See /docs/streaming for the event format.
Keeping cost and usage visible
Sales automation can quietly generate thousands of API calls a month once it's running across every new lead. Track per-team usage so you know what each sequence costs before it scales further — SubToAPI's dashboard reports usage metadata per key, which is useful if marketing and sales both draw from the same account. Plans start at €9/month for solo use and scale to per-seat team pricing; see /pricing for details.
questions
Does Claude write better cold emails than a template with merge fields? Yes, when the system prompt encodes your actual voice and constraints — length, tone, one CTA. Plain merge fields only swap names; Claude can reference a specific signal (a download, a job change, a product page visit) in a way that reads as researched rather than mass-sent.
Should emails be sent automatically without review? No. Keep a human approval step for every draft, at least initially. It catches factual errors and tone misses, and the edits reps make are useful signal for improving your system prompt over time.
How do I keep API costs predictable for high-volume outreach? Cap max_tokens tightly (short emails don't need much), batch requests instead of firing one-off calls per click, and monitor usage through your API provider's dashboard so a spike in lead volume doesn't surprise your monthly bill.