Generate personalized cold email drafts from Google Sheets with Groq and Tavily
Needs changesWhat this workflow does
This AI workflow has 14 nodes and runs on a schedule (every hour). Along the way it connects Google Sheets, Groq Chat Model and Gmail. It also calls api.tavily.com over HTTP.
How it runs
Trigger: On a schedule (every hour).
- Read Leads (Google Sheets): uses Google Sheets
- Filter Unsent (If): checks a condition and branches into true / false
- Process One by One (Loop Over Items (Split in Batches)): loops over the items in batches
- Research Company (HTTP Request): calls api.tavily.com
- Prepare lead context for AI (Edit Fields (Set)): sets 6 fields: lead_name, lead_email, company_name…
- Email Writer (AI Agent): runs an AI agent, with model: Groq Llama 3.3 70B
- Parse Email (Code): runs custom JavaScript code
- Email Valid? (If): checks a condition and branches into true / false
- Create Gmail Draft (Gmail): work with draft
- Log failed email to sheet (Edit Fields (Set)): sets 1 field: error_log
…plus 2 more steps. See the full node list below.
Services it uses
HTTP calls to: api.tavily.com
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in Email Writer (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Email Writer (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (11)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Google Sheets
n8n-nodes-base.googleSheets - If
n8n-nodes-base.if - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - HTTP Request
n8n-nodes-base.httpRequest - Edit Fields (Set)
n8n-nodes-base.set - AI Agent
@n8n/n8n-nodes-langchain.agent - Groq Chat Model
@n8n/n8n-nodes-langchain.lmChatGroq - Code
n8n-nodes-base.code - Gmail
n8n-nodes-base.gmail - Wait
n8n-nodes-base.wait
From the author
Quick overview This scheduled workflow reads leads from Google Sheets, researches each company with Tavily Search, uses Groq (Llama 3.3 70B) to generate a short personalized cold email, and saves the result as a Gmail draft while updating the lead status back…