Metafield triggers, step by step

Metafields are where a store keeps what Shopify has no field for, and Shopify Flow cannot react to them changing. These five triggers can - and they carry previousValue, so a workflow can tell a rise from a fall.

All of them work per definition: you choose which metafields to watch on the app's Metafield Triggers page. Nothing fires for a metafield you did not add there. See Metafield triggers for the setup.

On this page: Metafield Update, Product Metafield Update, Product Variant Metafield Update, Order Metafield Update, Customer Metafield Update

Shopify Flow's trigger picker inside Workflow Trigger Extensions, searched for Metafield
Where you find them: in Shopify Flow choose Select a trigger, open Workflow Trigger Extensions and search for "Metafield".

Metafield Update

Fires when a watched metafield changes, on any owner type: product, variant, collection, customer, order, draft order, company, company location, blog, blog post or page.

Fires from Shopify webhook plus change detection. Variant, blog, blog post and page metafields are checked on a schedule
Permission Product, Variant & Collection Data Access
Switched on Per metafield definition, on the app's Metafield Triggers page

Use it for

  • Owner types that have no typed trigger: collections, companies, pages, blog posts.
  • One workflow that watches several metafields and branches on metafieldKey.

What Metafield Update sends to your workflow

Variable in Flow Type What it holds
metafieldKey Text The namespace.key of the metafield that was updated (for filtering in Flow)
resourceType Text The type of resource (PRODUCT, PRODUCTVARIANT, COLLECTION, CUSTOMER, ORDER, COMPANY, COMPANYLOCATION, ARTICLE, BLOG, PAGE)
resourceId Text The GID of the resource that was updated
metafield Object The metafield that was updated
metafield.id ID Global ID of the metafield
metafield.namespace Text The namespace of the metafield
metafield.key Text The key of the metafield
metafield.value Text The value of the metafield
metafield.previousValue Text The value before this change. Null when the metafield was just created
metafield.type Text The type of the metafield
eventId Text The id of this event. Search for it in the app's Event History to see exactly what was sent.

Example: React to a changed collection metafield

  1. In the app open Metafield Triggers, click Add trigger, choose the owner type Collection and the definition, and save.
  2. In Flow pick Metafield Update as the trigger.
  3. Add a Condition: metafieldKey Equal to custom.banner_text and resourceType Equal to COLLECTION.
  4. Add Send internal email with {{metafield.previousValue}} -> {{metafield.value}} and {{resourceId}}.
  5. Turn the workflow on.

Product Metafield Update

Fires when a watched product metafield changes, with the product as a native Flow reference.

Fires from Shopify webhook plus change detection
Permission Product, Variant & Collection Data Access
Switched on Turning on a Flow workflow that uses it switches it on. Its own switch is on the app's Triggers page

Use it for

  • Act on the product directly: tag it, publish it, update another metafield.
  • Thresholds on numeric metafields: a rating, a stock forecast, a supplier lead time.

What Product Metafield Update sends to your workflow

Variable in Flow Type What it holds
product Product (Shopify) The product whose metafield changed. A full Shopify product, so all of its fields and Flow's own product actions are available.
metafieldKey Text The namespace.key of the metafield that changed (for filtering in Flow)
metafield Object The metafield that was updated
metafield.id ID Global ID of the metafield
metafield.namespace Text The namespace of the metafield
metafield.key Text The key of the metafield
metafield.value Text The value of the metafield
metafield.previousValue Text The value before this change. Null when the metafield was just created
metafield.type Text The type of the metafield
eventId Text The id of this event. Search for it in the app's Event History to see exactly what was sent.

Example: Tag products whose rating falls below 3

  1. Add the product metafield on the app's Metafield Triggers page.
  2. Pick Product Metafield Update in Flow.
  3. Add a Condition: metafieldKey Equal to reviews.rating.
  4. Add Run code to compare numbers, because metafield values arrive as text: return dropped: Number(input.metafield.value) < 3 && Number(input.metafield.previousValue) >= 3.
  5. Add a Condition on the code's dropped output, then Add product tags low-rating.
  6. Turn the workflow on.
The Add Metafield Trigger dialog with resource type Product and the metafield Rating, custom.rating, selected
First watch the metafield in the app: Metafield Triggers, Add Trigger, Product, Rating.
An event in Event History: Metafield Update for a product, value 2.5 and previousValue 4.5
The event this example reacts to: the rating went from 4.5 to 2.5, so it crossed 3.

Product Variant Metafield Update

Fires when a watched variant metafield changes. The parent product arrives as a reference, the variant as resourceId.

Fires from Checked on a schedule, because Shopify sends no webhook for it
Permission Product, Variant & Collection Data Access
Switched on Turning on a Flow workflow that uses it switches it on. Its own switch is on the app's Triggers page

Use it for

  • Roll variant data up to the product, for example the lowest lead time of all variants.
  • Sync variant-level attributes to a feed.

What Product Variant Metafield Update sends to your workflow

Variable in Flow Type What it holds
product Product (Shopify) The parent product of the variant whose metafield changed (use this to write product metafields). A full Shopify product, so all of its fields and Flow's own product actions are available.
resourceId Text The GID of the product variant whose metafield changed
metafieldKey Text The namespace.key of the metafield that changed (for filtering in Flow)
metafield Object The metafield that was updated
metafield.id ID Global ID of the metafield
metafield.namespace Text The namespace of the metafield
metafield.key Text The key of the metafield
metafield.value Text The value of the metafield
metafield.previousValue Text The value before this change. Null when the metafield was just created
metafield.type Text The type of the metafield
eventId Text The id of this event. Search for it in the app's Event History to see exactly what was sent.

Example: Copy a variant metafield up to its product

  1. Add the variant metafield on the Metafield Triggers page.
  2. Pick Product Variant Metafield Update in Flow.
  3. Add Update product metafield on product with the value {{metafield.value}}.
  4. Turn the workflow on.

Order Metafield Update

Fires when a watched order metafield changes, with the order as a native reference.

Fires from Shopify webhook plus change detection
Permission Order Data Access
Switched on Turning on a Flow workflow that uses it switches it on. Its own switch is on the app's Triggers page

Use it for

  • React to data that apps write onto orders: a delivery date, a risk score, an ERP number.
  • Start fulfillment steps when an approval metafield flips.

What Order Metafield Update sends to your workflow

Variable in Flow Type What it holds
order Order (Shopify) The order whose metafield changed. A full Shopify order, so all of its fields and Flow's own order actions are available.
metafieldKey Text The namespace.key of the metafield that changed (for filtering in Flow)
metafield Object The metafield that was updated
metafield.id ID Global ID of the metafield
metafield.namespace Text The namespace of the metafield
metafield.key Text The key of the metafield
metafield.value Text The value of the metafield
metafield.previousValue Text The value before this change. Null when the metafield was just created
metafield.type Text The type of the metafield
eventId Text The id of this event. Search for it in the app's Event History to see exactly what was sent.

Example: Release an order when its approval metafield turns true

  1. Add the order metafield on the Metafield Triggers page.
  2. Pick Order Metafield Update in Flow.
  3. Add a Condition: metafieldKey Equal to custom.approved and metafield.value Equal to true.
  4. Add a For each over order.fulfillmentOrders with Release fulfillment order hold.
  5. Turn the workflow on.

Customer Metafield Update

Fires when a watched customer metafield changes, with the customer as a native reference.

Fires from Shopify webhook plus change detection
Permission Customer Data Access
Switched on Turning on a Flow workflow that uses it switches it on. Its own switch is on the app's Triggers page

Use it for

  • Loyalty tiers, credit limits or birthdays kept in metafields.
  • Sync customer attributes written by forms or apps to a CRM.

What Customer Metafield Update sends to your workflow

Variable in Flow Type What it holds
customer Customer (Shopify) The customer whose metafield changed. A full Shopify customer, so all of its fields and Flow's own customer actions are available.
metafieldKey Text The namespace.key of the metafield that changed (for filtering in Flow)
metafield Object The metafield that was updated
metafield.id ID Global ID of the metafield
metafield.namespace Text The namespace of the metafield
metafield.key Text The key of the metafield
metafield.value Text The value of the metafield
metafield.previousValue Text The value before this change. Null when the metafield was just created
metafield.type Text The type of the metafield
eventId Text The id of this event. Search for it in the app's Event History to see exactly what was sent.

Example: Tag customers who reach the gold tier

  1. Add the customer metafield on the Metafield Triggers page.
  2. Pick Customer Metafield Update in Flow.
  3. Add a Condition: metafieldKey Equal to loyalty.tier and metafield.value Equal to gold.
  4. Add Add customer tags gold and Send internal email to the VIP team.
  5. Turn the workflow on.

Next steps

The typed triggers fire in addition to the generic one and share its event, so switching both on does not count twice against your plan.