Shopify to HubSpot, deals and contacts stay clean
Your HubSpot portal should be a clean source of truth. But once Shopify orders start coming in, things get messy fast: duplicate contacts, deals created twice, and “mystery amounts” that don’t match what Finance sees.
This Shopify HubSpot sync hits marketing ops hardest because reporting becomes guesswork. Sales managers feel it when reps chase the wrong deal record. And store owners end up doing weekend cleanup in the CRM instead of running the business.
This n8n workflow keeps your HubSpot contacts and deals accurate by updating the right record at the right time, automatically. You’ll see what it does, what you need, and where teams usually trip up.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Shopify to HubSpot, deals and contacts stay clean
flowchart LR
subgraph sg0["On order updated Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/shopify.svg' width='40' height='40' /></div><br/>On order updated"]
n1@{ icon: "mdi:swap-vertical", form: "rounded", label: "Keep only userId", pos: "b", h: 48 }
n2@{ icon: "mdi:swap-horizontal", form: "rounded", label: "New Order, deal not found", pos: "b", h: 48 }
n3@{ icon: "mdi:cog", form: "rounded", label: "Do Nothing", pos: "b", h: 48 }
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/hubspot.svg' width='40' height='40' /></div><br/>Create new deal"]
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/hubspot.svg' width='40' height='40' /></div><br/>Find if order already exists.."]
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>Add Hubspot userId to data"]
n7["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/hubspot.svg' width='40' height='40' /></div><br/>Create or update contact"]
n1 --> n6
n0 --> n6
n0 --> n7
n7 --> n1
n2 --> n4
n2 --> n3
n6 --> n5
n5 --> n2
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n2 decision
classDef customIcon fill:none,stroke:none
class n0,n4,n5,n6,n7 customIcon
The Problem: HubSpot Gets Messy When Shopify Orders Scale
Shopify is great at collecting orders. HubSpot is great at tracking relationships and revenue. The problem is the handoff. If your team manually creates deals, updates close dates, and tries to match each paid order to the correct person, it’s only a matter of time before your pipeline stops reflecting reality. Someone forgets to update the amount. Someone creates a second contact because the email address was spelled differently. Then reports drift, sales forecasting turns into debates, and you burn hours doing “CRM hygiene” instead of improving the customer journey.
It adds up fast. Here’s where it breaks down in real teams.
- Contacts get duplicated when the same buyer checks out with a different email or the CRM record wasn’t found quickly enough.
- Deals get created for orders that already exist, so revenue looks inflated until someone catches it.
- Paid order data lands late (or not at all), which means close dates and amounts are wrong when leadership asks for a pipeline snapshot.
- Reps and marketers stop trusting HubSpot, so they export to spreadsheets and the mess spreads.
The Solution: Sync Paid Shopify Orders Into Clean HubSpot Records
This workflow watches for Shopify order updates and uses that event to keep HubSpot in sync. When an order is updated (typically when it’s paid or confirmed), n8n pushes the buyer into HubSpot as a contact, creating the record if it doesn’t exist and updating it if it does. After the contact is handled, the workflow isolates the user identifier, merges it with the order data, and searches HubSpot to see if a deal already exists for that order. If HubSpot has no matching deal, it creates a new one with the right amount and a close date tied to the order. If the deal is already there, it does nothing, so you don’t end up with duplicates.
The workflow starts with a Shopify trigger, then an upsert into HubSpot for the contact. Next, it merges order + user context, searches for an existing deal, and conditionally creates a new deal only when it’s missing. Clean inputs, clean CRM.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you get 20 paid orders in a day. Manually, a simple “create/update contact + create/check deal” routine can take about 10 minutes per order once you include searching for duplicates and correcting amounts, so you’re staring at about 3 hours of admin work. With this workflow, the “work” is basically zero: Shopify triggers it automatically, HubSpot is updated in the background, and you only spot-check exceptions. Most teams get those 3 hours back the same day.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Shopify for the order update trigger.
- HubSpot to upsert contacts and manage deals.
- Shopify + HubSpot credentials (create private app tokens in each platform).
Skill level: Beginner. You’ll mainly connect accounts and map a few key fields like buyer ID, order total, and close date.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A Shopify order update kicks it off. When an order changes status in Shopify, n8n grabs the order payload so you can react immediately when money actually comes in.
The buyer is created or updated in HubSpot. The workflow upserts a contact so the same person stays the same person, even if they place multiple orders over time.
Order context is merged with the HubSpot user key. n8n isolates the user identifier and merges it back with the order details, which keeps later deal lookups consistent.
Deals are checked before they are created. HubSpot is searched for an existing deal related to the order; if it’s missing, a new deal is generated with the amount and a close date based on the order update. If it’s already there, the workflow takes a “no action” path.
You can easily modify deal naming and close date rules to match your pipeline stages. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Shopify Trigger
Set up the workflow to start when a Shopify order is updated.
- Add the Order Update Trigger node.
- Set Topic to
orders/updated. - Credential Required: Connect your shopifyApi credentials.
Step 2: Connect HubSpot and Create/Update the Contact
Send the Shopify customer data into HubSpot as a contact record.
- Add the Upsert Contact Record node and connect it to Order Update Trigger.
- Set Resource to
contactand Authentication tooAuth2. - Set Email to
{{ $json["contact_email"] }}. - In Additional Fields, set City to
{{ $json["customer"]["default_address"]["city"] }}, Country to{{ $json["customer"]["default_address"]["country"] }}, Last Name to{{ $json["customer"]["default_address"]["last_name"] }}, and First Name to{{ $json["customer"]["default_address"]["first_name"] }}. - Credential Required: Connect your hubspotOAuth2Api credentials.
Order Update Trigger outputs to both Merge HubSpot User Key and Upsert Contact Record in parallel.
Step 3: Set Up Identifier Processing and Merge
Extract the HubSpot user identifier and merge it with the Shopify order data for downstream use.
- Add the Isolate User Identifier node and connect it to Upsert Contact Record.
- In Isolate User Identifier, set Keep Only Set to
true. - Set Values → Number → Name to
userIdand Value to{{ $json["vid"] }}. - Add the Merge HubSpot User Key node and set Mode to
mergeByIndex. - Connect Order Update Trigger to Merge HubSpot User Key (Input 1) and Isolate User Identifier to Merge HubSpot User Key (Input 2).
Step 4: Configure Deal Lookup and Conditional Creation
Search for an existing HubSpot deal and create a new one only if it’s missing.
- Add the Search Existing Deal node and connect it to Merge HubSpot User Key.
- Set Operation to
searchand Authentication tooAuth2. - Set Additional Fields → Query to
{{ $json["name"] }}. - Credential Required: Connect your hubspotOAuth2Api credentials.
- Add the Deal Missing Check node and connect it to Search Existing Deal.
- In Deal Missing Check, set the string condition to Value 1
{{$json}}and Operation toisEmpty. - Add the Generate New Deal node and connect it to the true output of Deal Missing Check.
- In Generate New Deal, set Stage to
closedwonand Authentication tooAuth2. - Set Additional Fields → Amount to
{{ $node["Merge HubSpot User Key"].json["current_total_price"] }}, Deal Name to{{ $node["Merge HubSpot User Key"].json["name"] }}, Close Date to{{ $node["Merge HubSpot User Key"].json["created_at"] }}, and Associated Vids to{{ $node["Merge HubSpot User Key"].json["userId"] }}. - Credential Required: Connect your hubspotOAuth2Api credentials.
- Connect the false output of Deal Missing Check to No Action Step as the do-nothing branch.
⚠️ Common Pitfall: If Search Existing Deal is not returning any results, verify that the Query field matches the exact deal name format used in HubSpot.
Step 5: Test and Activate Your Workflow
Run a test update from Shopify and validate the HubSpot results before enabling the workflow.
- Click Execute Workflow and trigger a Shopify order update to generate a sample payload.
- Confirm that Upsert Contact Record creates or updates the contact in HubSpot.
- Verify that Search Existing Deal returns a deal or that Generate New Deal creates one when none exists.
- Check that the No Action Step branch runs when a deal already exists.
- Once validation is complete, switch the workflow to Active for production use.
Common Gotchas
- HubSpot credentials can expire or lack scopes for deals. If things break, check your HubSpot private app permissions and the connection status in n8n first.
- Shopify order updates can fire more than once for the same order as statuses change. If you see unexpected behavior, confirm your deal lookup key truly matches a single order in HubSpot.
- The default contact/deal field mapping is rarely “your” mapping. Add your lifecycle stage, pipeline, and deal naming rules early or you’ll spend months cleaning it up later.
Frequently Asked Questions
About 30 minutes if your Shopify and HubSpot credentials are ready.
No. You’ll connect Shopify and HubSpot, then map a handful of fields.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Shopify and HubSpot plan limits (and API limits) if you process lots of orders.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and you should. Update the deal creation step (the “Generate New Deal” HubSpot node) to set your pipeline, stage, and deal name format. Common tweaks include using the Shopify order number in the deal name, setting the close date to the paid date, and writing the product or SKU into a custom property for reporting.
Usually it’s expired credentials or missing permissions on the HubSpot private app. Regenerate the token, update it in n8n, and confirm it has access to both contacts and deals. If it fails only during spikes, you may be hitting API limits, so slow down executions or reduce the number of lookups per order.
A lot, as long as your HubSpot API limits and n8n plan match your volume. On n8n Cloud Starter, you’re capped by monthly executions, so high-order stores may need a higher tier. If you self-host, there’s no execution limit (it depends on your server), and this workflow is lightweight enough that most VPS setups can handle steady daily traffic without drama.
Often, yes, because the “check first, then create” logic is where simpler automations get sloppy. n8n makes it straightforward to search for an existing deal, branch based on what you find, and stop the run cleanly when there’s nothing to do. You also get the option to self-host, which can matter once you’re processing lots of order events. Zapier or Make can still be fine for basic two-step syncing, but teams usually outgrow those flows when duplicates start showing up. Talk to an automation expert if you want a quick recommendation based on your volume.
Once this is running, HubSpot stops feeling like a second job. Your contacts stay clean, your deals reflect real orders, and you can finally trust the numbers again.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.