Shopify + n8n repair guide

Stop the duplicate order where it can do damage.

Shopify can deliver the same webhook more than once. A filter near the trigger helps, but a production-safe workflow also needs the irreversible action itself to reject a second attempt.

If two Shopify orders/create events reach n8n seconds apart, the question is not only whether the payloads look identical. The real question is whether both executions can reach the action that sends, creates, fulfills, or charges.

Shopify documents that duplicate webhook deliveries can happen after a retry or network timeout. It sends a unique webhook delivery ID in X-Shopify-Webhook-Id and an event ID in X-Shopify-Event-Id that can correlate deliveries from the same merchant action. That gives you the raw material for deduplication, but the workflow still needs to use it before anything irreversible happens.

Use two layers, not one.Filter repeated inputs early, then claim a persistent idempotency key immediately before the first side effect that must happen only once.

First, prove where the duplicate comes from

Do not assume Shopify is the only source. Compare the two n8n executions and record:

If the delivery IDs differ but the event ID and order ID match, multiple deliveries or subscriptions may represent the same merchant action. If every identifier differs, investigate whether another trigger, manual retry, or second active workflow is creating the duplicate.

Layer 1: remove repeated inputs early

Place n8n’s Remove Duplicates node immediately after the trigger. For cross-execution protection, choose Remove Items Processed in Previous Executions, keep items where the value is new, and dedupe on the strongest stable identifier available.

Choose the key based on the failure:

  • Same delivery repeated: use Shopify’s webhook delivery ID when available.
  • Same merchant action through multiple subscriptions: use the event ID when available.
  • Headers unavailable: combine shop domain, topic, order ID, and the intended action.

n8n stores 10,000 items by default for the cross-execution operation, and the history can be scoped to the node or workflow. That is useful operational protection, but it should not be the only control around a payment, customer message, fulfillment, or public write.

Layer 2: guard the side effect atomically

Two executions that arrive nearly together can both pass a normal “look up, then create” check before either one writes the result. That race is why the action needs a persistent claim that only one execution can win.

Create a deterministic key immediately before the action:

shop-domain : orders/create : order-id : action-name

Claim that key with a database unique constraint, an atomic insert or upsert, or the destination’s native idempotency-key feature. The first execution continues. The second receives “already exists,” records a duplicate-skipped status, and ends successfully.

A spreadsheet lookup is not an atomic guard.It can be useful for a low-volume log, but two simultaneous executions may both read “not found” before either row is written.

Acknowledge Shopify quickly

Shopify expects a successful response quickly and documents a five-second limit for the complete request. Slow or failed acknowledgements can cause retries. Keep the webhook receiver light: verify the delivery, persist or queue the work, return success, and process slower actions after acknowledgement when your architecture supports it.

Shopify’s current documentation says failed HTTPS deliveries are retried up to eight times over four hours. The delivery logs can show response code, response time, retry attempt, webhook ID, shop, and headers. Use those logs to distinguish a Shopify retry from a second n8n workflow or a manual replay.

Test the race, not only the happy path

A single manual execution does not prove the guard works. Test these cases in a controlled environment:

  1. one normal delivery;
  2. the identical payload twice in sequence;
  3. two identical deliveries started as close together as possible;
  4. a failure after the idempotency key is claimed but before the side effect finishes; and
  5. a legitimate later update that should still be allowed.

Log only what you need: shop, topic, order ID, delivery or event ID, idempotency key, decision, and final status. Avoid customer names, addresses, and payment data in diagnostic logs.

What a successful fix looks like

The first execution produces the intended result once. A repeated delivery is acknowledged without repeating that result. The log explains why it was skipped. A failed action can be retried deliberately without clearing the guard blindly or recreating the original race.

Want this fixed on one existing workflow?

I run Automintly. The fixed $149 repair scope covers one defined failure in one existing workflow, controlled duplicate testing, and a handoff explaining the guard. Review the scope before ordering; we confirm fit before changing anything.

View the $149 repair serviceNeed a larger rebuild? Ask for a custom quote. Do not send credentials, tokens, customer records, or payment data in the first message.

Primary sources