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

How to Parse Email Signatures and Update HubSpot Contacts with N8n

Extract phone numbers, job titles, and company names from Gmail signatures and automatically update corresponding HubSpot contact properties.

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 processing high volumes of sales emails who need flexible signature data extraction with custom regex patterns.

Not ideal for

Small teams with under 50 emails monthly or users who need plug-and-play solutions without any coding.

Sync type

polling

Use case type

sync

Real-World Example

💡

A 25-person B2B software sales team uses this to automatically update HubSpot contacts with phone numbers and job titles from prospect email signatures. Before automation, SDRs manually copied signature data into CRM records, missing 40% of updates during busy periods and spending 15 minutes daily on data entry.

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 and valid API key
N8n instance running (cloud or self-hosted)

Optional

Basic regex knowledge for customizing extraction patterns

Field Mapping

Map these fields between your apps.

FieldAPI Name
Required
Email Addressemail
3 optional fields▸ show
Phone Numberphone
Job Titlejobtitle
Company Namecompany

Step-by-Step Setup

1

Workflows > New > Gmail > Message Received

Connect Gmail to N8n

Set up Gmail as your trigger to monitor incoming emails. N8n will watch for new messages and extract signature data from each one.

  1. 1Click the purple + button to add a new workflow
  2. 2Search for 'Gmail' in the apps list
  3. 3Select 'Gmail Trigger' and choose 'Message Received'
  4. 4Click 'Create credential' and authenticate with your Google account
  5. 5Set the label filter to 'INBOX' to monitor all incoming emails
What you should see: You should see a green 'Connected' status and Gmail should show 'Credentials loaded successfully'.
Common mistake — Don't use 'Message Sent' - that only triggers on outbound emails and won't capture incoming signatures.
2

Gmail Node > Test step

Test Gmail Connection

Pull a sample email to verify the connection works and see the email structure. This shows you exactly what signature data N8n can access.

  1. 1Click 'Test step' on the Gmail node
  2. 2Select a recent email from the dropdown list
  3. 3Click 'Use this data' to confirm the selection
  4. 4Expand the 'body' section to view email content
What you should see: The test panel displays email metadata including subject, sender, and body content with HTML formatting visible.
n8n
▶ Run once
executed
HubSpot
Gmail
Gmail
🔔 notification
received
3

Workflow > + > Code > Code Node

Add Regex Extract Node

Create a function node to extract phone numbers from email signatures using regular expressions. This handles the core parsing logic.

  1. 1Click the + button after Gmail node
  2. 2Search for 'Code' and select 'Code Node'
  3. 3Rename the node to 'Extract Phone'
  4. 4Paste this regex pattern: /(?:\+?1[-. ]?)?\(?[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}/g
  5. 5Add JavaScript: const phone = $json.body.match(/(?:\+?1[-. ]?)?\(?[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}/g); return {phone: phone ? phone[0] : null};
What you should see: The Code node shows syntax highlighting and no error indicators in the JavaScript editor.
Common mistake — Test your regex with international numbers if you handle global contacts - the default pattern only catches US formats.
4

Workflow > + > Code > Code Node

Extract Job Titles

Add another Code node to parse job titles from signatures. Most signatures follow predictable patterns after names.

  1. 1Add another Code node after the phone extraction
  2. 2Rename it to 'Extract Title'
  3. 3Use this regex: /(?:^|\n)([A-Z][^\n]*(?:Manager|Director|VP|President|CEO|CTO|Engineer|Analyst|Specialist|Coordinator))/im
  4. 4Add JavaScript: const title = $json.body.match(/(?:^|\n)([A-Z][^\n]*(?:Manager|Director|VP|President|CEO|CTO|Engineer|Analyst|Specialist|Coordinator))/im); return {title: title ? title[1].trim() : null};
  5. 5Connect this node to receive data from the Extract Phone node
What you should see: The node editor shows the JavaScript code with proper syntax highlighting and the connection arrow appears between nodes.
Common mistake — Job title extraction fails if titles use lowercase - add more regex variations for better coverage.
5

Workflow > + > Code > Code Node

Extract Company Names

Create a third extraction node for company names. Companies often appear on separate lines or after specific keywords in signatures.

  1. 1Add a third Code node connected to Extract Title
  2. 2Rename it to 'Extract Company'
  3. 3Use this pattern: /(?:at |@)([A-Z][^\n,]+(?:Inc|LLC|Corp|Ltd|Company))/i
  4. 4Add JavaScript: const company = $json.body.match(/(?:at |@)([A-Z][^\n,]+(?:Inc|LLC|Corp|Ltd|Company))/i); return {company: company ? company[1].trim() : null};
  5. 5Test the extraction with sample signature text
What you should see: All three extraction nodes show green status indicators and display extracted data in the test panel.
Common mistake — Company extraction misses organizations without legal suffixes - add patterns for 'University', 'Agency', 'Group' if needed.
6

Workflow > + > HubSpot > Contact > Update

Connect HubSpot

Add HubSpot as the destination for your extracted signature data. This node will search for existing contacts and update their properties.

  1. 1Click + after the company extraction node
  2. 2Search for 'HubSpot' in the apps menu
  3. 3Select 'HubSpot' and choose 'Contact' resource
  4. 4Set operation to 'Update' from the dropdown
  5. 5Click 'Create credential' and enter your HubSpot API key
What you should see: HubSpot shows 'Connected' status and the Contact resource options become available in the interface.
Common mistake — Use a Private App token, not OAuth - OAuth tokens expire and break automation workflows.
7

HubSpot Node > Contact ID > By Email

Configure Contact Search

Set up contact identification to find the right HubSpot record to update. Use the sender's email address as the unique identifier.

  1. 1In the HubSpot node, set 'Contact ID' to 'By Email'
  2. 2Map the email field to {{$node["Gmail Trigger"].json["from"]}}
  3. 3Click 'Add Field' to start mapping signature data
  4. 4Select 'Phone' from the dropdown list
  5. 5Map phone to {{$node["Extract Phone"].json["phone"]}}
What you should see: The field mapping section shows Gmail email address connected to HubSpot contact lookup with phone field mapped.
Common mistake — Gmail 'from' field includes display name - use a Code node to extract just the email if matching fails.
8

HubSpot Node > Add Field > Properties

Map Remaining Fields

Complete the field mapping by connecting job title and company data to HubSpot contact properties. This updates all extracted signature information.

  1. 1Click 'Add Field' and select 'Job Title' from the property list
  2. 2Map job title to {{$node["Extract Title"].json["title"]}}
  3. 3Click 'Add Field' again and select 'Company'
  4. 4Map company to {{$node["Extract Company"].json["company"]}}
  5. 5Set 'Update if exists' to true
What you should see: Three field mappings appear: phone, job title, and company, each connected to their respective extraction node outputs.
Common mistake — HubSpot requires exact property names - 'jobtitle' not 'job_title'. Check your property API names in HubSpot settings.
HubSpot fields
firstname
lastname
email
company
hs_lead_status
available as variables:
1.props.firstname
1.props.lastname
1.props.email
1.props.company
1.props.hs_lead_status
9

HubSpot Node > Settings > Continue on Fail

Add Error Handling

Configure the workflow to handle missing data gracefully. Not every email signature contains all three data points.

  1. 1Click the settings gear icon on the HubSpot node
  2. 2Select 'Continue on Fail' from the error handling dropdown
  3. 3Add an IF node before HubSpot to check for extracted data
  4. 4Set condition: {{$json.phone}} OR {{$json.title}} OR {{$json.company}}
  5. 5Connect the 'true' path to HubSpot and 'false' to a No Operation node
What you should see: An IF node appears with conditional logic and two output paths - one leading to HubSpot updates, one to skip processing.
Common mistake — Without the IF check, workflows fail on emails with no signature data - this floods your error logs.
10

Workflow > Execute Workflow

Test Complete Workflow

Run the entire workflow with real email data to verify signature parsing and HubSpot updates work correctly.

  1. 1Click 'Execute Workflow' in the top toolbar
  2. 2Select an email with a signature from the Gmail test data
  3. 3Watch each node execute and turn green
  4. 4Check the HubSpot node output to confirm contact updates
  5. 5Verify the changes in your HubSpot contact record
What you should see: All nodes show green checkmarks, extracted data appears in node outputs, and HubSpot confirms the contact update.
Common mistake — Test with various signature formats - some will fail extraction and that's normal behavior, not an error.
11

Workflow > Active > Settings

Schedule Workflow Activation

Turn on the workflow to process emails automatically. Set appropriate polling intervals to balance speed with API usage.

  1. 1Click the toggle switch in the top right to 'Active'
  2. 2Click the settings gear next to the toggle
  3. 3Set polling interval to 5 minutes for regular processing
  4. 4Configure timezone to match your business hours
  5. 5Save the workflow with a descriptive name
What you should see: The workflow status shows 'Active' with a green indicator and displays the next scheduled execution time.
Common mistake — Don't set polling under 2 minutes - Gmail's API has rate limits and you'll hit quota restrictions quickly.

Drop this into an n8n Code node.

JavaScript — Code Node// Enhanced phone extraction with international support
▸ Show code
// Enhanced phone extraction with international support
const phoneRegex = /(?:\+?[1-9]\d{0,3}[-. ]?)?(?:\([0-9]{1,4}\)|[0-9]{1,4})[-. ]?[0-9]{1,4}[-. ]?[0-9]{1,9}/g;
const phones = $json.body.match(phoneRegex);

... expand to see full code

// Enhanced phone extraction with international support
const phoneRegex = /(?:\+?[1-9]\d{0,3}[-. ]?)?(?:\([0-9]{1,4}\)|[0-9]{1,4})[-. ]?[0-9]{1,4}[-. ]?[0-9]{1,9}/g;
const phones = $json.body.match(phoneRegex);
const cleanPhone = phones ? phones[0].replace(/[^0-9+]/g, '') : null;
return {phone: cleanPhone};

Scaling Beyond 500+ emails/day+ Records

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

1

Batch Processing

Switch from real-time polling to scheduled batch runs every 30 minutes. This reduces API calls and handles Gmail pagination better when processing large email volumes.

2

Selective Processing

Add Gmail label filters to only process emails from external domains. Internal company emails rarely have useful signature data and waste processing operations.

3

Caching Layer

Store processed email IDs in a Google Sheet or database to prevent duplicate processing. Gmail doesn't track read status for API access.

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're processing 100+ emails daily with signatures and need custom extraction logic. The regex flexibility beats Zapier's basic text parsing, and you can modify patterns without rebuilding workflows. Skip N8n if you only handle 20-30 emails monthly - Zapier's simplicity wins for low volume.

Cost

This workflow uses 4 operations per email: Gmail fetch, 3 extraction steps, and HubSpot update. At 200 emails/month, that's 1,000 operations monthly. N8n's starter plan at $20/month covers 5,000 operations easily. Make charges $9/month for 1,000 operations but limits regex complexity. Zapier needs the $20 plan for custom code, making N8n cost-neutral with better parsing control.

Tradeoffs

Zapier's formatter handles basic signature parsing without code, which non-technical users prefer. Make's visual regex builder helps debug pattern matching faster than N8n's code nodes. But N8n wins on signature parsing because most email signatures need complex regex - job titles vary wildly, company formats differ, and international phone numbers break simple patterns. The JavaScript flexibility handles edge cases that kill other platforms.

HubSpot's contact matching gets flaky when Gmail includes display names in the 'from' field - you'll need email cleaning logic that other tutorials skip. Gmail's API pagination hits at 250 emails, so high-volume workflows need batch processing. Phone number extraction fails on VoIP numbers and international formats unless you expand the regex patterns. Most signature parsing breaks on mobile-formatted emails where line breaks disappear.

Ideas for what to build next

  • Add Mobile Number DetectionEnhance phone extraction to differentiate between office and mobile numbers, storing each in separate HubSpot properties for better sales targeting.
  • Signature Confidence ScoringBuild logic to score extraction confidence based on signature formatting and flag low-confidence updates for manual review.
  • LinkedIn Profile ExtractionExtend parsing to capture LinkedIn URLs from signatures and automatically enrich HubSpot contacts with social media data.

Related guides

Was this guide helpful?
HubSpot + Gmail overviewn8n profile →