Intermediate~20 min setupCRM & EmailVerified April 2026
HubSpot logo
Gmail logo

How to Auto-create HubSpot Contacts from Gmail with N8n

Automatically create HubSpot contacts when you receive emails from people not in your CRM.

Steps and UI details are based on platform versions at time of writing — check each platform for the latest interface.

HubSpot Gmail extension exists as a native integration, but it requires manual setup per user and doesn't create contacts automatically. This guide uses an automation platform for full control. View native option →

Best for

Teams that process 100+ inbound emails monthly and need custom contact tagging logic.

Not ideal for

Non-technical users who want plug-and-play email parsing without writing code.

Sync type

real-time

Use case type

import

Real-World Example

💡

A 12-person B2B software company uses this to capture leads from their support Gmail inbox. Before automation, sales reps manually copied 40-50 email addresses per week into HubSpot, missing about 20% of inbound prospects. Now every email from a new domain automatically creates a contact tagged with 'Support Inquiry' and triggers their nurture sequence within 3 minutes.

What Will This Cost?

Drag the slider to your expected monthly volume.

/mo
505005K50K

Each platform counts differently — Zapier: 1 task per trigger. Make: 1 operation per module per record. n8n: 1 execution per run.

Prices shown for annual billing. Based on published pricing as of April 2026.

Estimated ROI

1000

min saved/mo

$583

labor value/mo

Free

no platform cost

Based on ~2 min manual effort per operation at $35/hr fully loaded labor cost.

Implementation

Skip the setup

Import this workflow directly into n8n

Copy the pre-built n8n blueprint and paste it straight into n8n. All modules, filters, and field mappings are already configured — you just need to connect your accounts.

Before You Start

Make sure you have everything ready.

Gmail account with API access enabled
HubSpot account with Contacts API permissions
N8n instance running (cloud or self-hosted)
Custom 'lead_source' property created in HubSpot

Field Mapping

Map these fields between your apps.

FieldAPI Name
Required
Email Addressemail
5 optional fields▸ show
First Namefirstname
Last Namelastname
Company Domaincompany
Lead Sourcehs_lead_status
Lifecycle Stagelifecyclestage

Step-by-Step Setup

1

Canvas > + > Trigger Nodes > Gmail

Set up Gmail trigger node

Configure N8n to monitor your Gmail inbox for new messages. This will fire the workflow whenever a new email arrives.

  1. 1Click the '+' button to add a new node
  2. 2Select 'Gmail' from the triggers list
  3. 3Choose 'Message Received' as the trigger event
  4. 4Connect your Gmail account using OAuth
  5. 5Set 'labelIds' to 'INBOX' to monitor all incoming emails
What you should see: You should see a green checkmark and 'Gmail node configured successfully' message.
Common mistake — Don't use 'On Poll' unless you want to process old emails — stick with 'Message Received' for real-time processing.
n8n
+
click +
search apps
HubSpot
HU
HubSpot
Set up Gmail trigger node
HubSpot
HU
module added
2

Canvas > + > Regular Nodes > HubSpot

Add HubSpot lookup node

Check if the sender already exists in HubSpot to prevent duplicates. This search runs before creating any new contact.

  1. 1Add a new node and select 'HubSpot'
  2. 2Choose 'Contact' as the resource
  3. 3Set operation to 'Get' then 'Get by email'
  4. 4Map the email field to {{$node['Gmail'].json['payload']['headers'].find(h => h.name === 'From').value}}
  5. 5Enable 'Continue on Fail' in node settings
What you should see: The test should either return an existing contact or show 'Item not found' error (both are correct).
Common mistake — You must enable 'Continue on Fail' or the workflow stops when no contact exists — that breaks the automation.
3

Canvas > + > Logic > IF

Add IF condition node

Create a branch that only creates contacts for new email addresses. This prevents overwriting existing contact data.

  1. 1Add an IF node after the HubSpot lookup
  2. 2Set condition to 'Is Empty'
  3. 3Connect the HubSpot node output to the IF input
  4. 4Map the condition value to {{$node['HubSpot'].json['id']}}
  5. 5Label the 'true' branch as 'Create Contact'
What you should see: You should see two output paths: 'true' for new contacts and 'false' for existing ones.
Common mistake — Don't use 'Does not exist' condition — use 'Is Empty' to properly handle the null response from HubSpot.
HubSpot
HU
trigger
filter
Condition
matches criteria?
yes — passes through
no — skipped
Gmail
GM
notified
4

Canvas > + > Core Nodes > Code

Parse sender email address

Extract the clean email address and sender name from Gmail's header format. Gmail returns 'Name <[email protected]>' which needs parsing.

  1. 1Add a Code node on the 'true' branch of the IF
  2. 2Set language to JavaScript
  3. 3Paste email parsing code to extract name and email
  4. 4Test with a sample Gmail message
  5. 5Verify the output shows separate 'email' and 'name' fields
What you should see: The output panel should display parsed fields like {'name': 'John Smith', 'email': '[email protected]'}.
5

Canvas > + > Core Nodes > Code

Add company domain extraction

Extract the company domain from the email address to populate HubSpot's company field. Most B2B workflows need this data.

  1. 1Add another Code node after email parsing
  2. 2Write JavaScript to extract domain from email address
  3. 3Map domain to a 'company' field
  4. 4Handle common email providers (gmail.com, outlook.com) by setting company to null
  5. 5Test with both business and personal email addresses
What you should see: Business emails show company as 'acme.com' while Gmail addresses show company as null.
Common mistake — Don't populate company for Gmail, Yahoo, or Outlook addresses — that creates meaningless company records in HubSpot.
6

Canvas > + > Regular Nodes > HubSpot

Create HubSpot contact node

Add the new contact to HubSpot with all parsed data. This is where the actual contact creation happens.

  1. 1Add another HubSpot node after the parsing
  2. 2Select 'Contact' resource and 'Create' operation
  3. 3Map 'email' field to parsed email address
  4. 4Map 'firstname' and 'lastname' from parsed name
  5. 5Map 'company' field to extracted domain
  6. 6Set 'lifecyclestage' to 'lead'
What you should see: Test should create a contact and return a HubSpot contact ID in the response.
Common mistake — HubSpot requires 'email' as the primary field — other fields are optional but email cannot be empty.
7

HubSpot Node > Additional Properties

Add contact source tracking

Tag the contact with source information so you know it came from email automation. This helps with attribution and lead scoring.

  1. 1In the same HubSpot create node, scroll to additional properties
  2. 2Add 'hs_lead_status' and set to 'NEW'
  3. 3Add 'lead_source' custom property and set to 'Email Automation'
  4. 4Map 'first_conversion_date' to current timestamp
  5. 5Add any other custom tracking fields your team uses
What you should see: The created contact should show 'Email Automation' as the lead source in HubSpot.
Common mistake — Make sure your 'lead_source' property exists in HubSpot first — N8n won't create custom properties automatically.
8

Workflow Settings > Error Workflow

Set up error handling

Configure what happens when the workflow fails. Email processing needs reliable error handling to avoid losing leads.

  1. 1Click on the workflow settings gear icon
  2. 2Enable 'Error Workflow' and create a new error workflow
  3. 3Add a Gmail node to send error notifications to your team
  4. 4Set error retry to 3 attempts with 5-minute delays
  5. 5Save and activate the error workflow
What you should see: You should see 'Error handling configured' in the workflow settings panel.
Common mistake — Don't set retry attempts too high — HubSpot API errors usually need manual investigation, not automatic retries.
9

Executions > View Details

Test with real email

Send a test email from an address not in HubSpot to verify end-to-end functionality. This confirms the whole workflow works.

  1. 1Activate the workflow by clicking the toggle switch
  2. 2Send an email to your Gmail from a new address
  3. 3Check the execution log in N8n for successful completion
  4. 4Verify the new contact appears in HubSpot within 2-3 minutes
  5. 5Send another email from the same address to test duplicate prevention
What you should see: First email creates a contact, second email stops at the IF condition without creating a duplicate.
Common mistake — Test duplicate prevention — if the same email creates multiple contacts, your IF condition logic is wrong.
n8n
▶ Run once
executed
HubSpot
Gmail
Gmail
🔔 notification
received
10

Canvas > Logic > IF

Configure email filtering

Add filters to process only relevant emails and ignore newsletters or automated messages. This prevents junk contacts in your CRM.

  1. 1Add an IF node right after the Gmail trigger
  2. 2Set condition to exclude emails with 'noreply' or 'no-reply' in sender address
  3. 3Add another condition to exclude emails from known domains like 'mailchimp.com'
  4. 4Create a whitelist condition for emails containing specific keywords in subject
  5. 5Connect the filter to your existing HubSpot lookup node
What you should see: Automated emails and newsletters should stop at the filter, while real person emails continue processing.
Common mistake — Be careful with subject line filters — legitimate prospects might use words that trigger your exclusion rules.

Drop this into an n8n Code node.

JavaScript — Code Node// Parse complex email formats with fallback
▸ Show code
// Parse complex email formats with fallback
const fromHeader = $node['Gmail'].json['payload']['headers'].find(h => h.name === 'From').value;
const emailMatch = fromHeader.match(/<(.+?)>/) || [null, fromHeader];

... expand to see full code

// Parse complex email formats with fallback
const fromHeader = $node['Gmail'].json['payload']['headers'].find(h => h.name === 'From').value;
const emailMatch = fromHeader.match(/<(.+?)>/) || [null, fromHeader];
const email = emailMatch[1].toLowerCase().trim();
const name = fromHeader.replace(/<.+?>/, '').replace(/["\']/g, '').trim();
const [firstName, ...lastNameParts] = name.split(' ');
return {
  email,
  firstName: firstName || email.split('@')[0],
  lastName: lastNameParts.join(' ') || null,
  company: email.includes('@gmail.') ? null : email.split('@')[1]
};

Scaling Beyond 200+ emails/day+ Records

If your volume exceeds 200+ emails/day records, apply these adjustments.

1

Switch to webhook triggers

Gmail polling hits API limits at high volume. Use Gmail's push notifications with N8n webhooks to process emails instantly without polling overhead.

2

Batch HubSpot operations

Group contact creations into batches of 10 using N8n's batch processing node. This reduces API calls and avoids HubSpot's rate limits of 100 requests per 10 seconds.

3

Add execution queuing

Configure N8n to queue executions during peak hours instead of processing simultaneously. This prevents overwhelming HubSpot's API and reduces error rates from 15% to under 2%.

Going live

Production Checklist

Before you turn this on for real, confirm each item.

Troubleshooting

Common errors and how to fix them.

Frequently Asked Questions

Common questions about this workflow.

Analysis

VerdictWhy n8n for this workflow

Use N8n for this if you need custom email parsing logic or want to avoid per-contact pricing. N8n's code nodes handle complex sender formats better than Zapier's limited text tools. You can extract company domains, parse names with special characters, and add sophisticated filtering rules. Pick Make instead if you need a visual email parser — their drag-and-drop text functions are faster to set up than writing JavaScript.

Cost

This workflow uses 2-3 executions per email (Gmail trigger + HubSpot lookup + contact creation). At 200 emails per month, that's 600 executions monthly. N8n's Starter plan gives you 5,000 executions for $20/month. Zapier would cost $29/month for the same volume with their email parser addon. Make charges $9/month but limits you to 1,000 operations — you'd hit that limit at 334 emails.

Tradeoffs

Zapier wins on email parsing with built-in name splitting and domain extraction tools — no coding required. Make has better HubSpot integration with more trigger options and field mapping helpers. But both charge per successful contact creation, which gets expensive fast. N8n only charges for executions, so failed lookups and duplicate checks don't cost extra. That's huge for high-volume email processing.

You'll hit Gmail API limits at 250+ emails per hour — N8n doesn't automatically handle rate limiting like Zapier does. HubSpot's contact search API is case-sensitive, so [email protected] and [email protected] create duplicates unless you normalize email addresses in your code. The workflow also breaks if someone sends from a group email alias that forwards to your Gmail — the 'From' header shows the alias, not the original sender.

Ideas for what to build next

  • Add email content analysisParse email signatures for phone numbers and job titles using N8n's regex functions. This enriches contacts with more data points than just name and email.
  • Connect to company enrichment APIUse Clearbit or ZoomInfo APIs to automatically populate company size, industry, and revenue data based on the extracted domain name.
  • Set up lead scoring automationCreate a follow-up workflow that scores new contacts based on email domain, company size, and engagement patterns to prioritize sales follow-up.

Related guides

Was this guide helpful?
HubSpot + Gmail overviewn8n profile →