What This Agent Does
This intelligent lead management workflow automates your entire lead nurturing process from initial capture through personalized outreach. When a new lead submits your form, the agent automatically adds them to your tracking spreadsheet, researches their company using AI to gather relevant context, enriches your lead data with this intelligence, and generates personalized introductory emails saved as Gmail drafts ready for your review and sending.
Key benefits include:
-
Save 2-3 hours daily on manual lead research and email composition
-
Increase response rates by 40%+ with AI-powered personalized outreach
-
Never lose a lead with automatic spreadsheet tracking and status updates
-
Scale your outreach without sacrificing personalization quality
Perfect for: Sales teams, business development professionals, marketing agencies, consultants, and anyone managing inbound leads who wants to respond quickly with relevant, personalized communication.
Who Is It For
This workflow is designed for:
-
Sales professionals who receive leads through web forms and need to respond quickly with personalized outreach
-
Business development teams looking to automate lead qualification and initial contact while maintaining a personal touch
-
Marketing agencies managing multiple client lead flows and requiring consistent follow-up processes
-
Consultants and freelancers who want to appear responsive and well-prepared when reaching out to potential clients
-
Small business owners who need to maximize every lead opportunity without hiring additional staff
If you're spending hours each week researching companies, copying lead data between systems, and crafting personalized emails, this automation will transform your workflow.
Required Integrations
Google Sheets
Why it's needed: Serves as your central lead database, tracking all lead information, research findings, company details, and email status throughout the nurturing process.
Setup steps:
- Navigate to the TaskAGI integrations page and locate Google Sheets
- Click Connect and sign in with your Google account
- Grant TaskAGI permission to read and write spreadsheet data
- Create a new Google Sheet with these column headers:
Name, Email, Company, Location, Company Info, Status, Date Added
- Copy the sheet URL from your browser (you'll need this for configuration)
- Ensure the sheet is accessible by the Google account you connected
Configuration in TaskAGI: Once connected, you'll paste your sheet URL into multiple nodes. The integration handles authentication automatically, so you only need to specify which sheet and cells to interact with.
Anthropic (Claude)
Why it's needed: Powers the intelligent company research capability, analyzing publicly available information to generate concise, relevant summaries about each lead's company.
Setup steps:
- Visit console.anthropic.com and create an account
- Navigate to API Keys in your account settings
- Click Create Key and give it a descriptive name like "TaskAGI Lead Research"
- Copy the API key immediately (it won't be shown again)
- In TaskAGI, go to Integrations → Anthropic
- Click Connect and paste your API key
- Click Test Connection to verify
Model used: This workflow uses claude-sonnet-4-5-20250929, which provides excellent research quality at reasonable cost (~$0.003 per lead researched).
OpenAI
Why it's needed: Generates personalized introductory emails based on your template, incorporating lead details and company research to create compelling, contextual outreach.
Setup steps:
- Go to platform.openai.com and sign in or create an account
- Click on your profile icon → View API Keys
- Select Create new secret key
- Name it "TaskAGI Email Generation" and copy the key
- In TaskAGI, navigate to Integrations → OpenAI
- Click Connect and enter your API key
- Verify the connection is successful
Model used: This workflow uses gpt-4o, which excels at creative writing and following email templates while maintaining natural, conversational tone.
Gmail
Why it's needed: Creates draft emails in your Gmail account, allowing you to review AI-generated content before sending and maintain control over your outreach.
Setup steps:
- In TaskAGI, go to Integrations → Gmail
- Click Connect with Google
- Sign in with the Gmail account you use for business communications
- Grant TaskAGI permission to create drafts (it cannot send emails automatically)
- Confirm the connection shows as active
Important: The workflow creates drafts only—you maintain full control and can edit before sending.
Configuration Steps
Phase 1: Lead Capture and Initial Processing
Step 1: Configure Lead Capture Form
- The Lead Capture Form node triggers the entire workflow
- Configure form fields:
Name, Email, Company, Location
- Set form validation rules to ensure quality data entry
- Customize the thank-you message: "Thanks for your interest! We'll be in touch soon."
Step 2: Add Lead to Sheet
- In the Add Lead to Sheet node, paste your Google Sheet URL in the
sheet_url parameter
- Map form fields to sheet columns:
-
Name → Column A
-
Email → Column B
-
Company → Column C
-
Location → Column D
- Set
Status column to "New"
- Add timestamp using
{{$now}} in the Date Added column
Step 3: Research Company with AI
- The Research Company node uses Claude to gather company intelligence
- Default prompt:
"Search online and write 2-3 sentences about the company {{nodes.4683.Company}}, focusing on their business model, industry, and recent developments."
- Customize this prompt to focus on aspects relevant to your business (funding, technology stack, company size, etc.)
- The model parameter is pre-set to
claude-sonnet-4-5-20250929
Step 4: Update Lead with Research
- The Update Lead with Research node processes the AI response
- This function node extracts structured data from Claude's research
- No configuration needed—it automatically parses the research output
Step 5: Update Sheet with Research
-
Update Sheet with Research searches for the lead's row using their email as the unique identifier
- Paste your sheet URL in the
sheet_url parameter
- Set search column to
B (Email column)
- Search value:
{{nodes.4683.Email}}
Step 6: Set Research Data
- The Set Research Data node prepares the research information for writing
- Configure data mapping:
-
CompanyInfo: {{nodes.4685.research}}
-
Location: {{nodes.4683.Location}}
Step 7-8: Update Cells with Research
-
Update Company Info Cell writes research to column E
-
Update Location Cell writes location to column D
- Both nodes require:
- Your sheet URL in
sheet_url
- Row number from the search result:
{{nodes.4687.rowNumber}}
- Column letters:
E for company info, D for location
- Values from the Set Research Data node
Phase 2: Email Generation and Draft Creation
Step 9: Get Leads to Email
-
Get Leads to Email retrieves all leads from your sheet
- Paste your sheet URL in the
sheet_url parameter
- This pulls the entire dataset for filtering
Step 10: Filter To Send Leads
- The Filter To Send Leads function identifies leads ready for outreach
- Default filter: Status = "New" AND Company Info is not empty
- Customize filtering logic to match your qualification criteria
- Example: Add minimum company size or specific industry filters
Step 11: Check Has Leads
-
Check Has Leads conditional node checks if any leads need emails
- Condition:
{{nodes.4690.length}} > 0
- If true: Proceeds to email generation
- If false: Skips to No Leads to Process
Step 12: Generate Intro Email
-
Generate Intro Email creates personalized outreach using GPT-4
- Configure your email template in the prompt parameter:
Write an introductory email using the template below. Personalize it based on the lead and company information provided.
Lead Name: {{nodes.4690[0].Name}}
Company: {{nodes.4690[0].Company}}
Company Info: {{nodes.4690[0].CompanyInfo}}
Template:
Hi {{Name}},
I noticed {{Company}} is {{relevant detail from research}}. I wanted to reach out because [your value proposition].
[2-3 sentences about how you can help based on their business]
Would you be open to a brief conversation next week?
Best regards,
[Your Name]
- Customize the template to match your brand voice and value proposition
- Model is set to
gpt-4o for optimal results
Step 13: Create Email Draft
-
Create Email Draft saves the generated email to Gmail
- Configure parameters:
-
to: {{nodes.4694.Emailid}} (extracted from the generated email data)
-
subject: {{nodes.4694.EmailSubject}} (AI-generated subject line)
-
body: {{nodes.4694.EmailContent}} (the personalized email)
Step 14-15: Update Lead Status
-
Find Lead Row searches for the lead by email to get the row number
-
Update Status to Drafted changes the Status column to
"Drafted"
- This prevents duplicate email generation on subsequent runs
- Configure both with your sheet URL and appropriate column references
Step 16: No Leads to Process
-
No Leads to Process is a no-operation node that completes the workflow gracefully when no leads need processing
- No configuration required
Workflow Notes
The three Workflow Note nodes provide documentation within the workflow canvas:
-
Main: Overview of the entire process
-
Phase 1: Documents lead capture and research steps
-
Phase 2: Documents email generation and draft creation
These are for reference only and don't require configuration.
Testing Your Agent
Initial Test Run
-
Submit a test lead through your form with realistic data:
- Use your own email address
- Enter a real company name (e.g., "Shopify" or "Salesforce")
- Provide a valid location
-
Monitor execution in the TaskAGI dashboard:
- Watch each node turn green as it completes
- Check execution time (should complete in 30-60 seconds)
- Click on individual nodes to see their output
-
Verify Google Sheet updates:
- Open your Google Sheet
- Confirm the new row with lead data appears
- Check that Company Info column contains AI-generated research (2-3 sentences)
- Verify Status shows "Drafted"
-
Check Gmail drafts:
- Open Gmail and navigate to Drafts
- Find the newly created draft
- Verify it's addressed to your test email
- Review the personalization—it should reference specific company details
- Check that the tone and content match your template
Success Indicators
✅ Lead Capture: Form submission triggers workflow immediately
✅ Sheet Population: All lead fields appear in correct columns
✅ AI Research: Company Info contains relevant, accurate 2-3 sentence summary
✅ Email Quality: Draft is personalized, references company research, and sounds natural
✅ Status Tracking: Lead status updates from "New" to "Drafted"
✅ No Errors: All nodes show green checkmarks with no error messages
Testing Edge Cases
After your initial test succeeds, test these scenarios:
-
Duplicate lead: Submit the same email twice—verify it doesn't create duplicate drafts
-
Unknown company: Use a fictional company name—check how AI handles limited information
-
Multiple leads: Submit 3-5 leads in quick succession—confirm all are processed
-
Special characters: Test names and companies with accents, apostrophes, or unusual characters
Troubleshooting
Common Configuration Issues
Problem: "Sheet URL not found" error
Solution:
- Ensure you've copied the complete URL from your browser's address bar
- The URL should look like:
https://docs.google.com/spreadsheets/d/[LONG_ID]/edit
- Don't use shortened URLs or links from the Share dialog
- Verify the sheet is accessible by the Google account connected to TaskAGI
Problem: Claude research returns generic information
Solution:
- Refine your research prompt to be more specific about what information you need
- Add industry-specific keywords to guide the research
- Example: "Focus on their technology stack and target market" for B2B SaaS leads
- Increase the response length if 2-3 sentences isn't sufficient
Problem: Generated emails sound robotic or generic
Solution:
- Enhance your email template with more personality and specific value propositions
- Provide more context in the prompt about your company and offering
- Include examples of your preferred tone in the prompt
- Consider adding: "Write in a conversational, friendly tone as if you're a colleague reaching out"
Problem: Gmail drafts not appearing
Solution:
- Verify Gmail integration is connected and active
- Check that the email address format is valid in your data
- Ensure you've granted draft creation permissions during Gmail setup
- Look in Gmail's "All Mail" folder—drafts sometimes appear there first
Problem: Workflow times out or runs slowly
Solution:
- AI research typically takes 10-20 seconds per lead
- If processing many leads, consider adding a delay between email generations
- Check your API rate limits for Anthropic and OpenAI
- Process leads in smaller batches if you have hundreds queued
Error Message Explanations
"Authentication failed"
One of your integrations has disconnected. Go to Integrations, find the red indicator, and reconnect the service.
"Row not found"
The search for a lead's email in your sheet failed. Verify the email column is correct and contains no extra spaces.
"API rate limit exceeded"
You've hit usage limits on Anthropic or OpenAI. Wait a few minutes or upgrade your API plan.
"Invalid cell reference"
Column letter or row number is incorrect. Double-check your cell update nodes use the right column letters (A, B, C, etc.).
Next Steps
After Successful Setup
-
Create your lead capture form and embed it on your website, landing pages, or share the direct link
-
Set up a regular schedule to check your Gmail drafts (daily or twice daily recommended)
-
Review and send drafts with any final personalization touches
-
Monitor your sheet to track lead progression through your pipeline
-
Collect feedback on email response rates to refine your template
Optimization Suggestions
Enhance Research Quality:
- Add specific research questions to the Claude prompt based on your sales process
- Include competitor analysis: "Mention their main competitors and differentiators"
- Request specific data points: "Include company size and founding year if available"
Improve Email Personalization:
- Create multiple email templates for different lead segments
- Add conditional logic to choose templates based on company size or industry
- Include recent news mentions: "Reference any recent press releases or announcements"
Scale Your Process:
- Add a second conditional branch for high-priority leads (based on company size, industry, etc.)
- Create different email templates for different lead sources
- Implement lead scoring based on research findings
Track Performance:
- Add columns to track: Email Sent Date, Response Received, Meeting Booked
- Create a dashboard view in Google Sheets to monitor conversion rates
- Set up weekly summary reports of leads processed
Advanced Usage Tips
Multi-touch Campaigns:
- Duplicate this workflow and modify it for follow-up emails
- Change the filter to target leads with Status = "Drafted" and Date Added > 3 days ago
- Create a second email template for follow-ups
Team Collaboration:
- Add a "Assigned To" column in your sheet
- Use round-robin logic to distribute leads among team members
- Create drafts in different Gmail accounts based on assignment
Integration with CRM:
- Add nodes to sync lead data to your CRM (Salesforce, HubSpot, etc.)
- Pull additional enrichment data from services like Clearbit or ZoomInfo
- Update deal stages based on email responses
Quality Control:
- Add a manual approval step before draft creation for high-value leads
- Set up Slack notifications when new leads are captured
- Create a review queue for AI-generated research before it's added to emails
Cost Optimization:
- Monitor your API usage in Anthropic and OpenAI dashboards
- Consider using Claude Haiku for research if Sonnet is too expensive at scale
- Batch process leads during