---
title: Metafield triggers
description: >-
  Trigger Shopify Flow workflows on metafield changes across 10 owner types,
  with typed order, product, and customer variants.
source_url:
  html: >-
    https://docs.workflow-trigger-extensions.app/metafield-triggers
  md: >-
    https://docs.workflow-trigger-extensions.app/metafield-triggers.md
---

# Metafield triggers

Metafield triggers fire when a specific metafield definition changes, on any of 10
owner types. You choose which metafields to watch, one definition at a time, so a store
with hundreds of metafields only ever fires for the ones a workflow cares about.

## Supported owner types

Product, Product Variant, Collection, Customer, Order, Company, Company Location, Blog,
Blog Post, and Page.

## Setting one up

The example on this page watches a product metafield called **Rating** (`custom.rating`),
the kind of value a reviews app writes.

### 1. Pick the metafield

1. Open **Metafield Triggers** in the app navigation.
2. Click **Add Trigger**.
3. Choose the **resource type** the metafield belongs to, for example Product.
4. Pick the **metafield definition** from the list - search by name if there are many - and click **Add Trigger**.

Only metafields with a **definition** are listed (Shopify admin, Settings, Custom data). The
list is remembered for an hour, so a definition you created a moment ago may be missing:
click **Refresh Metafields** next to Add Trigger and open the dialog again.

![The Add Metafield Trigger dialog with resource type Product and the metafield Rating, custom.rating, selected](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/200223d1ad6a7674.png)
*Choose the resource type, then the metafield definition. Search helps when there are many.*

### 2. The metafield is now watched

The metafield appears in the list as **Active**. There is nothing else to switch on: adding
it here *is* switching it on. **Delete** stops watching it.

The app first records the current value of that metafield on your existing records, so the
very first edit already fires with the right old value.

![The Metafield Triggers list with the product metafield Rating, custom.rating, shown as Active](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/cbbfe1816cd1c1e6.png)
*The watched metafield, Active. Refresh Metafields reloads the list of definitions.*

### 3. What an event carries

From then on, every edit to that metafield fires **Metafield Update** in Shopify Flow. The
event carries the namespace and key, the record it belongs to, the new value, and
`previousValue` - what the metafield said before. `previousValue` is empty when the
metafield was just set for the first time. That includes a metafield that is already
filled when the record is created, for example a customer created by a form with its
answers stored in metafields: the event fires once, with an empty `previousValue`.

In the example the rating went from 4.5 to 2.5. A workflow condition "value is less than 3
and previousValue is 3 or more" fires once, at the moment the rating drops below 3, instead
of on every later edit. Step by step: [Metafield triggers, step by step](https://docs.workflow-trigger-extensions.app/metafield-trigger-tutorials.md).

![An event in Event History: Metafield Update for a product, value 2.5 and previousValue 4.5](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/40855210dc6aee50.png)
*One event, opened: the rating is now 2.5 and previousValue says it was 4.5.*

> [!WARNING]
> The permission that a metafield trigger needs depends on its **owner type**, not on the
> metafield itself. Watching a product metafield needs Product Data Access; watching an
> order metafield needs Order Data Access. Grant the matching permission first or the
> trigger will never fire.

## The generic trigger and the typed ones

There are two ways to consume metafield changes:

| Trigger | Covers | Delivers |
| --- | --- | --- |
| **Metafield Update** | All 10 owner types | Namespace, key, owner id, old and new value |
| **Order Metafield Update** | Orders only | The same, plus the order as a native Flow reference |
| **Product Metafield Update** | Products only | The same, plus the product as a native reference |
| **Customer Metafield Update** | Customers only | The same, plus the customer as a native reference |
| **Product Variant Metafield Update** | Product variants only | The same, plus the parent product as a native reference |

Use a **typed** trigger when your workflow needs to act on the resource itself, for
example to tag the order or read its line items. The native reference means Flow can
use its own Shopify actions on it directly, with no lookup step.

Use the **generic** trigger when you just need to know a value changed, or when you are
watching an owner type that has no typed variant.

The typed triggers each have their own switch on the **Triggers** page (turning on a Flow workflow that uses one switches it on) and fire *in addition* to the generic trigger. They share one event, so enabling both does not
double-count against your quota.

> [!NOTE]
> **Variant metafields have their own typed trigger.** A metafield on a product *variant* fires **Metafield Update** and **Product Variant Metafield Update**, which carries the parent product as a reference. It does not fire **Product Metafield Update**, which is for metafields on the product itself. If a variant metafield workflow never runs, check which trigger it is bound to.
>
> Shopify sends no notification when a variant metafield changes, so these are found by checking your catalogue on a schedule: expect a short delay.

## Guides

- [Trigger Shopify Flow on order metafield updates](https://docs.workflow-trigger-extensions.app/order-metafield-update-guide.md)
- [Trigger Shopify Flow on product metafield changes](https://docs.workflow-trigger-extensions.app/product-metafield-update-guide.md)
- [Trigger Shopify Flow on customer metafield updates](https://docs.workflow-trigger-extensions.app/customer-metafield-update-guide.md)
- [Metafield triggers, step by step](https://docs.workflow-trigger-extensions.app/metafield-trigger-tutorials.md) - a worked example for each of the five metafield triggers.
