Skip to main content

Process Shopify lead emails from Gmail to HubSpot contacts and deals

Workflow preview

Workflow preview
100%
Process Shopify lead emails from Gmail to HubSpot contacts and deals preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow 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 ...

Best for

  • Lead Generation automation workflows
  • CRM automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.gmailtrigger, n8n-nodes-base.gmail, n8n-nodes-base.function, n8n-nodes-base.if, n8n-nodes-base.code, n8n-nodes-base.set, n8n-nodes-base.hubspot, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Shahzaib Anwar.

Original n8n.io source

1.1 Workflow description

Title
Process Shopify lead emails from Gmail to HubSpot contacts and deals
Workflow name
Process Shopify lead emails from Gmail to HubSpot contacts and deals

📌 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

  1. Trigger: Watches for new emails in Gmail.
  2. Extract Data: Parses email body (Name, Email, City, Phone, Message, Product URL/Title).
  3. Condition: Checks if sender is Shopify before processing.
  4. HubSpot:
    • Creates/updates a Contact with customer details.
    • Creates a Deal associated with that contact.

🎯 Benefits

  • 📥 Automates lead capture → CRM
  • 🚫 Eliminates manual copy-paste from Gmail
  • 🔄 Real-time sync between Gmail and HubSpot
  • 📈 Improves sales follow-up speed and accuracy

🛠 Setup Steps

  1. Import this workflow into your n8n instance.
  2. Connect your Gmail and HubSpot credentials.
  3. Replace the HubSpot Deal Stage ID with your own pipeline stage.
  4. (Optional) Adjust the Code Node regex if your email format differs.
  5. Activate the workflow and test with a sample lead email.

📝 Example Email Format

Name: John Doe Email: [email protected] City: London Phone: +44 7000 000000 Body: Interested in product Product Url: https://example.com/product Product Title: Sample Product

sticky_notes:

  • name: Gmail Trigger note: > 📧 Watches for new emails in Gmail. Polls every minute and passes email data into the flow.

  • name: Get a Message note: > 📩 Fetches the full Gmail message content (body + metadata) for parsing.

  • name: Extract From Email note: > 🔍 Extracts the sender’s email address from Gmail to identify the source.

  • name: If Sender is Shopify note: > ✅ Condition node that ensures only Shopify-originated emails/leads are processed.

  • name: Code Node (Regex Parser) note: > 🧾 Parses the email body using regex to extract Name, Email, City, Phone, Message, Product URL, and Title.

  • name: Edit Fields (Set Node) note: > 📝 Cleans and structures the extracted fields into proper JSON format before sending to HubSpot.

  • name: HubSpot → Create/Update Contact note: > 👤 Creates or updates a HubSpot Contact with the extracted lead details.

  • name: HubSpot → Create Deal note: > 💼 Creates a HubSpot Deal linked to the Contact, including campaign/product information.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Gmail Trigger

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1.2

Block 2 - Get a message

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 3 - Extract From Email

Type / Role
n8n-nodes-base.function - function
Config choices
Version 1

Block 4 - If Sender is Shopify

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 5 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Edit Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Create or update a contact

Type / Role
n8n-nodes-base.hubspot - hubspot
Config choices
Version 2.1

Block 8 - Create a deal

Type / Role
n8n-nodes-base.hubspot - hubspot
Config choices
Version 2.1

Block 9 - Sticky: Gmail Trigger

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky: Get Message

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky: Extract From Email

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky: Shopify Filter

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky: Parser

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky: Normalize

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky: HubSpot Contact

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky: HubSpot Deal

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Process Shopify lead emails from Gmail to HubSpot contacts and deals
Complexity advanced
Nodes 16
Categories Lead Generation, CRM
Author Shahzaib Anwar
Published 16 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8647/8647.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Process Shopify lead emails from Gmail to HubSpot contacts and deals do?

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 ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Lead Generation, CRM use case.