Workflow triggers

Triggering workflows when fields change

Flow Companion can start Shopify Flow workflows whenever important data on orders, products, product variants, or customers changes. You decide which fields or metafields to watch by configuring rules in the app.

Available triggers

Tag change triggers

Use these when you only need to respond to tag mutations. Each trigger returns the list of tags that were added or removed compared to the previous state.

  • Order tags added
  • Order tags removed
  • Product tags added
  • Product tags removed

Field change triggers

Track when business-critical data points differ from their previous values. These triggers emit a structured Field change payload with before/after values so workflows can branch on the exact delta.

  • Order field changed
  • Order fulfillment field changed
  • Product field changed
  • Product variant field changed
  • Customer field changed
  • Company location field changed

Metafield change triggers

React to updates on merchant-defined data. These triggers return a Metafield change payload describing the namespace, key, type, and the previous/current value in a type-safe structure.

  • Order metafield changed
  • Product metafield changed
  • Product variant metafield changed
  • Customer metafield changed
  • Company location metafield changed

How to enable field or metafield tracking

  1. Open the Flow Companion app.
  2. Go to SettingsTriggers.
  3. Use Add rule in the Field change section to choose which built-in fields to monitor for each entity.
  4. For order, product, or customer metafields monitoring, select Add metafield rule.
  5. Grant the requested Shopify scopes when prompted.

How field changes are tracked

Shopify reports that something changed, but not the exact before/after values. Flow Companion stores the previous value for every tracked field or metafield in a dedicated metafield so it can compare the incoming change data with the previous one.

Initial indexation

  • When you enable a monitoring rule, the app indexes existing items and records their current (meta)field value in the technical metafield. The snapshot lets the app decide whether the value changed on future updates.
  • Disabling a rule stops indexation and future trigger executions.

Order metafield tracking

Stores can have a large order history, the initial population of the technical metafield covers orders created within the last 90 days. If you need those snapshots for older orders, reach out so we can coordinate a backfill.

Once the rule is active:

  • For new orders that already have a value in the monitored metafield, the trigger fires immediately.
  • For existing orders with a stored technical metafield value, the trigger runs whenever the monitored metafield changes.
  • For existing orders without a stored technical metafield value, the first update only stores the current value without firing. The next update can then compare the stored value and emit the trigger when the value changes.

In practice, orders created within the last 90 days behave as expected right after you enable the rule because the technical metafield is pre-populated. As time passes, that rolling window moves forward with your order history. For orders created more than 90 days before you enabled the rule, the first update seeds the technical metafield (no trigger), and later updates fire the trigger when they detect real changes.

Suspended rules

If a field rule remains enabled while no workflows use its related triggers, Flow Companion suspends the rule to avoid unnecessary webhook processing. Suspended rules stop monitoring webhooks until you manually resume them or the matching trigger is activated again. Resuming may take time because the app needs to store current field values during indexation.

Workflow payload details

Field-change triggers send a Field change object with:

  • field – the human-readable field name.
  • stringValue – string representation of the previous and current values.
  • Optional numericValue, booleanValue, or moneySetValue when the field type supports them.
  • Order fulfillment triggers also include Changed order fulfillment: id so you can target the affected fulfillment.
  • Product variant triggers also include Changed product variant: id so you can target the affected variant.

Metafield-change triggers send a Metafield change object with:

  • namespace, key, and type for the definition that fired.
  • Type-aware snapshots such as stringValue, stringListValue, referenceValue, numericValue, numericWithUnitValue, moneyValue, linkValue, or ratingValue, depending on the metafield definition. Each snapshot includes previous and current values so workflows can check the exact delta.

Tag-change triggers provide Tags.added and Tags.removed arrays.

Working with Companies and company locations

Shopify Flow provides only a limited set of objects that can be passed into triggers. So, Flow Companion provides the company and company location ID so you can retrieve the necessary data using the Get company data / Get company location data action.

To ensure you always target the specific company or company location that triggered the workflow, use the following query

  • in the Get company data action: id:{{changedCompany.legacyResourceId}}
  • in the Get company location data action: id:{{changedCompanyLocation.legacyResourceId}}

Company location data query

This query guarantees that you will always have only one current company / company location in the selected data.

Reinstalling Flow Companion

If you uninstall and later reinstall the app:

  • All field rules reset; re-enable the ones you need.
  • Shopify will ask for the required scopes again.
  • Indexation restarts to rebuild stored values, ensuring tracking resumes from the moment you re-enable each rule.

Important considerations

  • In rare cases a trigger may fire twice (for example, if a connection issue prevents the app from seeing Shopify’s acknowledgement). The app retries automatically to ensure the workflow starts.
  • Large stores may take time to finish the initial indexation. You can continue working; status updates appear in the UI and the process runs in the background.