Skip to content

Shopify Dude Fix

Shopify Order Tags vs Metafields: Where Should Integration State Live?

Separate staff-friendly labels from machine-readable processing state.

Quick answer: Use tags for operational visibility and typed metafields for structured integration state.
On this page

Why this happens

Tags are easy to filter and edit but do not enforce a state model. A single order can contain contradictory tags, and multiple integrations can update them independently.

Implementation

Define a namespaced order metafield for the processing state and another for the external reference if needed. Keep tags as derived indicators for staff. Use a single writer for state transitions or concurrency checks when updating state. Reconcile state with the external service before retries.

Example

For an export workflow, store pending, exported or failed as the state and retain the external order identifier separately. A failed retry should not create another external order if the external reference already exists.

Common misunderstanding: A processed tag is not an atomic lock or proof that an external system accepted an order.
How to test this:

  1. Test success and failure
  2. replay the same event
  3. manually remove a tag
  4. confirm the integration still recognizes its exported order
  5. test a concurrent update and recover from a timeout.
Sources and further reading: Reference ยท Further reading