Process Shopify Lead Emails from Gmail to HubSpot Contacts and Deals β€” n8n Workflow

Medium complexity⚑ Trigger8 nodes🀝 Salesby Shahzaib Anwar

Overview

πŸ“Œ Overview This workflow automatically processes incoming Shopify/Gmail leads and pushes them into HubSpot as both Contacts and Deals.

It helps sales and marketing teams capture leads instantly, enrich CRM data, and avoid missed opportunities.

⚑ How it works Trigger: Watches for new emails in Gmail.
Extract Data: Parses email body (Name, Email, City, Phone, Message, Product URL/Title).
Condition: Checks if sender is Shopify before processing.
HubSpot:
Creates/updates a Contact w

Nodes used

HubSpotGmailCode

Workflow Preview

Gmail Trigger
Polls Gmail every minute and emits new emails into the
Get Message
Fetches full email (body + metadata) for parsing.
Extract From Email
Pulls sender address used for filtering/routing.
If Sender is Shopify
Processes only emails from Shopify (change to your sour
Code (Regex Parser)
Extracts: name, email, city, phone, message, product_ur
Adjust regex if your email format differs.
Edit Fields
Normalizes extracted values into clean JSON for HubSpot
HubSpot Contact
Creates/updates a Contact (email, name, phone, city).
HubSpot Deal
Creates a Deal linked to the Contact.
Set your pipeline stage (replace `YOUR_STAGE_ID`).
⚑
G
Gmail Trigger
Get a message
E
Extract From Email
I
If Sender is Shopify
Code
E
Edit Fields
Create or update a contact
Create a deal
8 nodes7 edges

How it Works

  1. 1

    Trigger

    The workflow starts with a trigger trigger.

  2. 2

    Process

    Data flows through 8 nodes, connecting code, function, gmail.

  3. 3

    Output

    The workflow completes its automation and delivers the result to the configured destination.

Node Details (8)

HU

HubSpot

hubspot

#1
GM

Gmail

gmail

#2
CO

Code

code

#3

How to Import This Workflow

  1. 1Click Download JSON button on the right to save the workflow file.
  2. 2Open your n8n instance. Go to Workflows β†’ New β†’ Import from file.
  3. 3Select the downloaded process-shopify-lead-emails-from-gmail-to-hubspot-contacts-and-deals file and click Import.
  4. 4Set up credentials for each service node (API keys, OAuth, etc.).
  5. 5Click Test Workflow to verify everything works, then activate it.

Or paste directly in n8n β†’ Import from JSON:

{ "name": "Process Shopify Lead Emails from Gmail to HubSpot Contacts and Deals", "nodes": [...], ...}

Integrations

codefunctiongmailgmailtriggerhubspotifset

Get This Workflow

Download and import in one click

Download JSONView on n8n.io
Nodes8
Complexitymedium
Triggertrigger
CategorySales

Created by

Shahzaib Anwar

Shahzaib Anwar

@shahzaibanwar

Tags

codefunctiongmailgmailtriggerhubspotifset
⚑

New to n8n?

n8n is a free, open-source workflow automation tool. Self-host it or use the cloud version.

Get n8n Free β†’