Generate and research sales leads with Jina AI & OpenAI email automation via Gmail
Needs changesNeeds changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.
What to replace before upgrading
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Lead Analyzer (v1.6), Email Content Creator (v1.7), Email Content Re-writer (v1.7), Evaluator (v1.7), Format HTML (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (14)
- Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - HTTP Request
n8n-nodes-base.httpRequest - AI Agent
@n8n/n8n-nodes-langchain.agent - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Merge
n8n-nodes-base.merge - Wait
n8n-nodes-base.wait - Airtable
n8n-nodes-base.airtable - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Gmail
n8n-nodes-base.gmail - Manual Trigger
n8n-nodes-base.manualTrigger - Schedule Trigger
n8n-nodes-base.scheduleTrigger
What it does
Who’s it for Generate personalized sales leads, ready-to-send, HTML-formatted emails, and send them automatically. This workflow is ideal for sales professionals, marketers, and business development teams aiming to scale their outreach. By automating the tedious tasks of research and email drafting, you can focus on building relationships and closing deals. How it works This workflow automates the process of finding sales leads and drafting personalized emails. - It starts by pulling a list of unprocessed companies from an Airtable base. - For each company, it uses Jina DeepSearch to find key decision-makers, their roles, and email addresses. - An AI agent then analyzes the research to identify the best contact and creates a custom, professional cold email. - The email's content and subject are evaluated by a second AI agent, which assigns a score from 0-100. - If the email scores below 80, it's sent to an Email Re-writer agent for improvement before being evaluated again. - Finally, the workflow formats the polished email into an HTML draft in Gmail and updates the Airtable record with the lead information and the outcome. --- How to set up 1. Airtable: Create your Airtable credentials here. Set up an Airtable base with a table that includes the following columns: Companyname, Companywebsite, Companye-mail, processed, leadname, leademail, emailsubject, emailtext, emailsummary, createdate and a taskresult column. 2. Jina AI: Get an API key from Jina AI and add it to the JinaAPIKey node. You can find more information here. 3. Gmail: Connect your Gmail account using the Gmail node to allow the workflow to create email drafts. You can find the documentation for the Gmail node here. 4. OpenAI: This workflow uses the OpenAI nodes (gpt-5-mini model) for the AI agents. You will need to provide your OpenAI API credentials. You can find the API documentation here. 5. Business Info: Fill in your company's information in the BusinessInfo node, including your business name, description, key benefits, website URL, target audience, and the desired email language. --- Requirements An n8n account Airtable API Key and a base with lead data. Jina AI API Key for the deep search functionality. OpenAI API Key to power the AI agents. A Gmail account connected to n8n. --- How to customize the workflow Changing the Score Threshold: The If node is set to a threshold of 80. You can change this to a higher or lower number to control which emails are re-written. Database Integration: Instead of Airtable, you can use a different database like Google Sheets or a CRM by swapping out the Airtable nodes for the corresponding integration nodes. Email Sending: The workflow currently creates drafts in Gmail. You can easily modify the Gmail node to send the emails directly instead of creating drafts, but be cautious with this approach to avoid sending unwanted emails. --- Need a Professional and Personalized automation Contact me(mailto:[email protected]) Need Help? Join the Discord or ask in the Forum!