n8n Shopify to HubSpot kit

Testing: replay signed webhooks

A script that signs Shopify-style webhooks the way Shopify does and posts them to your n8n production URLs, plus the matrix of what it produced against n8n 2.46.6.

What a replay proves, and what it does not

It proves the front of each workflow: signature, shop domain and topic are checked, a bad request is answered 401, a good one 200. By looking at HubSpot and at n8n’s execution list afterwards you can also see whether the right writes happened and whether a repeated delivery changed anything. It does not prove that your HubSpot or Shopify settings are right, and it never exercises Shopify itself.

How the signature is built

Shopify computes HMAC-SHA256 over the raw request body with the webhook secret and sends the base64 result in X-Shopify-Hmac-Sha256. With openssl:

SIG=$(openssl dgst -sha256 -hmac "$SECRET" -binary < tests/fixtures/customer.json | openssl base64 -A)

curl -sS -i -X POST "$N8N_BASE_URL/webhook/shopify-client" \
  -H "Content-Type: application/json" \
  -H "X-Shopify-Hmac-Sha256: $SIG" \
  -H "X-Shopify-Topic: customers/create" \
  -H "X-Shopify-Shop-Domain: your-shop.myshopify.com" \
  --data-binary @tests/fixtures/customer.json

Use --data-binary: -d @file strips line breaks, the body then differs from what was signed, and you get a 401 you caused yourself. The secret appears in the process list while openssl runs, so use a test secret on your own machine.

The replay script

export N8N_BASE_URL="https://n8n.example.com"
export SHOPIFY_WEBHOOK_SECRET="the secret in the Crypto credential"
export SHOP_DOMAIN="your-shop.myshopify.com"

bash tests/replay.sh list                       # the cases and their expected status
bash tests/replay.sh 01-bad-signature           # rejection cases run without confirmation
bash tests/replay.sh --yes all                  # everything, including cases that write to HubSpot

Needs bash, curl and openssl. Cases with a valid signature reach HubSpot and write dummy contacts and deals on example.com addresses, so they only run with --yes. Point the script at an instance connected to a HubSpot test account, or delete the records afterwards. The script checks HTTP status codes only; it prints a reminder to check HubSpot and the execution list.

CaseWebhook pathSentExpected HTTP
01-validshopify-clientcustomer fixture, customers/create, right secret and shop200
01-bad-signatureshopify-clientsame, wrong secret401
01-wrong-shopshopify-clientright secret, another shop domain401
01-wrong-topicshopify-clientright secret, topic orders/paid401
02-validshopify-commande-payeepaid order fixture200
02-replayshopify-commande-payeethe same order twice200, 200
02-test-ordershopify-commande-payeeorder with "test": true200 (ignored by the workflow)
02-guestshopify-commande-payeeorder with no customer object200
03-validshopify-segmentationpaid order fixture200, then the run fails with “customer not found” against a real shop, unless that customer ID exists there
03-bad-signatureshopify-segmentationwrong secret401

The fixtures contain only the fields the workflows read, not a full Shopify payload. Every address is on example.com.

Results observed

Run on 6 November 2026 with bash tests/replay.sh --yes all against n8n 2.46.6 (Node.js 24), following the order of the setup page: the four credentials needed by 00 to 04 created first (apart from the placeholders, the workflow files were not edited to point at them: n8n linked each node by name and type), then workflows 00 to 04 imported (01, 02, 03 and 04 published, Error workflow of 01, 02 and 03 set to 04), a local fake server standing in for HubSpot and Shopify, and a fake SMTP server. The server logs every request it receives.

CaseHTTPRequests seen by the fake HubSpot / Shopify servern8n run status
01-valid2001 contact upsert (email lowercased, empty fields removed)success
01-bad-signature401nonesuccess (401 branch)
01-wrong-shop401nonesuccess (401 branch)
01-wrong-topic401nonesuccess (401 branch)
02-valid200contact upsert, deal upsert keyed shopify_order_id, associationsuccess
02-replay, two deliveries200, 200the same three requests each time, with the same shopify_order_idsuccess, success
02-test-order200nonesuccess
02-guest200contact upsert (no properties), deal upsert, associationsuccess
03-valid200token request (form-encoded), GraphQL call carrying that token, contact upsertsuccess
03-bad-signature401nonesuccess (401 branch)

Two things to note. A rejected request is a normal run: it raises no error and sends no alert, so rejections show up only in n8n’s execution count (and, for webhooks registered by an app, in that app’s webhook metrics), not in your inbox. And the replay case shows that the same unique key is sent twice; whether HubSpot then keeps a single deal is its upsert at work, which a fake server cannot demonstrate. Run 02-replay against a test account and count the deals.

In 2.46.6 a successful run is still recorded (status, start time) but without node data, which is what saveDataSuccessExecution: none is for.

Error paths, outside the script

These need a server that answers on purpose with a 207, a 400 or a GraphQL error, so the script does not include them. They were run on 6 November 2026 against the same kind of fake servers, with signed requests:

WorkflowSituationObserved
01HubSpot answers 207 with errorsRun fails (Stop and Error), alert email sent
02Contact upsert answers 207 with errorsDeal still created, association skipped, run fails with “deal created but not associated”, alert sent
02Contact upsert answers 400One request only to that node (no retry), deal created, association skipped, alert sent
03Two orders in a rowTwo different tokens, one per run
03GraphQL answers 200 with an errors arrayRun fails, alert sent
04Three provoked failures (01, 02, 03)Three emails, without the “sent automatically with n8n” footer

To provoke an error on your own instance: put a wrong key in the HubSpot credential, run bash tests/replay.sh --yes 01-valid, and check that the alert arrives. Then put the right key back (credentials are not part of the published version, so no new publish is needed). Use the customer webhook for this: a Shopify Send test for orders/paid may carry test: true, which workflow 02 ignores without an error.

Do not test rejections through Shopify

Sending wrong signatures from Shopify’s own webhook page, or leaving a mistyped secret in place, produces repeated 401s on a live subscription, and Shopify can delete a webhook created in the admin after repeated failures. Run the rejection cases from your own machine with the script. If you do use Shopify’s Send test, send one, then fix the cause immediately. Note that Send test delivers sample data that is really written to HubSpot.

Checking the repository itself

python3 scripts/check_repo.py              # structure checks
python3 scripts/check_repo.py --release    # also fails on unfinished placeholders

The check parses every workflow file, refuses any Code or Function node, looks for token-shaped strings, confirms the expected placeholders are still present, verifies that connections point at existing nodes, and checks each page of this site: one h1, a title and description of sensible length, a canonical URL that points at the page itself, valid JSON-LD, and local links that resolve. The same check runs on every push through GitHub Actions.

Not covered