Email Lead Mining to Google Sheets & Slack Alerting - n8n Workflow

Use this powerful n8n workflow to automatically scan your Gmail inbox for potential business leads, filter out junk mail using n8n node scripting, save unique entries to Google Sheets, and send instant alerts to Slack. Get started with n8n templates.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Sales teams and SDRs looking to identify warm leads already in their inbox.
Marketing specialists implementing 'Reverse Outreach' strategies.
n8n users needing a robust example of filtering and deduplication logic.
Anyone managing lead lists across Google Sheets and Slack.

Overview

This specialized n8n workflow, often referred to as 'Reverse Outreach,' is designed to mine your Gmail inbox for untapped business opportunities. The core challenge this n8n automation solves is differentiating real prospect emails from automated system messages, personal addresses, and generic inboxes (like info@).

The n8n workflow uses a dual-trigger system, allowing for a one-time historical scan of existing emails (up to 500 or more messages per run) and a recurring periodic scan using the Gmail n8n trigger for real-time new leads. Custom n8n code nodes perform sophisticated filtering to eliminate service emails, personal accounts (like @gmail.com), and duplicates.

After filtering, the data is standardized and written to Google Sheets using the 'Append or update' operation, ensuring a clean, deduplicated database. Finally, a Slack notification is sent for every new unique lead discovered by the n8n template, providing immediate visibility to the sales team.

How it Works

This comprehensive n8n workflow is initiated via two distinct paths to ensure full coverage of both existing and new communications.


  1. Triggering the n8n workflow: The process can start either with the Manual Trigger (Historical Run) to fetch older emails in bulk, or through the scheduled Gmail Trigger (Real-time), which checks for new emails periodically (default set to daily).


  1. Fetching Emails: The Get many messages n8n node fetches up to 500 emails, or the Gmail Trigger monitors for new incoming mail.


  1. Initial Data Parsing and Filtering: The first Code n8n node is crucial. It extracts the sender's company name, email, domain, subject, and formats the date. More importantly, it uses custom JavaScript logic to filter out service-based addresses (no-reply, system, updates) and generic company inboxes (info@, support@). This custom n8n node cleans up the data stream efficiently.


  1. Personal Domain Filtering: The next Code2 n8n node applies a second filter, specifically excluding emails from well-known personal domains like gmail.com, yahoo.com, and hotmail.com, ensuring the extracted leads are business-related.


  1. Deduplication: The subsequent Code1 n8n node handles deduplication. This code block iterates through the refined lead list and removes any item that shares an email address with a previously processed item, ensuring that only unique leads proceed to storage.


  1. Storing Data in Google Sheets: The Append or update row in sheet n8n node connects to Google Sheets. It is configured to use the email address as the primary key. If the email exists, the row is updated; otherwise, a new row is appended. This prevents storing redundant data, a key feature of this n8n template.


  1. Notification: The final Send a message Slack n8n node takes the newly added lead data and sends a summary notification to a designated Slack channel, confirming that the n8n workflow successfully added a new prospect.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import the n8n workflow: Copy the provided JSON data and paste it into your n8n instance using the 'New' > 'Import from JSON' option.


  1. Configure Gmail Credentials: Connect your Google account to the Get many messages and Gmail Trigger (Real-time) n8n nodes. Ensure the account has permission to read your emails.


  1. Configure Google Sheets Credentials: Create credentials for the Google Sheets API and link them to the Append or update row in sheet n8n node.


  1. Set Google Sheet Target: In the Google Sheets n8n node, replace REPLACEGOOGLESHEETSPREADSHEETID with your desired spreadsheet ID and set the specific sheet name (REPLACEWITHGOOGLSHEETSHEETID). Create a sheet with the column headers: companyname, email, domain, subject, and datereceived.


  1. Configure Slack Credentials: Set up a Slack Bot or App token and configure the Send a message n8n node. Replace REPLACEWITHSLACKCHANNEL_ID with the ID of the channel where you want notifications.


  1. Activation: Activate the n8n workflow. For initial historical extraction, execute the Manual Trigger n8n trigger once. For continuous monitoring, ensure the Gmail Trigger is active and running on its schedule.

Node Details

Manual Trigger (Historical Run): An n8n trigger used for manually running the workflow to process historical email data.
Gmail Trigger (Real-time): A scheduled n8n trigger (polling) that continuously monitors for new incoming emails, supporting continuous 'Reverse Outreach.'
Get many messages (Gmail n8n node): Fetches up to 500 emails at a time from the mailbox for historical processing. Uses Gmail OAuth2 credentials.
Code (Initial Parsing & Filtering): This crucial n8n code node performs initial data extraction (email, domain, subject) and filters out service emails (no-reply, support, info). It standardizes the data structure for downstream nodes.
Code2 (Filter Personal Emails): An n8n code node that specifically filters items where the domain matches personal email providers (e.g., gmail.com, outlook.com), focusing the data set strictly on business leads.
Code1 (Remove Duplicates): This n8n code node ensures list cleanliness by iterating through the input and removing any subsequent items that share the same email address as a previously processed item.
Append or update row in sheet (Google Sheets n8n node): Connects to Google Sheets. The operation is set to appendOrUpdate, preventing duplicate entries by matching against the email address column.
Send a message (Slack n8n node): Sends a formatted message containing the new lead's company name and email to a specified Slack channel, alerting the team immediately after the lead is added to the Google Sheet.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by

✓ 5+ Years of Business Automation Experience ✓ 7+ Years of Product Owner/Agile Leadership Experience ✓ 14+ Years of Management Consulting Career ✓ PMP Certified Project Manager, Agile Practitioner ✓ Specialized in Scrum Framework of Agile Management

Featured*