Looking for guidance on building a flow that will update metafields and variant metafields

Topic summary

A merchant successfully automated the updating of Google Merchant Center metafields and variant metafields using Shopify Flow, after initially struggling with syntax and configuration.

Initial Challenges:

  • Understanding namespace and key formatting (separated by periods in field names)
  • Setting variant metafields like mm-google-shopping.condition to “new”
  • Configuring boolean metafields like mm-google-shopping.custom_product
  • Creating conditional logic based on product options (e.g., setting gender to “male” for Men’s T-Shirts, “unisex” for Hoodies)

Working Solution:
The merchant built flows that automatically update 15+ fields including:

  • Product status, condition, gender, age group, and custom product flags
  • Product taxonomy/category using Admin API mutations with GraphQL
  • Size guides and variant-level metafields

Key Technical Details:

  • Uses “Product Created” trigger with 60-second wait
  • Employs “For each” loops to update variant metafields
  • Implements conditional branches based on Option values
  • For product updates (not creation), uses a scheduled flow every 15 minutes combined with MESA to avoid endless loops
  • Requires finding correct GIDs through GraphQL queries for taxonomy updates

The merchant received assistance from a Flow specialist (Kalen at flow-helper.com) for complex configurations. Community members are requesting additional details about taxonomy codes and implementation specifics.

Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

Apologies for the delay, I missed the message. Below is a summary of what I did.

Flow 1: Product Created Trigger > Wait 60 seconds

Branch 1 > Update Product Metafield (metafield namespace: mm-google-shopping, key: custom_product, Value: True, Type: Boolean)

Branch 2 > For each > Update Product variant Metafield (metafield namespace: mm-google-shopping, key: condition, Value: new, Type: single line text)

Branch 3 > For each > Check if Options Value = Hoodie (example) Update Product variant Metafield (metafield namespace: mm-google-shopping, key: gender, Value: unisex, Type: single line text)

Branch 4 > For each > Check if Options Value = Hoodie (example) Update Product variant Metafield (metafield namespace: mm-google-shopping, key: age_group, Value: adult, Type: single line text)

The process just repeats for each field you want to update.

For other items like linking a size guide or setting the product taxonomy, I had to use the Send Admin API request with the productupdate mutation. The hardest part with this is actually finding the right gid’s to make the updates. For example, the inputs for a sweatshirt look like the below. The 14326 is the number that is hard to find. The only “easy” way it to manually set some of the products up and then use the GraphQL App to run a query to pull the info.

{
“input”: {
“id”: “{{ product.id }}”,
“productCategory”: {
“productTaxonomyNodeId”: “gid://shopify/ProductTaxonomyNode/14326
}
}
}

I also replicated all the flows to redo all the updates when I update a product in case the values need to change. This was the hardest to make work consistently without an endless loop of updating. For this I had to use MESA with Flow. This is the general “flow”.

  1. FLOW 1: Scheduled to run every 15 minutes > get Product Data with following query: updated_at:<=‘{{ scheduledAt }}’ AND updated_at:>‘{{ scheduledAt | date_minus: “15 minutes” }}’ > for each item in get product data > check if updated at is less than or equal to scheduled at > check if Last Flow Update (Custom metafield) does not exist or is less than updated at > Update Product Metafield custom.last_flow_update_at, value: {{ getProductDataForeachitem.updatedAt | date_plus: “30 minutes” | date: “%Y-%m-%dT%H:%M:%S” }} Then check if updated at is less than or equal to scheduled at > check if Last Flow Update (Custom metafield) does not exist or is less than updated at > Send Product to MESA.

  2. MESA: Receive Product from FLOW, Send Product back to FLOW. (As simple as this is, I could not find another way to make it work with FLOW alone.

  3. FLOW 2: Send Product from MESA trigger > run all updates.