Automatically follow up with B2B leads using AI-generated reminder emails in Gmail based on Google Sheets tracking, ensuring no prospect falls through the cracks.
This agent works seamlessly with these platforms to deliver powerful automation.
Send, receive, and manage Gmail messages with full email automation capabilities
Read / Write data from / to Google Sheets
Leverage OpenAI's powerful language models to generate text, answer questions, a...
This intelligent workflow automates your B2B email follow-up process by monitoring leads in a Google Sheet, identifying which prospects need reminder emails, and automatically generating personalized follow-up messages using AI. The agent checks your lead database, determines who hasn't responded within your specified timeframe, crafts contextually appropriate reminder emails using GPT-4, and sends them as replies to the original email threads—all while keeping your spreadsheet updated with the latest status.
Key benefits include:
Perfect use cases: Sales prospecting follow-ups, partnership outreach campaigns, client onboarding sequences, investor relations, recruitment communications, and any B2B scenario requiring systematic follow-up management.
This workflow is designed for sales professionals, business development representatives, marketing teams, and entrepreneurs who regularly conduct email outreach campaigns and need to maintain consistent follow-up without the manual overhead.
You'll find this particularly valuable if you:
Technical skill level required: Beginner to intermediate. You should be comfortable with Google Sheets, basic email operations, and following step-by-step setup instructions. No coding knowledge required.
Why it's needed: Google Sheets serves as your central lead database, tracking contact information, email history, reminder dates, and response status. The workflow reads lead data from your sheet and updates it with the latest follow-up information.
Setup steps:
Create a Google Cloud Project (if you don't have one):
Enable the Google Sheets API:
Create OAuth 2.0 credentials:
https://app.taskagi.com/oauth/callback (or your TaskAGI instance URL)Configure in TaskAGI:
Required Sheet Structure: Your Google Sheet should include columns for: Lead Name, Email Address, Last Contact Date, Reminder Date, Status, and any other relevant tracking fields.
Why it's needed: OpenAI's GPT-4 model generates personalized, contextually appropriate reminder emails that sound natural and professional, adapting to each lead's specific situation and your communication style.
Setup steps:
Create an OpenAI account:
Generate an API key:
Add billing information:
Configure in TaskAGI:
Cost consideration: GPT-4 costs approximately $0.03-0.06 per reminder email generated. For 100 reminders/month, expect $3-6 in OpenAI costs.
Why it's needed: Gmail integration enables the workflow to search for original email threads, retrieve message details, and send reminder emails as proper replies (maintaining conversation continuity rather than starting new threads).
Setup steps:
Enable Gmail API in Google Cloud:
Use the same OAuth credentials (or create Gmail-specific ones):
gmail.readonly, gmail.send, gmail.modify
Configure in TaskAGI:
Security note: This integration only accesses emails related to your leads and sends messages you've configured. It cannot read unrelated emails or send unauthorized messages.
Before configuring the workflow, set up your lead tracking spreadsheet:
Lead Name - Full name of the contactEmail - Email addressLast Contact Date - Date of last email sent (format: YYYY-MM-DD)Reminder Date - When to send reminder (format: YYYY-MM-DD)Status - Current lead status (e.g., "Contacted", "Reminded", "Responded")Original Subject - Subject line of your initial emailThe Manual Trigger node allows you to run this workflow on-demand or schedule it:
This node retrieves all leads from your Google Sheet:
sheet_url parameter, paste your Google Sheet URLsheet_name to the tab name (usually "Sheet1" or your custom name)The Loop Through Leads node processes each lead individually:
current_lead
{{current_lead.Lead Name}}, {{current_lead.Email}}, etc.This Function node determines whether each lead needs a reminder:
const today = new Date();
const reminderDate = new Date(current_lead['Reminder Date']);
const status = current_lead['Status'];
// Send reminder if: reminder date is today or past, and status isn't "Responded"
const needsReminder = reminderDate <= today && status !== 'Responded' && status !== 'Reminded Today';
return { needsReminder: needsReminder };
true when a reminder should be sentThe Needs Reminder? node routes leads based on the function result:
{{nodes.4620.needsReminder}} equals true
The Generate Reminder Email node is where the magic happens:
model to gpt-4o (optimized for quality and cost)prompt parameter with this template:You are a helpful B2B marketing assistant writing follow-up emails.
Write a brief, professional reminder email to {{current_lead.Lead Name}} at {{current_lead.Email}}.
Context:
- Original email subject: {{current_lead.Original Subject}}
- Last contacted: {{current_lead.Last Contact Date}}
- Days since contact: [calculate this]
Requirements:
- Friendly but professional tone
- Reference the original conversation naturally
- Keep it under 100 words
- Include a clear call-to-action
- Don't be pushy or desperate
- Sign off with just the message body (no signature block)
Generate only the email body text.
max_tokens to 300 (sufficient for concise emails)temperature to 0.7 (balanced creativity and consistency)The Find Original Thread node locates the original conversation:
to:{{current_lead.Email}} subject:"{{current_lead.Original Subject}}"
max_results to 1 (we only need the most recent)The Get Message Details function extracts the thread ID:
const searchResults = nodes['4624']; // Find Original Thread node
if (searchResults && searchResults.messages && searchResults.messages.length > 0) {
return {
threadId: searchResults.messages[0].threadId,
messageId: searchResults.messages[0].id
};
}
return { error: "No original thread found" };
The Reply to Email Thread node sends your AI-generated reminder:
threadId to: {{nodes.4625.threadId}}
to to: {{current_lead.Email}}
body to: {{nodes.4623.choices[0].message.content}} (the AI-generated email)Three nodes update your Google Sheet with the latest information:
Find Lead Row:
sheet_url to your Google Sheet URLsearch_column to Email
search_value to {{current_lead.Email}}
Update Reminder Status:
sheet_url to your Google Sheet URLrow to {{nodes.4628.row_number}} (from Find Lead Row)column to Status
value to Reminded Today
Update Reminder Date:
sheet_url to your Google Sheet URLrow to {{nodes.4628.row_number}}
column to Reminder Date
value to a formula that calculates next reminder date (e.g., 3 days from now)Update Status Column:
After the test run, verify:
✅ Sheet reading: Check the "Get Leads from Sheet" node output shows all your leads ✅ Loop processing: Confirm the loop iterates through each lead (check loop counter) ✅ Reminder logic: Verify only leads with today's date proceed to AI generation ✅ AI generation: Review the generated email text for quality and appropriateness ✅ Thread finding: Confirm the original email thread was located ✅ Email sending: Check your test email inbox for the reminder (should appear as a reply) ✅ Sheet updates: Verify the Status and Reminder Date columns updated correctly
Problem: "Sheet not found" error
/edit#gid=...), ensure the Google account authorized in TaskAGI has access to the sheet, and check that the sheet name matches exactly (case-sensitive)Problem: No leads being processed
Problem: AI generates inappropriate or generic emails
gpt-4o not gpt-3.5-turbo
Problem: "Original thread not found" error
Problem: Emails sent as new threads instead of replies
{{nodes.4625.threadId}} correctly, and re-authorize Gmail integration with full permissionsProblem: Sheet updates fail or update wrong rows
gpt-4o (lowercase, no spaces).Explore these powerful automation agents that complement your workflow.