---
title: Trigger Shopify Flow when a page metafield changes
description: >-
  Start a Shopify Flow workflow when a page metafield changes. Track it in
  Workflow Trigger Extensions and get the old and the new value.
source_url:
  html: >-
    https://docs.workflow-trigger-extensions.app/page-metafield-trigger
  md: >-
    https://docs.workflow-trigger-extensions.app/page-metafield-trigger.md
---

# Page metafield trigger

Legal and policy pages have to be checked regularly. The date of the next check is kept in the page metafield **Review date** (`custom.review_date`), and whoever moves it should leave a trace for the content team.

This page shows how to start a Shopify Flow workflow whenever a metafield of a page changes, with **Workflow Trigger Extensions**. The steps are the same for every metafield of this resource type; the example uses **Review date** (`custom.review_date`).

## What you need

- **A metafield definition.** Create it in your Shopify admin under **Settings > Metafields and metaobjects > Pages**. A metafield without a definition cannot be tracked.
- **The permission Blog, Blog Post & Page Data Access.** Grant it on the app's **Permissions** page, see [Permissions and data access](https://docs.workflow-trigger-extensions.app/permissions-and-data-access.md).

## 1. Track the metafield

1. Open **Metafield Triggers** in the app and click **Add trigger**.
2. Choose the resource type **Page**.
3. Tick the metafield, here **Review date**. You can tick several at once or use **Select all**.
4. Click **Add trigger**.

To track every metafield of this resource type, including the ones you create later, choose **All metafields** instead of ticking single ones, then click **Track all metafields**.

![The Add Metafield Trigger dialog with resource type Page and the metafield Review date, custom.review_date, ticked](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/cdc308f1da469fb7.png)
*Resource type Page, the metafield ticked. All metafields tracks every metafield of the type instead.*

The trigger is **Active** at once. The first time the app reads a page, it stores the current value without starting a workflow; every change after that starts one.

If the metafield is missing from the list, click **Refresh Metafields** on the Metafield Triggers page: the app remembers the list of definitions for an hour.

## 2. What the workflow receives

Every change starts the trigger **Metafield Update** in Shopify Flow with these values:

| Variable | Value |
| --- | --- |
| `resourceType` | `PAGE` |
| `resourceId` | The ID of the page, for example `gid://shopify/Page/1234567890` |
| `metafieldKey` | Namespace and key, here `custom.review_date` |
| `metafield.value` | The new value |
| `metafield.previousValue` | The value before the change, empty when the metafield was set for the first time |
| `metafield.type` | The type of the metafield, for example `single_line_text_field` |

## 3. Build the workflow

1. In Shopify Flow, create a workflow and choose the trigger **Metafield Update** of **Workflow Trigger Extensions**.
2. Add a **Condition**: `resourceType` is equal to `PAGE`. Metafield Update starts for every resource type you track, so the condition keeps this workflow to pages. When you track several metafields of the type, add `metafieldKey` is equal to `custom.review_date` as a second criterion.
3. Add the action you need. The example sends an internal email with the old and the new value.

![The example workflow in Shopify Flow: Metafield Update, a condition on resource type PAGE and Send internal email](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/604ef3e5f361b01a.png)
*The example workflow: the trigger, the condition on the resource type and one action.*

### Start from the example

1. Download the `.flow` file attached at the bottom of this page.
2. In your Shopify admin open **Flow**, click **Import** and choose the file.
3. Open the **Send internal email** step and enter the recipient. The file holds no address on purpose.
4. Turn the workflow on.

## Make it yours

- Write the change into a spreadsheet or task tool with **Send HTTP request**.
- Add a condition on `metafieldKey` when you track several page metafields.
- Keep the old date in the email with `metafield.previousValue`.

## How fast it reacts

Shopify sends no notification for blogs, blog posts and pages, so the app checks them on a schedule. Expect the workflow within a few minutes. You do not have to switch on any other trigger for this.

## Good to know

- This is about the metafields of a page. For changes to the page itself (title, content, visibility) use the trigger **Page Update**.

> [!NOTE]
> **Counts toward your plan**
> Every change of a tracked metafield counts as one event of your plan, see [Plans and usage](https://docs.workflow-trigger-extensions.app/plans-and-usage.md).

## More

- [Metafield triggers](https://docs.workflow-trigger-extensions.app/metafield-triggers.md): how metafield triggers work, for every resource type.
- [Event history and troubleshooting](https://docs.workflow-trigger-extensions.app/event-history-and-troubleshooting.md): see every event the app sent, with the old and the new value.
