

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-timeUse case type
importReal-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.
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
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.
Field Mapping
Map these fields between your apps.
| Field | API Name | |
|---|---|---|
| Required | ||
| Email Address | email | |
5 optional fields▸ show
| First Name | firstname |
| Last Name | lastname |
| Company Domain | company |
| Lead Source | hs_lead_status |
| Lifecycle Stage | lifecyclestage |
Step-by-Step Setup
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.
- 1Click the '+' button to add a new node
- 2Select 'Gmail' from the triggers list
- 3Choose 'Message Received' as the trigger event
- 4Connect your Gmail account using OAuth
- 5Set 'labelIds' to 'INBOX' to monitor all incoming emails
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.
- 1Add a new node and select 'HubSpot'
- 2Choose 'Contact' as the resource
- 3Set operation to 'Get' then 'Get by email'
- 4Map the email field to {{$node['Gmail'].json['payload']['headers'].find(h => h.name === 'From').value}}
- 5Enable 'Continue on Fail' in node settings
Canvas > + > Logic > IF
Add IF condition node
Create a branch that only creates contacts for new email addresses. This prevents overwriting existing contact data.
- 1Add an IF node after the HubSpot lookup
- 2Set condition to 'Is Empty'
- 3Connect the HubSpot node output to the IF input
- 4Map the condition value to {{$node['HubSpot'].json['id']}}
- 5Label the 'true' branch as 'Create Contact'
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.
- 1Add a Code node on the 'true' branch of the IF
- 2Set language to JavaScript
- 3Paste email parsing code to extract name and email
- 4Test with a sample Gmail message
- 5Verify the output shows separate 'email' and 'name' fields
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.
- 1Add another Code node after email parsing
- 2Write JavaScript to extract domain from email address
- 3Map domain to a 'company' field
- 4Handle common email providers (gmail.com, outlook.com) by setting company to null
- 5Test with both business and personal email addresses
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.
- 1Add another HubSpot node after the parsing
- 2Select 'Contact' resource and 'Create' operation
- 3Map 'email' field to parsed email address
- 4Map 'firstname' and 'lastname' from parsed name
- 5Map 'company' field to extracted domain
- 6Set 'lifecyclestage' to 'lead'
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.
- 1In the same HubSpot create node, scroll to additional properties
- 2Add 'hs_lead_status' and set to 'NEW'
- 3Add 'lead_source' custom property and set to 'Email Automation'
- 4Map 'first_conversion_date' to current timestamp
- 5Add any other custom tracking fields your team uses
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.
- 1Click on the workflow settings gear icon
- 2Enable 'Error Workflow' and create a new error workflow
- 3Add a Gmail node to send error notifications to your team
- 4Set error retry to 3 attempts with 5-minute delays
- 5Save and activate the error workflow
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.
- 1Activate the workflow by clicking the toggle switch
- 2Send an email to your Gmail from a new address
- 3Check the execution log in N8n for successful completion
- 4Verify the new contact appears in HubSpot within 2-3 minutes
- 5Send another email from the same address to test duplicate prevention
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.
- 1Add an IF node right after the Gmail trigger
- 2Set condition to exclude emails with 'noreply' or 'no-reply' in sender address
- 3Add another condition to exclude emails from known domains like 'mailchimp.com'
- 4Create a whitelist condition for emails containing specific keywords in subject
- 5Connect the filter to your existing HubSpot lookup node
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.
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.
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.
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
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.
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.
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 analysis — Parse 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 API — Use Clearbit or ZoomInfo APIs to automatically populate company size, industry, and revenue data based on the extracted domain name.
- →Set up lead scoring automation — Create a follow-up workflow that scores new contacts based on email domain, company size, and engagement patterns to prioritize sales follow-up.
Related guides
How to Share Notion Meeting Notes to Slack with Pipedream
~15 min setup
How to Share Notion Meeting Notes to Slack with Power Automate
~15 min setup
How to Share Notion Meeting Notes to Slack with n8n
~20 min setup
How to Send Notion Meeting Notes to Slack with Zapier
~8 min setup
How to Share Notion Meeting Notes to Slack with Make
~12 min setup
How to Create Notion Tasks from Slack with Pipedream
~15 min setup