🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Gmail to HubSpot, leads captured and deals created

Lisa Granqvist Partner Workflow Automation Expert

Leads are coming in, but they’re landing in the wrong place. A Shopify inquiry hits Gmail, someone “will get to it,” and suddenly it’s tomorrow, the lead is cold, and your pipeline is missing a deal that should’ve existed.

Marketing managers feel it when campaign reporting doesn’t match what Sales sees. A sales lead feels it when reps ask, “Did anyone create the contact?” Even a small Shopify store owner gets stuck doing manual CRM cleanup. This Gmail HubSpot leads automation closes that gap so every legit lead becomes a HubSpot Contact and an associated Deal, automatically.

You’ll see how the workflow filters for Shopify-originated emails, extracts the lead details, and creates (or updates) the right HubSpot records so follow-up happens fast.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: Gmail to HubSpot, leads captured and deals created

The Problem: Shopify Leads Get Stuck in Gmail

Shopify lead emails look simple until you’re handling them all week. Someone opens Gmail, copies a name, hunts for the email address, pastes a phone number that’s formatted weird, then tries to create a contact in HubSpot. Next, they create a deal. Then they guess the deal stage. And if the same person emails again, you get duplicates, mismatched properties, or a “Contact already exists” warning that gets ignored. Honestly, the worst part is the mental load: you can’t trust your pipeline, so you keep checking it.

The friction compounds. Here’s where it breaks down in real teams.

  • Reps end up spending about 10 minutes per lead doing copy-paste and double-checking fields.
  • Duplicates creep in when the email address is slightly different or the contact wasn’t found quickly.
  • Deals don’t get created consistently, so your pipeline looks “fine” right until you need forecasting.
  • Follow-up slows down because nobody is sure who owns the lead or where it is in HubSpot.

The Solution: Turn Shopify Emails into HubSpot Contacts + Deals

This workflow watches your Gmail inbox for new lead emails and does the CRM work for you. When an email arrives, it pulls the full message details (body plus metadata), checks that the sender/source matches Shopify, then parses the email content to extract the lead fields you care about. From there, it cleans and structures the data so HubSpot receives consistent properties every time. Finally, it creates or updates the HubSpot Contact, then creates a Deal tied to that contact so your pipeline stays accurate. You get real-time lead capture without depending on someone remembering to do admin work.

The workflow starts with a Gmail trigger that polls about once a minute. After a quick “is this actually Shopify?” check, a regex parser pulls out Name, Email, City, Phone, the message, and product details (URL/title). HubSpot then gets an upserted Contact and a brand-new Deal linked to it.

What You Get: Automation vs. Results

Example: What This Looks Like

Say you get 10 Shopify leads a week. Manually, you’ll spend maybe 10 minutes per lead to copy fields from Gmail, create a HubSpot contact, then create a deal and associate it, which is roughly 1.5 hours weekly (and it’s usually broken into annoying little chunks). With this workflow, the “work” is basically zero: the email arrives, n8n parses it in a moment, and HubSpot updates in the background. You still read the lead and respond, but the CRM busywork disappears.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Gmail for receiving Shopify lead emails
  • HubSpot to store contacts and create deals
  • HubSpot private app token (get it from HubSpot Private Apps)

Skill level: Intermediate. You’ll connect credentials and paste your deal stage ID, plus tweak the email parser if your format differs.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

A new lead email arrives in Gmail. The workflow polls your inbox about once per minute and grabs the newest message that matches your trigger settings.

The workflow confirms the source. It derives the sender address, then runs a simple check to make sure the email is coming from Shopify (so your general inbox noise doesn’t create junk deals).

The lead details get extracted and cleaned. A code step parses the email body using a regex pattern to pull fields like name, email, city, phone, message, and product URL/title. Then a mapping step structures those values so HubSpot receives consistent properties.

HubSpot is updated automatically. First, the workflow creates or updates the Contact. Next, it creates a Deal and associates it to that contact so your pipeline reflects reality.

You can easily modify the parsing and field mapping to match your exact Shopify email template and HubSpot property names based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Gmail Trigger

Set up the workflow to poll your inbox and capture new messages for processing.

  1. Add and open Inbox Poll Trigger.
  2. Set Poll Times to everyMinute under pollTimes.item.
  3. Leave Filters and Options empty unless you want to narrow the search criteria.
  4. Credential Required: Connect your Gmail credentials.

⚠️ Common Pitfall: If Gmail credentials are not connected, Inbox Poll Trigger will not fire and the workflow will never start.

Step 2: Connect Gmail and Fetch Message Details

Retrieve the full email content required for parsing lead fields.

  1. Add Fetch Email Detail and connect it to Inbox Poll Trigger.
  2. Set Operation to get.
  3. Set Message ID to ={{ $json.id }}.
  4. Credential Required: Connect your Gmail credentials.

Step 3: Set Up Validation and Parsing

Extract the sender email, validate the source, and parse the lead payload into structured fields.

  1. Add Derive Sender Address and paste the Function Code exactly as provided: let fromEmail = $json.from?.value?.[0]?.address || null;return [{ json: { ...$json, extractedFromEmail: fromEmail } }];
  2. Add Validate Sender Source with a string condition: Value 1 set to ={{ $json.extractedFromEmail }} and Value 2 set to [YOUR_EMAIL].
  3. Add Parse Lead Payload and set JavaScript Code to the full parsing script from the workflow (keep it unchanged).
  4. Connect Fetch Email DetailDerive Sender AddressValidate Sender SourceParse Lead Payload.

⚠️ Common Pitfall: The parsing regex expects labels like Name:, Email:, City:, Phone:, and Body:. If your email format differs, update the patterns in Parse Lead Payload.

Step 4: Configure CRM Output Nodes

Map the parsed lead data, upsert the contact in HubSpot, and create a related deal.

  1. Open Map Lead Fields and add assignments for each field: name ={{ $json.name }}, email ={{ $json.email }}, city ={{ $json.city }}, phone ={{ $json.phone }}, body ={{ $json.body }}, product_title ={{ $json.product_title }}, product_url ={{ $json.product_url }}.
  2. Configure Upsert CRM Contact with Authentication set to appToken and Email set to ={{ $json.email }}.
  3. In Upsert CRM Contact set Additional Fields: city ={{ $json.city }}, firstName ={{ $json.name }}, websiteUrl interwood.pk, mobilePhoneNumber ={{ $json.phone }}.
  4. Configure Generate CRM Deal with Resource deal, Stage [YOUR_ID], and Authentication appToken.
  5. Set Generate CRM Deal additional fields: amount 5, dealName ={{ $json.name }}, description ={{ $('Map Lead Fields').item.json.body }} of {{ $('Map Lead Fields').item.json.product_title }}, associatedVids ={{ $json.vid }}, and custom properties campaign=Website and message={{ $('Map Lead Fields').item.json.body }} of {{ $('Map Lead Fields').item.json.product_title }}.
  6. Credential Required: Connect your HubSpot credentials to both Upsert CRM Contact and Generate CRM Deal.

⚠️ Common Pitfall: Replace [YOUR_ID] in Generate CRM Deal with a valid HubSpot deal stage ID, or the deal creation will fail.

Step 5: Test and Activate Your Workflow

Verify the end-to-end flow and turn on the automation.

  1. Click Execute Workflow and send a test email that matches the expected lead format.
  2. Confirm that Validate Sender Source passes and Parse Lead Payload outputs parsed fields.
  3. Check HubSpot to ensure Upsert CRM Contact creates/updates the contact and Generate CRM Deal creates the deal with the correct description and associations.
  4. Toggle the workflow Active to enable continuous inbox polling.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • HubSpot credentials can expire or need specific permissions. If things break, check your HubSpot Private App scopes and token status first.
  • If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.

Frequently Asked Questions

How long does it take to set up this Gmail HubSpot leads automation?

About 30 minutes if your Gmail and HubSpot access is ready.

Do I need coding skills to automate Gmail HubSpot leads?

No. You’ll mainly connect accounts and paste in the right HubSpot deal stage ID. The only “technical” part is tweaking the email parser if your lead email format is different.

Is n8n free to use for this Gmail HubSpot leads workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in HubSpot plan limits (based on your account) and normal email/API usage.

Where can I host n8n to run this automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I customize this Gmail HubSpot leads workflow for a different email format?

Yes, but plan to edit the Code Node (Regex Parser) so it matches your exact email body, then adjust the Edit Fields (Set Node) mapping to your HubSpot property names. Common customizations include adding UTM fields, capturing a company name, changing how phone numbers are normalized, and mapping product title to a deal property. If your Shopify notifications vary by language, you’ll likely want separate parsing patterns.

Why is my HubSpot connection failing in this workflow?

Usually it’s an expired or replaced private app token. Regenerate the token in HubSpot, confirm the required scopes are enabled, then update the credential in n8n. If it’s still failing, check whether your portal has API limits or whether the deal stage ID you’re using is invalid for that pipeline.

How many leads can this Gmail HubSpot leads automation handle?

A typical small team can run hundreds of leads a month without thinking about it.

Is this Gmail HubSpot leads automation better than using Zapier or Make?

It depends on how strict you are about data quality. n8n is strong when you need logic like “only process Shopify senders,” custom parsing, and an upsert-then-create relationship (contact first, then associated deal). Self-hosting is also a real advantage if volume grows and you don’t want per-task pricing to spike. Zapier or Make can be faster for a basic two-step setup, but email parsing and deduping often gets messy there. Talk to an automation expert if you want help picking the cleanest route.

Once this is live, every real Shopify lead becomes a contact and a deal without anyone touching Gmail. That’s time back each week, plus a pipeline you can actually trust.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal