n8n Shopify to HubSpot kit

Architecture

What is inside each JSON file: the shared webhook front, the nodes of every workflow, the HTTP calls they make, the HubSpot properties they rely on, and the decisions behind them.

The shared front of workflows 01, 02, 03 and 03b

Shopify signs the raw body of each webhook with HMAC-SHA256 and sends the base64 result in the X-Shopify-Hmac-Sha256 header. The four webhook workflows start with the same four nodes and then split:

Webhook (POST, Raw Body on)
  -> Crypto: HMAC SHA256 over binary property "data", base64 -> calculatedHmac
  -> IF, all of:
       calculatedHmac == header x-shopify-hmac-sha256
       header x-shopify-shop-domain == YOUR_SHOP.myshopify.com
       header x-shopify-topic: "customers/..." (01) or "orders/paid" (02, 03, 03b)
        true  -> Respond to Webhook 200 (no body) -> business nodes
        false -> Respond to Webhook 401 ("Signature invalide"), end

Decisions, with their cost

D1. Generic Webhook + Crypto, not the Shopify Trigger node
In the n8n 2.46.6 source, ShopifyTrigger.node.ts answers immediately and ignores a badly signed request (it returns an empty object) instead of rejecting it. It passes on only the body, so the headers, including X-Shopify-Webhook-Id, are lost. GenericFunctions.ts pins the REST Admin API at 2024-07. Cost: you create the Shopify webhooks yourself and keep three header comparisons up to date.
D2. HTTP Request on date-versioned HubSpot endpoints, not the HubSpot node
The HubSpot node of n8n 2.46.6 (HubspotV2.node.ts) still calls /contacts/v1/, /deals/v1/, /companies/v2/ and /crm/v3/ paths. HubSpot’s changelog marks the v1 to v3 API families as unsupported, with migration due before September 2027. The workflows call /crm/objects/2026-09/.... Cost: request bodies are built by hand in expressions.
D3. Upsert on a key, no search before write
Asking HubSpot “does it exist?” and then creating leaves a window: two close deliveries both get “no”. Contacts are upserted on email, deals on the unique property shopify_order_id. Cost: unique-value properties must be created as such (workflow 00), because the setting cannot be changed afterwards.
D4. Respond first, work after
Shopify waits five seconds in total and retries eight times over four hours. The workflows answer 200 as soon as the signature checks out. Cost: once the 200 is sent, Shopify considers the delivery done. If HubSpot then fails, Shopify will not retry; workflow 04 tells you, and replaying is up to you.
D5. Errors that are not HTTP errors are turned into errors
A HubSpot batch can answer 207 with numErrors above zero, and a Shopify GraphQL call can answer 200 with an errors array. Both are 2xx, so n8n would call the node a success. An IF node tests for them and a Stop and Error node fails the run.
D6. A new Shopify token on every run (workflow 03)
Tokens from the client credentials grant expire after about 24 hours. That grant is open only to an app built by your own organization and installed on a store you own (see the requirements). Storing one without a Code node means adding a data store and expiry logic, so workflow 03 requests a token on every execution. Cost: one extra call per paid order, and the token appears in kept failed executions. Workflow 03b takes a fixed token from a Header Auth credential for older apps.
D7. In workflow 02, the deal does not depend on the contact
The contact upsert has onError: continueRegularOutput and no retry. The deal upsert runs anyway. The association is attempted only if the contact call returned an id; otherwise the run stops with “deal created but not associated”. Cost: a 429 on the contact call is not retried either; you associate by hand.
D8. Successful executions are not kept
The workflows set saveDataSuccessExecution: none and saveDataErrorExecution: all. Failed runs keep the webhook body, so they contain customer data. See the retention variables on the setup page.

Nodes of each workflow

Names are given as stored in the file, then in English. HubSpot calls its sales records “deals”; the French node names say “transaction”, which is the label of the French HubSpot interface.

00 — Create the HubSpot properties

Manual trigger -> HubSpot: create contact properties -> HubSpot: create deal properties
#Node (name in the file / English)TypeWhat it does
1Lancer à la main
Run manually
Manual Trigger v1run once from the editor
2HubSpot : créer les propriétés de contact
HubSpot: create contact properties
HTTP Request v4.2POST api.hubapi.com/crm/properties/2026-09/contacts/batch/create; HubSpot App Token credential; retry on fail: 3 tries, 2000 ms apart; on error: continueRegularOutput
3HubSpot : créer les propriétés de transaction
HubSpot: create deal properties
HTTP Request v4.2POST api.hubapi.com/crm/properties/2026-09/deals/batch/create; HubSpot App Token credential; retry on fail: 3 tries, 2000 ms apart; on error: continueRegularOutput

01 — Customer to contact

Webhook -> HMAC -> Valid? --yes-> Respond 200 -> Email present? --yes-> Prepare contact -> HubSpot upsert -> Errors? --yes-> Stop and Error
                      \-no--> Respond 401                 \-no--> Ignored
#Node (name in the file / English)TypeWhat it does
1Webhook Shopify : client créé ou modifié
Webhook: customer created or updated
Webhook v2.1POST /webhook/shopify-client; Raw Body on; answers through Respond to Webhook
2Calculer la signature HMAC
Compute HMAC signature
Crypto v2HMAC, SHA256, base64, binary property data into calculatedHmac; secret from a Crypto credential
3Signature et boutique valides ?
Valid signature and shop?
IF v2.2all true: $json.calculatedHmac == $json.headers['x-shopify-hmac-sha256'] & $json.headers['x-shopify-shop-domain'] == 'YOUR_SHOP.myshopify.com' & $json.headers['x-shopify-topic'] starts with 'customers/'
4Répondre 200 à Shopify
Respond 200 to Shopify
Respond to Webhook v1.4HTTP 200, no body
5Répondre 401
Respond 401
Respond to Webhook v1.4HTTP 401, body Signature invalide
6E-mail présent ?
Email present?
IF v2.2all true: $json.body.email is not empty
7Ignoré : client sans e-mail
Ignored: customer without email
No Operation v1end of branch
8Préparer le contact
Prepare contact
Edit Fields (Set) v3.4sets email, properties
9HubSpot : créer ou mettre à jour le contact
HubSpot: upsert contact
HTTP Request v4.2POST api.hubapi.com/crm/objects/2026-09/contacts/batch/upsert; HubSpot App Token credential; retry on fail: 3 tries, 2000 ms apart
10HubSpot a-t-il signalé des erreurs ?
Did HubSpot report errors?
IF v2.2all true: ($json.numErrors ?? 0) > 0
11Arrêt : erreur renvoyée par HubSpot
Stop: error returned by HubSpot
Stop and Error v1fails the execution with a message (triggers the error workflow)

02 — Paid order to deal

Webhook -> HMAC -> Valid? --yes-> Respond 200 -> Usable order? --yes-> Deal settings -> Prepare
                      \-no--> Respond 401                  \-no--> Ignored
Prepare -> Upsert contact -> Upsert deal -> Deal error? --yes-> Stop and Error
                                           \-no--> Contact id available? --yes-> Associate deal with contact
                                                                        \-no--> Stop and Error (not associated)
#Node (name in the file / English)TypeWhat it does
1Webhook Shopify : commande payée
Webhook: order paid
Webhook v2.1POST /webhook/shopify-commande-payee; Raw Body on; answers through Respond to Webhook
2Calculer la signature HMAC
Compute HMAC signature
Crypto v2HMAC, SHA256, base64, binary property data into calculatedHmac; secret from a Crypto credential
3Signature et boutique valides ?
Valid signature and shop?
IF v2.2all true: $json.calculatedHmac == $json.headers['x-shopify-hmac-sha256'] & $json.headers['x-shopify-shop-domain'] == 'YOUR_SHOP.myshopify.com' & $json.headers['x-shopify-topic'] == 'orders/paid'
4Répondre 200 à Shopify
Respond 200 to Shopify
Respond to Webhook v1.4HTTP 200, no body
5Répondre 401
Respond 401
Respond to Webhook v1.4HTTP 401, body Signature invalide
6Commande exploitable ?
Usable order?
IF v2.2all true: String($json.body.test) != 'true' & $json.body.email || $json.body.contact_email || $json.body.customer?.email || '' is not empty
7Ignorée : commande de test ou sans e-mail
Ignored: test order or no email
No Operation v1end of branch
8Réglages de la transaction
Deal settings
Edit Fields (Set) v3.4sets hubspot_pipeline, hubspot_dealstage; keeps other fields
9Préparer contact et transaction
Prepare contact and deal
Edit Fields (Set) v3.4sets email, orderId, contactProperties, dealProperties; keeps other fields
10HubSpot : créer ou mettre à jour le contact
HubSpot: upsert contact
HTTP Request v4.2POST api.hubapi.com/crm/objects/2026-09/contacts/batch/upsert; HubSpot App Token credential; on error: continueRegularOutput
11HubSpot : créer ou mettre à jour la transaction
HubSpot: upsert deal
HTTP Request v4.2POST api.hubapi.com/crm/objects/2026-09/0-3/batch/upsert; HubSpot App Token credential; retry on fail: 3 tries, 2000 ms apart
12Erreur HubSpot sur la transaction ?
HubSpot error on the deal?
IF v2.2all true: ($json.numErrors ?? 0) > 0
13Contact disponible pour l'association ?
Contact available for association?
IF v2.2all true: $('HubSpot : créer ou mettre à jour le contact').item.json.results?.[0]?.id ?? '' is not empty
14HubSpot : associer la transaction au contact
HubSpot: associate deal with contact
HTTP Request v4.2PUT api.hubapi.com/crm/objects/2026-09/deal/{id}/associations/default/contact/{id}; HubSpot App Token credential; retry on fail: 3 tries, 2000 ms apart
15Arrêt : erreur renvoyée par HubSpot
Stop: error returned by HubSpot
Stop and Error v1fails the execution with a message (triggers the error workflow)
16Arrêt : transaction créée mais non associée
Stop: deal created but not associated
Stop and Error v1fails the execution with a message (triggers the error workflow)

03 — Customer segmentation (token on every run)

Webhook -> HMAC -> Valid? --yes-> Respond 200 -> Linked to a customer? --yes-> Settings -> Get token -> GraphQL read
                      \-no--> Respond 401                         \-no--> Ignored
GraphQL read -> Customer found? --yes-> Prepare properties -> HubSpot update -> Errors? --yes-> Stop and Error
                               \-no--> Stop and Error

The GraphQL query reads customer(id) with numberOfOrders, amountSpent, lastOrder and defaultEmailAddress. It does not use Customer.email or Customer.emailMarketingConsent, which Shopify’s documentation marks as deprecated. Values are re-read from Shopify on every event, never incremented, so a replay changes nothing.

#Node (name in the file / English)TypeWhat it does
1Webhook Shopify : commande payée (segmentation)
Webhook: order paid (segmentation)
Webhook v2.1POST /webhook/shopify-segmentation; Raw Body on; answers through Respond to Webhook
2Calculer la signature HMAC
Compute HMAC signature
Crypto v2HMAC, SHA256, base64, binary property data into calculatedHmac; secret from a Crypto credential
3Signature et boutique valides ?
Valid signature and shop?
IF v2.2all true: $json.calculatedHmac == $json.headers['x-shopify-hmac-sha256'] & $json.headers['x-shopify-shop-domain'] == 'YOUR_SHOP.myshopify.com' & $json.headers['x-shopify-topic'] == 'orders/paid'
4Répondre 200 à Shopify
Respond 200 to Shopify
Respond to Webhook v1.4HTTP 200, no body
5Répondre 401
Respond 401
Respond to Webhook v1.4HTTP 401, body Signature invalide
6Commande rattachée à un client ?
Order linked to a customer?
IF v2.2all true: String($json.body.test) != 'true' & String($json.body.customer?.id ?? '') is not empty
7Ignorée : commande de test ou sans client
Ignored: test order or no customer
No Operation v1end of branch
8Réglages de segmentation
Segmentation settings
Edit Fields (Set) v3.4sets seuil_recurrent, seuil_fidele; keeps other fields
9Shopify : obtenir un jeton (client credentials)
Shopify: get a token (client credentials)
HTTP Request v4.2POST YOUR_SHOP.myshopify.com/admin/oauth/access_token; credential type httpCustomAuth; retry on fail: 3 tries, 2000 ms apart
10Shopify GraphQL : lire le client
Shopify GraphQL: read the customer
HTTP Request v4.2POST YOUR_SHOP.myshopify.com/admin/api/2026-10/graphql.json; retry on fail: 3 tries, 2000 ms apart
11Client trouvé dans la réponse ?
Customer found in the response?
IF v2.2all true: $json.data?.customer?.id ?? '' is not empty
12Arrêt : client introuvable ou accès refusé
Stop: customer not found or access denied
Stop and Error v1fails the execution with a message (triggers the error workflow)
13Préparer les propriétés de segmentation
Prepare segmentation properties
Edit Fields (Set) v3.4sets email, properties
14HubSpot : mettre à jour le contact
HubSpot: update contact
HTTP Request v4.2POST api.hubapi.com/crm/objects/2026-09/contacts/batch/upsert; HubSpot App Token credential; retry on fail: 3 tries, 2000 ms apart
15HubSpot a-t-il signalé des erreurs ?
Did HubSpot report errors?
IF v2.2all true: ($json.numErrors ?? 0) > 0
16Arrêt : erreur renvoyée par HubSpot
Stop: error returned by HubSpot
Stop and Error v1fails the execution with a message (triggers the error workflow)

03b — Same, with a fixed token

Identical to 03 without the “get a token” node. The GraphQL node authenticates with a Header Auth credential carrying X-Shopify-Access-Token.

#Node (name in the file / English)TypeWhat it does
1Webhook Shopify : commande payée (segmentation)
Webhook: order paid (segmentation)
Webhook v2.1POST /webhook/shopify-segmentation; Raw Body on; answers through Respond to Webhook
2Calculer la signature HMAC
Compute HMAC signature
Crypto v2HMAC, SHA256, base64, binary property data into calculatedHmac; secret from a Crypto credential
3Signature et boutique valides ?
Valid signature and shop?
IF v2.2all true: $json.calculatedHmac == $json.headers['x-shopify-hmac-sha256'] & $json.headers['x-shopify-shop-domain'] == 'YOUR_SHOP.myshopify.com' & $json.headers['x-shopify-topic'] == 'orders/paid'
4Répondre 200 à Shopify
Respond 200 to Shopify
Respond to Webhook v1.4HTTP 200, no body
5Répondre 401
Respond 401
Respond to Webhook v1.4HTTP 401, body Signature invalide
6Commande rattachée à un client ?
Order linked to a customer?
IF v2.2all true: String($json.body.test) != 'true' & String($json.body.customer?.id ?? '') is not empty
7Ignorée : commande de test ou sans client
Ignored: test order or no customer
No Operation v1end of branch
8Réglages de segmentation
Segmentation settings
Edit Fields (Set) v3.4sets seuil_recurrent, seuil_fidele; keeps other fields
9Shopify GraphQL : lire le client
Shopify GraphQL: read the customer
HTTP Request v4.2POST YOUR_SHOP.myshopify.com/admin/api/2026-10/graphql.json; credential type httpHeaderAuth; retry on fail: 3 tries, 2000 ms apart
10Client trouvé dans la réponse ?
Customer found in the response?
IF v2.2all true: $json.data?.customer?.id ?? '' is not empty
11Arrêt : client introuvable ou accès refusé
Stop: customer not found or access denied
Stop and Error v1fails the execution with a message (triggers the error workflow)
12Préparer les propriétés de segmentation
Prepare segmentation properties
Edit Fields (Set) v3.4sets email, properties
13HubSpot : mettre à jour le contact
HubSpot: update contact
HTTP Request v4.2POST api.hubapi.com/crm/objects/2026-09/contacts/batch/upsert; HubSpot App Token credential; retry on fail: 3 tries, 2000 ms apart
14HubSpot a-t-il signalé des erreurs ?
Did HubSpot report errors?
IF v2.2all true: ($json.numErrors ?? 0) > 0
15Arrêt : erreur renvoyée par HubSpot
Stop: error returned by HubSpot
Stop and Error v1fails the execution with a message (triggers the error workflow)

04 — Failure alert

Error Trigger -> Send Email (SMTP)
#Node (name in the file / English)TypeWhat it does
1Erreur dans un workflow
Error in a workflow
Error Trigger v1receives the failed workflow name, node, message and execution URL
2Envoyer l'alerte par e-mail
Send the alert email
Send Email v2.1SMTP credential; appendAttribution off

HTTP calls

WFNodeMethodURL (host and path)RetryOn error
00HubSpot: create contact propertiesPOSTapi.hubapi.com/crm/properties/2026-09/contacts/batch/create3x / 2000 mscontinue
00HubSpot: create deal propertiesPOSTapi.hubapi.com/crm/properties/2026-09/deals/batch/create3x / 2000 mscontinue
01HubSpot: upsert contactPOSTapi.hubapi.com/crm/objects/2026-09/contacts/batch/upsert3x / 2000 msstop
02HubSpot: upsert contactPOSTapi.hubapi.com/crm/objects/2026-09/contacts/batch/upsertnonecontinue
02HubSpot: upsert dealPOSTapi.hubapi.com/crm/objects/2026-09/0-3/batch/upsert3x / 2000 msstop
02HubSpot: associate deal with contactPUTapi.hubapi.com/crm/objects/2026-09/deal/{id}/associations/default/contact/{id}3x / 2000 msstop
03Shopify: get a token (client credentials)POSTYOUR_SHOP.myshopify.com/admin/oauth/access_token3x / 2000 msstop
03Shopify GraphQL: read the customerPOSTYOUR_SHOP.myshopify.com/admin/api/2026-10/graphql.json3x / 2000 msstop
03HubSpot: update contactPOSTapi.hubapi.com/crm/objects/2026-09/contacts/batch/upsert3x / 2000 msstop
03bShopify GraphQL: read the customerPOSTYOUR_SHOP.myshopify.com/admin/api/2026-10/graphql.json3x / 2000 msstop
03bHubSpot: update contactPOSTapi.hubapi.com/crm/objects/2026-09/contacts/batch/upsert3x / 2000 msstop

All nodes with retry use the same setting. Credentials are never stored in the node: HubSpot calls use a HubSpot App Token credential (a service key goes in that field), the Shopify token call uses a Custom Auth credential.

HubSpot properties created by workflow 00

NameObjectTypeUniqueGroup
shopify_customer_idcontactstring/textyescontactinformation
shopify_orders_countcontactnumbercontactinformation
shopify_total_spentcontactnumbercontactinformation
shopify_last_order_datecontactdatetime/datecontactinformation
shopify_segmentcontactenumeration/selectcontactinformation
shopify_email_marketing_statecontactstring/textcontactinformation
shopify_order_iddealstring/textyesdealinformation
shopify_order_namedealstring/textdealinformation

The two unique properties count against HubSpot’s cap of ten unique-value properties per object. shopify_segment takes the internal values nouveau, recurrent and fidele.

What happens when something fails

EventResultWho finds out
Wrong signature, wrong shop domain (including an unreplaced placeholder) or wrong topicHTTP 401, nothing else runs. The run itself ends normally.Nobody by email. Shopify sees the 401.
HubSpot answers 207 with errorsStop and Error after the upsert.Workflow 04 email.
HubSpot answers 4xx or 5xx on a node with retryThree tries, two seconds apart, then the run fails.Workflow 04 email.
HubSpot rejects the contact in workflow 02Deal still upserted, association skipped, run stops with “deal created but not associated”.Workflow 04 email.
Shopify GraphQL answers 200 with errors (workflow 03)“Customer found?” is false, run stops with Shopify’s message.Workflow 04 email.
n8n unreachable, or the workflow not publishedShopify gets an error or no answer, retries, and can delete a webhook created in the admin after repeated failures.Nobody. No run exists, so no alert.

The last row is the case an error workflow cannot cover. It is the reason to look at your webhook list now and then, and to keep a periodic catch-up on flows that matter: why a webhook still needs a daily catch-up (in French).