Automation workflow SalesProductivity

Gmail to Google Sheets Lead Tracker

Capture incoming Gmail leads in Google Sheets, extract contact details from each email, and skip duplicates automatically.

Listed on the n8n marketplace as “Track and de-duplicate email leads in Google Sheets from Gmail”.

Who it's for

Freelancers, agencies, and small sales teams who receive leads by email and want a simple spreadsheet tracker without manual copy-paste.

What it does

This workflow watches Gmail for new messages, extracts lead fields (email, name, subject, phone, message), checks your Google Sheet for existing entries, and appends only new leads. Duplicate emails and message IDs are skipped.

How it works

  1. Gmail Trigger polls Gmail for new unread messages (default filter: label:Leads)
  2. Extract Lead Details reads your sheet settings and parses lead data from the email
  3. Read Leads in Sheets loads current rows from your Google Sheet
  4. Verify Unique Lead compares email and message ID against existing rows
  5. Determine New Lead Status stops if the lead already exists
  6. Add Lead to Sheets adds a new row for new leads only

Setup steps

  1. Import the workflow JSON into n8n
  2. In Gmail, create a Leads label and filter incoming lead emails to that label (or change the search query on the trigger)
  3. Create a Google Sheet tab named Leads with columns: Email, Name, Subject, Phone, Message, Received At, Message ID
  4. Open Extract Lead Details and set GOOGLE_SHEET_ID and SHEET_NAME
  5. Connect Gmail OAuth2 on Gmail Trigger
  6. Connect Google Sheets OAuth2 on Read Leads in Sheets and Add Lead to Sheets
  7. Send a test email, then activate the workflow

Requirements (optional form fields — add one line each)

n8n Cloud or self-hosted n8n instance Gmail account with OAuth2 credentials configured in n8n Google Sheets account with OAuth2 credentials configured in n8n A Google Sheet with the recommended column headers

Customization (optional form fields — add one line each)

Change the Gmail search query or label filter on Gmail Trigger Edit GOOGLE_SHEET_ID and SHEET_NAME in Extract Lead Details Adjust phone extraction or add more parsed fields in the same code node Map different column names in Add Lead to Sheets Adjust duplicate logic in Verify Unique Lead

Additional info (optional — paste as one block)

The workflow checks duplicates by email address and Gmail message ID. If a lead already exists, no row is appended. Update the Gmail label filter if you want to capture leads from different inboxes or subject lines.

Ideas to extend

  • Send a Slack notification when a new lead is added
  • Auto-reply to the sender with a thank-you email
  • Route leads to different sheets based on subject keywords
  • Add an AI node to classify lead quality before saving

Stuck connecting credentials? Our Credential Setup Coach walks you through 60+ provider connections step by step.