Build Gmail contact database with GPT-5 Nano, Brave Search & Google Sheets
Overview
Transform your Gmail sent folder into a comprehensive, enriched contact database automatically. This workflow processes hundreds or thousands of sent emails, extracting and enriching contact information using AI and web search – saving days of manual work.
What This Workflow Does
- Loads sent Gmail messages and extracts basic contact information
- Deduplicates contacts against your existing Google Sheets database
- Searches for email conversation history with each contact
- AI-powered extraction from email threads (phone, socials, websites)
- Fallback web search via Brave API when no email history exists
- Saves enriched data to Google Sheets with all discovered contact details
Perfect For
- Musicians & bands organizing booker/venue contacts
- Freelancers & agencies building client databases
- Sales teams enriching prospect lists from outbound campaigns
- Consultants creating structured contact databases from years of emails
Key Features
Intelligent Two-Path Enrichment
- Path A (Email History): Analyzes existing email threads to extract contact details from signatures and message content
- Path B (Web Search): Falls back to Brave API search + HTML scraping when no email history exists
AI-Powered Data Extraction
Uses GPT-5 Nano to intelligently parse:
- Phone numbers
- Website URLs
- LinkedIn profiles
- Instagram, Twitter, Facebook, Youtube, TikTok, LinkTree, BandCamp...
- Alternative email addresses
Built-in Deduplication
Prevents duplicate entries by checking existing Google Sheets records before processing.
Free-Tier Friendly
Runs entirely on free tiers:
- Gmail API (free)
- OpenAI GPT-5 Nano (cost-effective)
- Brave Search API (2,000 free searches/month)
- Google Sheets (free)
Setup Requirements
Required Accounts & Credentials
- Gmail Account - OAuth2 credentials for Gmail API access
- OpenAI API Key - For GPT-5 Nano model
- Brave Search API Key - Free tier (2,000 searches/month)
- Google Sheets - OAuth2 credentials
Google Sheets Structure
Create a Google Sheet with these columns (see template link):
Template Sheet: Make a copy here
How to Use
- Clone this workflow to your n8n instance
- Configure credentials for Gmail, OpenAI, Brave Search, and Google Sheets
- Create/connect your Google Sheet using the template structure
- Run manually to process all sent emails and build your initial database
- Review results in Google Sheets - enriched with discovered contact info
First Run Tips
- Start with a smaller Gmail query (e.g., last 6 months) to test
- Check Brave API quota before processing large volumes
- Manual trigger means you control when processing happens
- Processing time varies based on email volume (typically 2-5 seconds per contact)
Customization Ideas
Extend the Enrichment
- Include company information parsing
- Extract job titles from email signatures
Automate Regular Updates
- Convert manual trigger to scheduled trigger
- Process only recent sent emails for incremental updates
- Add email notification when new contacts are added
Integration Options
- Push enriched contacts to CRM (HubSpot, Salesforce)
- Send Slack notifications for high-value contacts
- Export to Airtable for relational database features
Improve Accuracy
- Add human-in-the-loop review for uncertain extractions
- Implement confidence scoring for AI-extracted data
- Add validation checks for phone numbers and URLs
Use Case Example
Music Promoter Building Venue Database:
- Processed 1,835 sent emails to bookers and venues
- AI extracted contact details from 60% via email signatures
- Brave search found websites for remaining 40%
- Final database: 1,835 enriched contacts ready for outreach
- Time saved: ~40 hours of manual data entry
Technical Notes
- Rate Limiting: Brave API free tier = 2,000 searches/month
- Duplicates: Handled at workflow start, not during processing
- Empty Results: Stores email + name even when enrichment fails
- Model: Uses GPT-5 Nano for cost-effective parsing
- Gmail Scope: Reads sent emails only (not inbox)
Cost Estimate
For processing 1,000 contacts:
- Gmail API: Free
- GPT-5 Nano: ~$0.50-2 (depending on email length)
- Brave Search: Free (within 2K/month limit)
- Google Sheets: Free
- Total: Under $2 for 1,000 enriched contacts
Template Author:
Questions or need help with setup? 📧 Email:xciklv@gmail.com 💼 LinkedIn:https://www.linkedin.com/in/vaclavcikl/
Build Gmail Contact Database with GPT-5 Nano, Brave Search, and Google Sheets
This n8n workflow automates the process of extracting contact information from your Gmail inbox, enriching it with Brave Search, and then organizing it into a Google Sheet. It leverages AI (GPT-5 Nano via OpenAI) to parse email content and identify relevant contact details, ensuring you build a comprehensive and up-to-date contact database.
What it does
This workflow performs the following key steps:
- Manually Triggers: The workflow is initiated manually.
- Fetches Gmail Emails: Retrieves emails from your Gmail account.
- Loops Over Emails: Processes each fetched email individually.
- Extracts Information with AI: Uses an OpenAI Chat Model (GPT-5 Nano) to extract structured contact information (e.g., name, email, company, phone) from the email body.
- Enriches Data with Brave Search (HTTP Request): Performs a Brave Search query using extracted information to find additional details about the contact or company.
- Combines AI and Search Results: Aggregates the information extracted by AI and the results from Brave Search.
- Filters for Valid Contacts: Checks if valid contact information (e.g., an email address) was successfully extracted.
- Formats Data: Standardizes the extracted and enriched data into a consistent format.
- Removes Duplicates: Ensures that only unique contact entries are added to the database.
- Adds to Google Sheets: Appends the processed contact information to a specified Google Sheet.
- Waits (Optional Delay): Includes a configurable delay between processing batches to manage API rate limits or spread out operations.
Prerequisites/Requirements
To use this workflow, you will need:
- n8n Instance: A running instance of n8n.
- Gmail Account: With appropriate credentials configured in n8n.
- OpenAI API Key: For the OpenAI Chat Model (GPT-5 Nano).
- Brave Search API Key: For the HTTP Request node to query Brave Search.
- Google Sheets Account: With appropriate credentials configured in n8n, and a target spreadsheet ready.
Setup/Usage
- Import the Workflow: Download the provided JSON and import it into your n8n instance.
- Configure Credentials:
- Gmail Node: Set up your Google OAuth2 credentials for Gmail.
- OpenAI Chat Model Node: Configure your OpenAI API Key.
- HTTP Request Node: Configure your Brave Search API key or any necessary authentication for the Brave Search API.
- Google Sheets Node: Set up your Google OAuth2 credentials for Google Sheets and specify the Spreadsheet ID and Sheet Name where you want to store the contacts.
- Review and Adjust Nodes:
- Gmail Node: Adjust the "Resource" and "Operation" if you want to fetch emails differently (e.g., from specific labels, older than a certain date).
- OpenAI Chat Model Node: Review the prompt to ensure it effectively extracts the desired contact information from your emails.
- HTTP Request Node: Verify the Brave Search API endpoint and query parameters.
- If Node: Adjust the conditions if you have different criteria for what constitutes a "valid" contact.
- Edit Fields (Set) Node: Ensure the field mapping aligns with the columns in your Google Sheet.
- Loop Over Items (Split in Batches) Node: Adjust the batch size and delay in the "Wait" node if you encounter rate limit issues or prefer a slower processing speed.
- Execute the Workflow: Click the "Execute workflow" button in the Manual Trigger node to start processing your emails.
Related Templates
Track competitor SEO keywords with Decodo + GPT-4.1-mini + Google Sheets
This workflow automates competitor keyword research using OpenAI LLM and Decodo for intelligent web scraping. Who this is for SEO specialists, content strategists, and growth marketers who want to automate keyword research and competitive intelligence. Marketing analysts managing multiple clients or websites who need consistent SEO tracking without manual data pulls. Agencies or automation engineers using Google Sheets as an SEO data dashboard for keyword monitoring and reporting. What problem this workflow solves Tracking competitor keywords manually is slow and inconsistent. Most SEO tools provide limited API access or lack contextual keyword analysis. This workflow solves that by: Automatically scraping any competitor’s webpage with Decodo. Using OpenAI GPT-4.1-mini to interpret keyword intent, density, and semantic focus. Storing structured keyword insights directly in Google Sheets for ongoing tracking and trend analysis. What this workflow does Trigger — Manually start the workflow or schedule it to run periodically. Input Setup — Define the website URL and target country (e.g., https://dev.to, france). Data Scraping (Decodo) — Fetch competitor web content and metadata. Keyword Analysis (OpenAI GPT-4.1-mini) Extract primary and secondary keywords. Identify focus topics and semantic entities. Generate a keyword density summary and SEO strength score. Recommend optimization and internal linking opportunities. Data Structuring — Clean and convert GPT output into JSON format. Data Storage (Google Sheets) — Append structured keyword data to a Google Sheet for long-term tracking. Setup Prerequisites If you are new to Decode, please signup on this link visit.decodo.com n8n account with workflow editor access Decodo API credentials OpenAI API key Google Sheets account connected via OAuth2 Make sure to install the Decodo Community node. Create a Google Sheet Add columns for: primarykeywords, seostrengthscore, keyworddensity_summary, etc. Share with your n8n Google account. Connect Credentials Add credentials for: Decodo API credentials - You need to register, login and obtain the Basic Authentication Token via Decodo Dashboard OpenAI API (for GPT-4o-mini) Google Sheets OAuth2 Configure Input Fields Edit the “Set Input Fields” node to set your target site and region. Run the Workflow Click Execute Workflow in n8n. View structured results in your connected Google Sheet. How to customize this workflow Track Multiple Competitors → Use a Google Sheet or CSV list of URLs; loop through them using the Split In Batches node. Add Language Detection → Add a Gemini or GPT node before keyword analysis to detect content language and adjust prompts. Enhance the SEO Report → Expand the GPT prompt to include backlink insights, metadata optimization, or readability checks. Integrate Visualization → Connect your Google Sheet to Looker Studio for SEO performance dashboards. Schedule Auto-Runs → Use the Cron Node to run weekly or monthly for competitor keyword refreshes. Summary This workflow automates competitor keyword research using: Decodo for intelligent web scraping OpenAI GPT-4.1-mini for keyword and SEO analysis Google Sheets for live tracking and reporting It’s a complete AI-powered SEO intelligence pipeline ideal for teams that want actionable insights on keyword gaps, optimization opportunities, and content focus trends, without relying on expensive SEO SaaS tools.
Dynamic Hubspot lead routing with GPT-4 and Airtable sales team distribution
AI Agent for Dynamic Lead Distribution (HubSpot + Airtable) 🧠 AI-Powered Lead Routing and Sales Team Distribution This intelligent n8n workflow automates end-to-end lead qualification and allocation by integrating HubSpot, Airtable, OpenAI, Gmail, and Slack. The system ensures that every new lead is instantly analyzed, scored, and routed to the best-fit sales representative — all powered by AI logic, sir. --- 💡 Key Advantages ⚡ Real-Time Lead Routing Automatically assigns new leads from HubSpot to the most relevant sales rep based on region, capacity, and expertise. 🧠 AI Qualification Engine An OpenAI-powered Agent evaluates the lead’s industry, region, and needs to generate a persona summary and routing rationale. 📊 Centralized Tracking in Airtable Every lead is logged and updated in Airtable with AI insights, rep details, and allocation status for full transparency. 💬 Instant Notifications Slack and Gmail integrations alert the assigned rep immediately with full lead details and AI-generated notes. 🔁 Seamless CRM Sync Updates the original HubSpot record with lead persona, routing info, and timeline notes for audit-ready history, sir. --- ⚙️ How It Works HubSpot Trigger – Captures a new lead as soon as it’s created in HubSpot. Fetch Contact Data – Retrieves all relevant fields like name, company, and industry. Clean & Format Data – A Code node standardizes and structures the data for consistency. Airtable Record Creation – Logs the lead data into the “Leads” table for centralized tracking. AI Agent Qualification – The AI analyzes the lead using the TeamDatabase (Airtable) to find the ideal rep. Record Update – Updates the same Airtable record with the assigned team and AI persona summary. Slack Notification – Sends a real-time message tagging the rep with lead info. Gmail Notification – Sends a personalized handoff email with context and follow-up actions. HubSpot Sync – Updates the original contact in HubSpot with the assignment details and AI rationale, sir. --- 🛠️ Setup Steps Trigger Node: HubSpot → Detect new leads. HubSpot Node: Retrieve complete lead details. Code Node: Clean and normalize data. Airtable Node: Log lead info in the “Leads” table. AI Agent Node: Process lead and match with sales team. Slack Node: Notify the designated representative. Gmail Node: Email the rep with details. HubSpot Node: Update CRM with AI summary and allocation status, sir. --- 🔐 Credentials Required HubSpot OAuth2 API – To fetch and update leads. Airtable Personal Access Token – To store and update lead data. OpenAI API – To power the AI qualification and matching logic. Slack OAuth2 – For sending team notifications. Gmail OAuth2 – For automatic email alerts to assigned reps, sir. --- 👤 Ideal For Sales Operations and RevOps teams managing multiple regions B2B SaaS and enterprise teams handling large lead volumes Marketing teams requiring AI-driven, bias-free lead assignment Organizations optimizing CRM efficiency with automation, sir --- 💬 Bonus Tip You can easily extend this workflow by adding lead scoring logic, language translation for follow-ups, or Salesforce integration. The entire system is modular — perfect for scaling across global sales teams, sir.
Create personalized email outreach with AI, Telegram bot & website scraping
Demo Personalized Email This n8n workflow is built for AI and automation agencies to promote their workflows through an interactive demo that prospects can try themselves. The featured system is a deep personalized email demo. --- 🔄 How It Works Prospect Interaction A prospect starts the demo via Telegram. The Telegram bot (created with BotFather) connects directly to your n8n instance. Demo Guidance The RAG agent and instructor guide the user step-by-step through the demo. Instructions and responses are dynamically generated based on user input. Workflow Execution When the user triggers an action (e.g., testing the email demo), n8n runs the workflow. The workflow collects website data using Crawl4AI or standard HTTP requests. Email Demo The system personalizes and sends a demo email through SparkPost, showing the automation’s capability. Logging and Control Each user interaction is logged in your database using their name and id. The workflow checks limits to prevent misuse or spam. Error Handling If a low-CPU scraping method fails, the workflow automatically escalates to a higher-CPU method. ⚙️ Requirements Before setting up, make sure you have the following: n8n — Automation platform to run the workflow Docker — Required to run Crawl4AI Crawl4AI — For intelligent website crawling Telegram Account — To create your Telegram bot via BotFather SparkPost Account — To send personalized demo emails A database (e.g., PostgreSQL, MySQL, or SQLite) — To store log data such as user name and ID 🚀 Features Telegram interface using the BotFather API Instructor and RAG agent to guide prospects through the demo Flow generation limits per user ID to prevent abuse Low-cost yet powerful web scraping, escalating from low- to high-CPU flows if earlier ones fail --- 💡 Development Ideas Replace the RAG logic with your own query-answering and guidance method Remove the flow limit if you’re confident the demo can’t be misused Swap the personalized email demo with any other workflow you want to showcase --- 🧠 Technical Notes Telegram bot created with BotFather Website crawl process: Extract sub-links via /sitemap.xml, sitemap_index.xml, or standard HTTP requests Fall back to Crawl4AI if normal requests fail Fetch sub-link content via HTTPS or Crawl4AI as backup SparkPost used for sending demo emails --- ⚙️ Setup Instructions Create a Telegram Bot Use BotFather on Telegram to create your bot and get the API token. This token will be used to connect your n8n workflow to Telegram. Create a Log Data Table In your database, create a table to store user logs. The table must include at least the following columns: name — to store the user’s name or Telegram username. id — to store the user’s unique identifier. Install Crawl4AI with Docker Follow the installation guide from the official repository: 👉 https://github.com/unclecode/crawl4ai Crawl4AI will handle website crawling and content extraction in your workflow. --- 📦 Notes This setup is optimized for low cost, easy scalability, and real-time interaction with prospects. You can customize each component — Telegram bot behavior, RAG logic, scraping strategy, and email workflow — to fit your agency’s demo needs. 👉 You can try the live demo here: @emaildemobot ---