Hi everyone,
I have a public Shopify app installed on 100+ stores, with the products/update webhook registered on each store. Some stores trigger a huge number of events. In total I receive 70k+ webhook requests in about 10 minutes, and my server goes down.
My stack: PHP (CodeIgniter) with the official Shopify PHP API library.
Current flow:
- Webhook arrives, I verify the HMAC.
- I trigger a cron with the product ID and shop.
- The cron fetches that product from Shopify (one API call per event).
- I update my database.
So every webhook causes one cron run and one Shopify API request, which doesn’t scale.
What I’m planning:
- The webhook endpoint only verifies the HMAC, inserts
(shop, product_id) into a queue table with a unique key (so duplicates collapse into one row), and returns 200 immediately.
- A single cron runs every minute, groups queued products by shop, fetches them in batches of up to 250 via GraphQL
nodes(ids: [...]), and updates my database.
My questions:
- Is this the recommended approach for high-volume
products/update webhooks, or is there a better pattern?
- Is there any way to filter at the source, for example webhook subscription filters or
includeFields, so I only receive events for the fields I care about?
- Would delivery via Amazon EventBridge or Google Pub/Sub be a better fit than HTTPS for this volume?
- Is it normal for a single store to generate thousands of
products/update events per minute? Which actions typically trigger this (inventory updates, bulk edits, other apps, my own app’s writes)?
- Would you recommend using the webhook only as a trigger and reconciling periodically with a bulk operation (
updated_at query) instead?
- Are there best practices for handling retries and avoiding subscription removal when my endpoint is under heavy load?
I would recommend looking into Shopify Next-Gen Events. You can configure specific field triggers in your shopify.app.toml so Shopify only sends events when the product fields you care about change. You can also use a custom GraphQL query to include the product data you need directly in the event payload, saving you from making a separate API call for every event.
I would still keep your queue based approach so your server can process events in the background instead of trying to handle everything at once.
Just check Shopify documentation to confirm that the product fields you need are supported.
Docs: About Events
Hey @Shopping_IQ
thanks for reaching out and sharing that detail.
I did some digging here, and yes, moving the work into a queue follows Shopify’s recommended approach for handling traffic bursts. Verify the HMAC, store the work, return 200 OK, and process it asynchronously. For HTTPS deliveries, the entire request must complete within five seconds.
If Shopify receives no response or an error, it retries the delivery 8 times over the next 4 hours. After 8 consecutive failures, Shopify deletes the subscription if it was configured through the Admin API. Shopify also sends warning emails to your app’s emergency developer email address. If your app is offline for an extended period, re-subscribe if needed and import the missing data. App-specific subscriptions don’t need to be re-subscribed. See Troubleshoot webhooks.
Shopify background processes can update product timestamps in bulk. A newer updated_at doesn’t guarantee that the fields your integration uses have changed. Compare the relevant product data with your stored values to determine what needs synchronization.
For the options you mentioned:
- Batching with
nodes is supported. The input limit is 250 IDs, but each query must also stay within the 1,000-point query-cost limit and your available per-store capacity. The fields you select determine the cost. See GraphQL rate limits.
include_fields reduces the payload to the fields you select. You can also set it with includeFields in webhookSubscriptionCreate. Shopify debounces identical payloads that arrive within a short window. Because updated_at makes each payload unique, including it prevents that debouncing. Any field used in a filter must also be listed in include_fields. Payload customization explains this behavior.
- Classic webhook filters match payload values. For explicit field-change triggers, @Santosh_Qode’s Events suggestion is relevant. Product Events supports specific triggers and custom GraphQL queries that supply the data your handler needs.
- Amazon EventBridge and Google Pub/Sub are both supported delivery alternatives to HTTPS. Shopify’s docs note that these event buses handle HTTPS delivery concerns, such as the response timeout, for you.
- Keep periodic reconciliation alongside webhook processing. Shopify recommends fetching changes through the API because webhook delivery isn’t guaranteed. Many queries support
updated_at filters for this purpose. For larger reconciliation runs, bulk operations run the query asynchronously and return the results as a JSONL file. See reconciliation guidance.