TaskAGI Cold Email Automation Workflow Setup Guide
What This Agent Does
This powerful workflow automates the entire cold email generation process—from lead qualification to personalized email creation. It pulls leads from Google Sheets, researches their websites using AI-powered web scraping, generates personalized subject lines and email bodies using OpenAI and Claude, and creates draft emails in Gmail ready for your team to send.
Key benefits include:
-
90% time savings on lead research and email personalization
-
Intelligent filtering ensures you only contact qualified prospects
-
AI-powered personalization that references company-specific data for higher engagement rates
-
Automated workflow that handles research, writing, and draft creation in one seamless process
-
Team collaboration with alerts notifying your team when emails are ready to send
Target use cases: B2B sales teams selling SaaS products, AI solutions, or services that require personalized outreach; recruitment agencies sourcing candidates; partnership development teams identifying collaboration opportunities.
Who Is It For
This workflow is ideal for:
-
Sales Development Representatives (SDRs) who need to scale personalized outreach without sacrificing quality
-
Sales teams using AI Voice Agents or similar B2B solutions requiring warm, personalized introductions
-
Growth teams managing lead qualification and initial contact simultaneously
-
Agencies handling multiple client campaigns with varying personalization requirements
-
Anyone tired of manually researching companies and writing repetitive cold emails
Required Integrations
Google Sheets
Why it's needed: Google Sheets serves as your lead database and output log. The workflow reads lead information (names, emails, companies) and writes back results (scrape status, email content, completion status).
Setup steps:
-
Create a Google Sheet with the following columns:
-
first_name - Lead's first name
-
email - Lead's email address
-
company - Company name
-
website - Company website URL
-
status - Workflow completion status (will be auto-populated)
-
icebreaker_body - Generated email body (will be auto-populated)
-
scrape_result - Website scraping status (will be auto-populated)
-
Populate your lead data in rows below the header
-
Copy the full sheet URL (including the sheet ID)
How to obtain credentials:
- Google Sheets uses OAuth 2.0 authentication
- No API key needed—TaskAGI handles OAuth flow automatically
- Ensure your Google account has edit access to the sheet
Configuration in TaskAGI:
- In the "Get All Leads" node, paste your sheet URL in the
sheet_url parameter
- In all "Update" nodes (Log Final Result, Update Icebreaker Body, Update Status, Log Scrape Fail), paste the same sheet URL
- Specify the exact column names where data should be written
Browser Automation
Why it's needed: This integration scrapes website content from company URLs, gathering information that feeds into AI summarization for personalized email generation.
Setup steps:
- Navigate to your TaskAGI integration settings
- Enable Browser Automation (typically pre-installed)
- No API key required—this uses TaskAGI's built-in browser engine
- Ensure your TaskAGI workspace has web scraping permissions enabled
Configuration in TaskAGI:
- In the "Scrape Website" node, map the website URL from your lead data:
[[nodes.6338.website]]
- Set timeout to 30 seconds (sufficient for most websites)
- Enable JavaScript rendering for dynamic content sites
- The node outputs
webpage_content containing the full HTML/text of the page
OpenAI
Why it's needed: OpenAI's GPT-4o model summarizes scraped website content into concise company descriptions, providing context for personalized email generation.
Setup steps:
- Visit platform.openai.com and log in
- Navigate to API keys in your account settings
- Click Create new secret key
- Copy the key immediately (it won't display again)
- In TaskAGI, go to Integrations → Add Integration → OpenAI
- Paste your API key and save
How to obtain API keys:
- Requires an OpenAI account with billing enabled
- Costs approximately $0.03-0.15 per lead depending on website size
- Set up usage limits in OpenAI dashboard to control costs
Configuration in TaskAGI:
- Model:
gpt-4o (already configured)
- Prompt template:
[[nodes.6340.all_lead_data.company]]'s company data from their website...
- Temperature: 0.7 (balanced creativity and consistency)
- Max tokens: 500 (sufficient for company summaries)
Anthropic (Claude)
Why it's needed: Claude generates personalized email subject lines and body copy that reference company-specific insights, dramatically improving open and response rates.
Setup steps:
- Visit console.anthropic.com and create an account
- Navigate to API keys section
- Click Create Key
- Copy your API key
- In TaskAGI, go to Integrations → Add Integration → Anthropic
- Paste your API key and authenticate
How to obtain API keys:
- Free trial includes $5 in credits
- Paid plans start at $0.80/million input tokens
- Costs approximately $0.01-0.05 per email depending on company data length
Configuration in TaskAGI:
- Model:
claude-haiku-4-5-20251001 (fast, cost-effective)
- Prompt includes: Product context (your AI Voice Agent value prop), company data, and tone guidelines
- Temperature: 0.8 (creative, personalized tone)
- Max tokens: 300 (sufficient for subject + body)
Gmail
Why it's needed: Gmail integration creates draft emails for your team's review and sends team notifications when the workflow completes, ensuring nothing falls through the cracks.
Setup steps:
- In TaskAGI, go to Integrations → Add Integration → Gmail
- Click Connect with Google
- Select the Gmail account to use
- Grant TaskAGI permission to create drafts and send emails
- Authorize and save
How to obtain credentials:
- Uses OAuth 2.0—no API key needed
- Requires a Gmail account with 2FA enabled (recommended)
- Service account option available for team inboxes
Configuration in TaskAGI:
- "Create Email Draft" node: Maps recipient email, subject, and body from previous nodes
- "Send Team Alert" node: Sends to your team's email address when workflow completes
- Draft emails appear in your Gmail drafts folder for final review before sending
Configuration Steps
Step 1: Data Ingestion & Filtering
The workflow begins with your Manual Trigger—click the play button to start execution.
Node: Get All Leads
- Reads all rows from your Google Sheet
- Outputs: Array of lead objects with all columns
- Verify: Check that all lead data appears in the node output
Node: Filter Qualified Leads
- Applies your qualification criteria (e.g., excludes leads without websites)
- Configure the filter function to match your business rules
- Example:
lead.website !== null && lead.email !== null
Step 2: Loop & Scraping
Node: Loop Over Leads
- Iterates through each qualified lead
- Creates a loop context for processing individual leads
Node: Capture Lead Data
- Extracts individual lead information for current iteration
- Outputs:
first_name, email, company, website, all_lead_data
Node: Scrape Website
- Fetches content from the company website URL
- Outputs:
webpage_content (HTML/text of the page)
- Handles timeouts gracefully (falls through to failure path)
Step 3: AI Processing
Node: Process Scraped Content
- Cleans and structures the raw HTML into readable text
- Removes navigation elements, scripts, and formatting noise
- Outputs:
cleaned_content ready for AI summarization
Node: Check Scrape Status
- Conditional: Did the scrape succeed?
-
True path → Proceed to AI summarization
-
False path → Log failure and continue to next lead
Node: Summarize Website (OpenAI)
- Prompt:
"Summarize [[nodes.6340.all_lead_data.company]]'s business, products, and value proposition based on their website content. Keep to 2-3 sentences."
- Outputs:
company_summary (concise company description)
Step 4: Email Generation
Node: Merge Summary
- Combines lead data with company summary
- Creates enriched context object for email generation
Node: Generate Subject & Body (Claude)
- Prompt template includes:
- Product context: "We sell AI Voice Agents that..."
- Company data:
[[nodes.6340.all_lead_data.company]]
- Personalization: References company-specific insights
- Outputs:
subject and body (ready-to-use email content)
Node: Parse AI Output
- Extracts subject line and email body from Claude's response
- Formats for Gmail integration
- Outputs:
subject, body as separate fields
Step 5: Output & Logging
Node: Create Email Draft
- Creates draft in Gmail:
to: [[nodes.6338.email]]
- Subject:
[[nodes.6345.subject]]
- Body: Personalized message with lead's first name
-
Action: Review drafts in Gmail before sending
Node: Update Status
- Logs completion status in Google Sheet
- Column:
status → Value: "Completed"
Node: Update Icebreaker Body
- Saves generated email body to sheet
- Column:
icebreaker_body → Value: [[nodes.6345.body]]
Node: Send Team Alert
- Notifies team when all leads are processed
- Subject: "Cold Emails are ready to be sent!"
- Body: Links to Gmail drafts folder
Testing Your Agent
Test Execution
Step 1: Prepare Test Data
- Create a test Google Sheet with 2-3 sample leads
- Include companies with publicly available websites
- Ensure all required columns are populated
Step 2: Run the Workflow
- Click the Manual Trigger play button
- Monitor execution in the TaskAGI dashboard
- Watch real-time progress through each node
Step 3: Verify Each Stage
| Stage |
What to Check |
Expected Result |
| Data Ingestion |
Leads load from sheet |
All 2-3 leads appear in "Get All Leads" output |
| Scraping |
Website content retrieves |
webpage_content contains readable text (not empty) |
| AI Summarization |
OpenAI processes content |
company_summary is 2-3 sentences about the company |
| Email Generation |
Claude creates personalized email |
subject and body reference company-specific details |
| Gmail Draft |
Email appears in drafts |
Draft visible in Gmail with correct recipient and content |
| Sheet Updates |
Data writes back to sheet |
Status, body, and scrape results populate columns |
| Team Alert |
Notification sends |
Email received by team with completion message |
Success Indicators
✅ All leads processed without errors
✅ Gmail drafts created with personalized content
✅ Google Sheet updated with results and status
✅ Team notification sent confirming completion
✅ Email quality includes company-specific references (not generic)
Troubleshooting
-
Scrape fails for certain sites: Some websites block automation; add fallback text
-
AI output formatting issues: Adjust Claude prompt to specify exact format
-
Gmail authentication errors: Re-authorize Gmail integration in settings
-
Sheet not updating: Verify column names match exactly (case-sensitive)
You're ready to launch! Start with your test data, refine based on results, then scale to your full lead list. This workflow transforms hours of research into minutes of automated intelligence.