Draft personalized cold emails from Google Sheets using Gemini and HubSpot
Needs changesWhat this workflow does
This AI workflow has 18 nodes and runs manually, when you click “Execute workflow”. Along the way it connects Google Sheets, Google Gemini Chat Model and HTTP Request. It also calls api.hubapi.com and api.tavily.com over HTTP.
How it runs
Trigger: Manually, when you click “Execute workflow”.
- Configure Batch Size (Edit Fields (Set)): sets 1 field: BATCH_SIZE
- Read Leads from Sheets (Google Sheets): uses Google Sheets
- Select Lead Row (Code): runs custom JavaScript code
- Process Leads in Batches (Loop Over Items (Split in Batches)): loops over the items in batches
- Research Lead Agent (AI Agent): runs an AI agent, with model: Gemini Lead Research; 1 tool (Activate Search Tool); output parser: Parse Research Output
- Remove Markdown from Research (Code): runs custom JavaScript code
- Draft Email Content (Basic LLM Chain): sends a prompt to an LLM, with model: Gemini Email Generation
- Extract Email Details (Code): runs custom JavaScript code
- Create Contact in HubSpot (HTTP Request): calls api.hubapi.com (POST)
- Identify HubSpot Contact ID (Code): runs custom JavaScript code
…plus 3 more steps. See the full node list below.
Services it uses
HTTP calls to: api.hubapi.com, 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 Research Lead Agent (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Research Lead Agent (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)
- Manual Trigger
n8n-nodes-base.manualTrigger - Google Sheets
n8n-nodes-base.googleSheets - Code
n8n-nodes-base.code - AI Agent
@n8n/n8n-nodes-langchain.agent - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Http Request Tool
n8n-nodes-base.httpRequestTool - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - HTTP Request
n8n-nodes-base.httpRequest - Edit Fields (Set)
n8n-nodes-base.set - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches
From the author
Quick overview This workflow batch-processes leads from Google Sheets, researches each person and company using Tavily plus Google Gemini, drafts a personalized cold email, then creates/updates the contact in HubSpot with a research note and a saved email…