n8n Shopify to HubSpot kit

Setup reference

Everything you have to change or provide before the first run: instance requirements, credentials, placeholders, values you may tune, and the Shopify webhooks.

Requirements

Credentials

The files hold no secret. Each node references a credential by name and type. Create them before importing, with exactly these names and types: on import, n8n links each node to the credential of the same name and type. If you imported first, select the credential in every node, or delete the imported copies and import again, before publishing; otherwise every request, signed or not, gets a 400.

Namen8n typeContentUsed by
HubSpot - Service KeyHubSpot App TokenThe service key, in the App Token field00, 01, 02, 03, 03b
Shopify - secret de signature des webhooksCryptoHmac Secret: the secret that signs your Shopify webhooks01, 02, 03, 03b
Shopify - client credentials (Custom Auth)Custom AuthJSON below03
Shopify - jeton Admin API (X-Shopify-Access-Token)Header AuthName X-Shopify-Access-Token, value = the token03b
SMTP - alertesSMTPYour mail server04

HubSpot scopes for the service key: crm.objects.contacts.write and crm.objects.deals.write. Add crm.schemas.contacts.write and crm.schemas.deals.write for workflow 00 only, and remove them afterwards.

Custom Auth content for workflow 03 (placeholders to replace):

{
  "headers": { "Content-Type": "application/x-www-form-urlencoded" },
  "body": {
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "grant_type": "client_credentials"
  }
}

The header is needed: in n8n 2.46.6, a Custom Auth credential with only a body, or combined with the HTTP Request node’s form body option, sends JSON, while Shopify documents this call as application/x-www-form-urlencoded. The bytes sent were checked on the wire against a local server.

Import

With the five credentials already created. Editor: workflow menu > Import from File (the menu also offers Import from URL; it was not tested with raw GitHub URLs). CLI on a self-hosted instance:

n8n import:workflow --input=workflows/01-client-shopify-vers-contact-hubspot.json

With Docker, copy the files into the container and run the CLI as the node user (the syntax in n8n’s CLI documentation):

docker cp workflows <container>:/tmp/kit-workflows
docker exec -u node <container> n8n import:workflow --input=/tmp/kit-workflows/01-client-shopify-vers-contact-hubspot.json

By default the CLI deactivates every imported workflow. Nothing runs until you publish. Import 03 or 03b, not both: they share the webhook path shopify-segmentation.

Placeholders to replace

WorkflowNodeValue in the fileReplace with
01Valid signature and shop?YOUR_SHOP.myshopify.comthe shop’s *.myshopify.com domain, exactly as Shopify sends it in X-Shopify-Shop-Domain
02Valid signature and shop?YOUR_SHOP.myshopify.comthe shop’s *.myshopify.com domain, exactly as Shopify sends it in X-Shopify-Shop-Domain
03Valid signature and shop?YOUR_SHOP.myshopify.comthe shop’s *.myshopify.com domain, exactly as Shopify sends it in X-Shopify-Shop-Domain
03Shopify: get a token (client credentials)https://YOUR_SHOP.myshopify.com/admin/oauth/access_tokenyour shop domain (YOUR_SHOP part only)
03Shopify GraphQL: read the customerhttps://YOUR_SHOP.myshopify.com/admin/api/2026-10/graphql.jsonyour shop domain (YOUR_SHOP part only)
03bValid signature and shop?YOUR_SHOP.myshopify.comthe shop’s *.myshopify.com domain, exactly as Shopify sends it in X-Shopify-Shop-Domain
03bShopify GraphQL: read the customerhttps://YOUR_SHOP.myshopify.com/admin/api/2026-10/graphql.jsonyour shop domain (YOUR_SHOP part only)
04Send the alert emailalertes@YOUR_DOMAIN.tldsender address accepted by your SMTP server
04Send the alert emailvous@YOUR_DOMAIN.tldthe mailbox that receives the alerts

Search the JSON before importing if you prefer: grep -n "YOUR_" workflows/*.json.

Values you may change

WhereFieldDefaultNotes
02 > Deal settingshubspot_pipelinedefaultInternal ID of the pipeline, not its label.
02 > Deal settingshubspot_dealstageclosedwonInternal ID of the stage. closedwon is the ID of “Closed Won” in the default pipeline according to a HubSpot community thread; the API reference does not say so. Check yours.
03, 03b > Segmentation settingsseuil_recurrent2Orders needed for the recurrent segment.
03, 03b > Segmentation settingsseuil_fidele4Orders needed for the fidele segment. Example values, not advice.
00 > both HTTP nodesgroupNamecontactinformation, dealinformationChange if the properties belong in another group.

Shopify webhooks

Store admin > Settings > Notifications > Webhooks > Create webhook (labels may vary). Format JSON, API version 2026-10, and the production URL (/webhook/..., not /webhook-test/...).

WorkflowShopify eventURL
01Customer creation and customer update (two webhooks, same URL)https://YOUR-N8N/webhook/shopify-client
02Order payment (orders/paid)https://YOUR-N8N/webhook/shopify-commande-payee
03 or 03bOrder payment (orders/paid)https://YOUR-N8N/webhook/shopify-segmentation

The signing secret goes into the Crypto credential. For a webhook declared by an app it is that app’s client secret. For a webhook created in the admin, the admin shows the store’s signing key on the webhooks page; the exact location was not confirmed from Shopify’s own documentation, so check it on your screen.

A webhook that fails too often can be deleted. Shopify’s help center says a webhook created in the admin is removed when its address keeps answering something other than 200, and that Shopify sends its failure email only for webhooks created by an app. An unreplaced placeholder, a mistyped secret or an unpublished workflow all produce 401 or 404. Replace the placeholders and publish before creating the webhook, use Send test, and look at the webhook list again after 24 hours.

Order of operations

  1. Create the five credentials with the exact names and types from the table above.
  2. Import the workflows.
  3. Replace the placeholders in each node (or in the JSON before importing; the result is the same).
  4. Run workflow 00 once from the editor. Publishing it is not needed.
  5. Publish 04 first. n8n 2.x runs the published version; an Error workflow that is not published does not run (observed in 2.46.6).
  6. In 01, 02 and 03 (or 03b): workflow settings > Error workflow > the 04 workflow. Then publish them. Any later change only takes effect after publishing again.
  7. Create the Shopify webhooks on the production URLs. Use Send test.
  8. Replay with the script on the testing page before relying on any of it.

Instance variables worth setting

VariableWhy
N8N_WEBHOOK_URLBehind a reverse proxy, the public base URL n8n shows for webhooks. Without it, the production URL displayed in the editor may not be the one Shopify can reach.
EXECUTIONS_DATA_PRUNE, EXECUTIONS_DATA_MAX_AGEFailed executions keep the webhook body, so customer data. n8n documents the defaults as pruning on and 336 hours (14 days). Set the age to what your data protection policy allows.

n8n’s documentation: endpoint variables and execution variables. The step-by-step explanation, with the reasoning, is in the guide (in French).