---
title: "Metafield triggers, step by step"
description: "Step-by-step Shopify Flow tutorials for metafield changes on products, variants, orders, customers and eight more owner types, with the previous value."
canonical: "https://docs.workflow-trigger-extensions.app/metafield-trigger-tutorials"
---

# 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](https://docs.workflow-trigger-extensions.app/metafield-triggers.md) for the setup.

**On this page:** [Metafield Update](#metafield-update), [Product Metafield Update](#product-metafield-update), [Product Variant Metafield Update](#product-variant-metafield-update), [Order Metafield Update](#order-metafield-update), [Customer Metafield Update](#customer-metafield-update)

> [!TIP]
> **New to Shopify Flow?**
> Every example follows the same five moves: pick the trigger, add a condition, add an action, turn the workflow on, check Event History. [Your first workflow, step by step](https://docs.workflow-trigger-extensions.app/first-workflow-tutorial.md) shows each of them with screenshots.

![Shopify Flow's trigger picker inside Workflow Trigger Extensions, searched for Metafield](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/ef5f7baaed06eeac.png)
*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.

> [!NOTE]
> **Good to know**
> - `metafieldKey` is `namespace.key` in one text, made for conditions.
> - The owner arrives as `resourceId` (a GID), not as a reference. Add **Get product data** or a similar step to read more, or use a typed trigger below.
> - The permission depends on the owner type: a product metafield needs Product access, an order metafield Order access.

## 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](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/ec2482e32d43c6f5.png)
*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](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/1c1e78f723a8db24.png)
*The event this example reacts to: the rating went from 4.5 to 2.5, so it crossed 3.*

> [!NOTE]
> **Good to know**
> - `previousValue` is what makes "crossed the threshold" possible. Without it the workflow would tag again on every later edit below 3.
> - Full walkthrough: [Trigger Shopify Flow on product metafield changes](https://docs.workflow-trigger-extensions.app/product-metafield-update-guide.md).

## 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.

> [!NOTE]
> **Good to know**
> Shopify sends **no** notification when a variant metafield changes, so the app finds these by checking your catalogue on a schedule. Expect a delay that grows with catalogue size, from seconds to a few minutes.

## 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.

> [!NOTE]
> **Good to know**
> Full walkthrough: [Trigger Shopify Flow on order metafield updates](https://docs.workflow-trigger-extensions.app/order-metafield-update-guide.md).

## 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.

> [!NOTE]
> **Good to know**
> Full walkthrough: [Trigger Shopify Flow on customer metafield updates](https://docs.workflow-trigger-extensions.app/customer-metafield-update-guide.md).

## 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.

- [Complete trigger reference](https://docs.workflow-trigger-extensions.app/trigger-reference.md) - every trigger on one page.
- [Choosing the right trigger](https://docs.workflow-trigger-extensions.app/choosing-the-right-trigger.md) - which one fits your case.
- [Custom triggers](https://docs.workflow-trigger-extensions.app/custom-triggers.md) - when no built-in trigger fits, write your own.
- [Event history and troubleshooting](https://docs.workflow-trigger-extensions.app/event-history-and-troubleshooting.md) - see what fired and what it carried.
