Sounds like an interesting solution yes, I didn’t know you could arbitrarily create product fields like that, aren’t you supposed to respect the fields listed in the Product API payload when you create/update a product via the API ?
Topic summary
A developer seeks to prevent Shopify webhooks from triggering when product updates originate from their own API calls rather than from shop owners. Currently, API-initiated updates trigger product/update webhooks, causing duplicate processing on their server.
Confirmed Limitation:
- Shopify does not natively support filtering webhooks by update source (API vs. UI)
- No official plans mentioned to add this functionality
Proposed Workarounds Discussed:
-
Metafields approach (explored but deemed problematic):
- Add custom “actor” metafield to track update source
- Fails for updates because the field persists across subsequent user edits
- Creates logical loops when trying to toggle between “API” and “UI” values
-
Redis cache solution (suggested workaround):
- Store product IDs in cache before API updates
- Webhook handler checks cache and skips processing if ID exists
- Use short TTL (few seconds) to avoid blocking legitimate user updates
-
Timestamp-based filtering (alternative suggestion):
- Compare webhook’s
lastUpdatedAtwith stored timestamp - Skip processing if time difference is too small (e.g., <10 seconds)
- Prevents duplicate handling of rapid successive updates
- Compare webhook’s
Status: Unresolved by Shopify; developers implementing custom workarounds