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

How to Auto-create contacts from emails with Pipedream

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

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 get frequent emails from prospects and want instant CRM updates without manual data entry.

Not ideal for

High-volume customer service teams processing hundreds of emails per hour due to API rate limits.

Sync type

real-time

Use case type

import

Real-World Example

💡

A 12-person B2B SaaS company gets 30-50 prospect emails daily to their info@ address. Before automation, the sales team manually added contacts to HubSpot, missing 40% of leads. Now every new sender becomes a contact within 30 seconds of emailing.

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 Pipedream

Copy the pre-built Pipedream blueprint and paste it straight into Pipedream. 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 permission
HubSpot private app token or OAuth credentials
Pipedream account (free tier works)

Field Mapping

Map these fields between your apps.

FieldAPI Name
Required
Emailemail
7 optional fields▸ show
First Namefirstname
Last Namelastname
Companycompany
Lead Sourcehs_lead_source
Original Sourcehs_analytics_source
Phone Numberphone
Websitewebsite

Step-by-Step Setup

1

Dashboard > New Workflow

Create new Pipedream workflow

Sign into Pipedream and start a new workflow. You'll build a trigger that watches for Gmail emails, then add steps to check HubSpot and create contacts. The workflow runs in real-time when emails arrive.

  1. 1Click 'New Workflow'
  2. 2Select 'Start from scratch'
  3. 3Name it 'Gmail to HubSpot Contacts'
What you should see: Empty workflow canvas with 'Select a trigger' button visible.
2

Triggers > Gmail > New Email Received

Add Gmail trigger

Choose the Gmail 'New Email Received' trigger. This creates a webhook that fires instantly when emails arrive in your inbox. You can filter by specific labels or folders if needed. The trigger captures sender details, subject, and body content.

  1. 1Click 'Select a trigger'
  2. 2Search for 'Gmail'
  3. 3Choose 'New Email Received'
What you should see: Gmail authentication prompt appears with scope permissions listed.
Common mistake — Gmail triggers only work with personal Gmail accounts, not Google Workspace accounts with restricted API access.
Pipedream
+
click +
search apps
HubSpot
HU
HubSpot
Add Gmail trigger
HubSpot
HU
module added
3

Gmail Auth > Grant Permissions

Connect Gmail account

Authorize Pipedream to access your Gmail account. Grant permissions for reading emails and basic profile information. The connection persists across all your workflows. Test the trigger by sending yourself an email to confirm it fires.

  1. 1Click 'Connect Gmail'
  2. 2Select your Google account
  3. 3Click 'Allow' for all permissions
  4. 4Click 'Test trigger'
What you should see: Green checkmark shows successful connection and sample email data appears.
Common mistake — Revoke and reconnect if you see 'insufficient permissions' errors later.
Pipedream settings
Connection
Choose a connection…Add
click Add
HubSpot
Log in to authorize
Authorize Pipedream
popup window
Connected
green checkmark
4

Steps > Add Step > HubSpot > Search Contacts

Add HubSpot search step

Add a HubSpot 'Search Contacts' action to check if the email sender already exists. Configure it to search by email address using the Gmail trigger's 'from' field. This prevents creating duplicate contacts for existing people.

  1. 1Click '+ Add Step'
  2. 2Search for 'HubSpot'
  3. 3Select 'Search Contacts'
  4. 4Map 'Email' to Gmail sender email
What you should see: HubSpot authentication screen loads with API key or OAuth options.
Common mistake — HubSpot's search is case-sensitive, so normalize email addresses to lowercase first.
5

HubSpot Auth > Private App Token

Connect HubSpot account

Link your HubSpot account using either a private app token or OAuth connection. Private app tokens work better for single-account setups. Make sure the token has contacts read and write permissions enabled in your HubSpot settings.

  1. 1Click 'Connect HubSpot'
  2. 2Choose 'Private App Token'
  3. 3Paste your HubSpot token
  4. 4Click 'Connect'
What you should see: Connection succeeds and contact search fields become available for mapping.
Common mistake — Private app tokens expire if not used for 6 months - set a calendar reminder.
6

Steps > Code > Node.js

Add conditional logic step

Insert a Node.js code step to check if HubSpot found any existing contacts. If the search returned results, the workflow should stop. If no contacts exist, continue to create a new one. This prevents duplicate contact creation.

  1. 1Click '+ Add Step'
  2. 2Select 'Code'
  3. 3Choose 'Run Node.js code'
  4. 4Add conditional logic code
What you should see: Code editor opens with async function template and steps object available.
Common mistake — Use 'return this.end()' to stop the workflow, not 'return false' which continues execution.
HubSpot
HU
trigger
filter
Condition
matches criteria?
yes — passes through
no — skipped
Gmail
GM
notified
7

Steps > Code > Node.js

Parse sender information

Add another code step to extract the sender's name and company from their email address and signature. Split the email address to get first/last names, and scan the email body for company mentions or signature lines. Store these in workflow variables.

  1. 1Click '+ Add Step'
  2. 2Select 'Code'
  3. 3Add email parsing logic
  4. 4Set name and company variables
What you should see: Code step shows parsed name and company data in the test output.
Common mistake — Email signatures vary wildly - build fallbacks for when company extraction fails.
8

Steps > HubSpot > Create Contact

Add HubSpot create contact action

Insert a 'Create Contact' action from HubSpot. Map the parsed first name, last name, email address, and company to the corresponding HubSpot contact properties. Set a lead source to track that these came from email automation.

  1. 1Click '+ Add Step'
  2. 2Search for 'HubSpot Create Contact'
  3. 3Map firstName to parsed name
  4. 4Map email to sender email
  5. 5Map company to parsed company
What you should see: Contact creation form shows all mapped fields with dynamic data from previous steps.
Common mistake — HubSpot requires email as a unique identifier - duplicate emails will update existing contacts instead of creating new ones.
9

Steps > Code > Error Handling

Add error handling

Wrap the contact creation in a try-catch block using a code step. Log any API errors to Pipedream's built-in logging system. Send yourself a Slack or email notification when contact creation fails so you can investigate.

  1. 1Click '+ Add Step'
  2. 2Select 'Code'
  3. 3Add try-catch around HubSpot call
  4. 4Configure error notifications
What you should see: Error handling code shows in editor with proper logging and notification setup.
Common mistake — HubSpot's API returns cryptic error codes - log the full response object for debugging.
10

Workflow > Test > View Logs

Test the complete workflow

Send a test email from an address not in HubSpot to trigger the workflow. Watch the execution logs to verify each step completes successfully. Check HubSpot to confirm the new contact appears with correct information. Test with an existing contact to verify duplicate prevention works.

  1. 1Click 'Test Workflow'
  2. 2Send test email
  3. 3Monitor execution logs
  4. 4Check HubSpot for new contact
  5. 5Verify duplicate prevention
What you should see: Workflow completes successfully and new contact appears in HubSpot within 30 seconds.
Common mistake — Test with various email formats including no signatures and multiple company mentions to ensure robustness.

This Node.js code extracts company names from email signatures and domains, handling common formatting variations. Paste it into the company parsing code step.

JavaScript — Code Stepexport default defineComponent({
▸ Show code
export default defineComponent({
  async run({ steps, $ }) {
    const email = steps.trigger.event.from;

... expand to see full code

export default defineComponent({
  async run({ steps, $ }) {
    const email = steps.trigger.event.from;
    const body = steps.trigger.event.body || '';
    const domain = email.split('@')[1];
    
    // Extract company from signature patterns
    const signaturePatterns = [
      /(?:at|@)\s+([A-Z][^\n,]+(?:Corp|Inc|LLC|Ltd|Company))/gi,
      /([A-Z][^\n,]+(?:Corp|Inc|LLC|Ltd|Company))/gi,
      /Company:\s*([^\n]+)/gi
    ];
    
    let company = null;
    for (const pattern of signaturePatterns) {
      const match = body.match(pattern);
      if (match && match[1]) {
        company = match[1].trim();
        break;
      }
    }
    
    // Fallback to domain-based company name
    if (!company && domain) {
      company = domain.split('.')[0]
        .replace(/[^a-zA-Z0-9]/g, ' ')
        .replace(/\b\w/g, l => l.toUpperCase());
    }
    
    return { company: company || 'Unknown' };
  }
});
Pipedream
▶ Deploy & test
executed
HubSpot
Gmail
Gmail
🔔 notification
received

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 Pipedream for this if you want granular control over contact data parsing and need custom logic for duplicate prevention. Pipedream's Node.js code steps let you build sophisticated email signature parsing that extracts company names, phone numbers, and job titles with higher accuracy than no-code platforms. The built-in retry mechanism and error logging make it reliable for business-critical contact creation. Choose Zapier instead if your team doesn't code and you just need basic name/email extraction without custom parsing.

Cost

This workflow costs 2 credits per email processed. On Pipedream's $19/month plan with 10,000 credits, you can handle 5,000 emails monthly for $0.0038 per contact. That beats Zapier at $0.10 per task ($500 for the same volume) and Make.com at $0.005 per operation plus platform fees. The math works heavily in Pipedream's favor for email-to-CRM automation.

Tradeoffs

Make.com offers better visual debugging with its node-based interface, making it easier to trace data transformations when things break. Zapier provides more pre-built Gmail filters and HubSpot field mapping templates out of the box. n8n gives you self-hosted control if data privacy is critical. Power Automate integrates better with Outlook and Office 365. Pipedream still wins because its code flexibility lets you handle edge cases that break other platforms - like parsing international business cards or extracting company data from email footers.

You'll hit Gmail's API rate limits at around 1 billion quota units per day, which translates to roughly 10,000 emails depending on payload size. HubSpot's contact creation API allows 100 requests per 10 seconds, so high-volume senders need batching logic. Email signature parsing breaks on plaintext emails, mobile signatures, and non-English content - build robust fallbacks that default to domain-based company names when extraction fails.

Ideas for what to build next

  • Add lead scoringCreate a follow-up workflow that assigns lead scores based on email content sentiment and company size data from Clearbit or ZoomInfo.
  • Set up email categorizationUse AI to classify incoming emails by intent (demo request, pricing question, support) and route them to appropriate sales team members.
  • Create contact enrichmentBuild a secondary workflow that enriches new contacts with social profiles, company data, and industry information from third-party APIs.

Related guides

Was this guide helpful?
HubSpot + Gmail overviewPipedream profile →