Starting a workflow

Starting workflows for a list of items

The application provides actions that start custom workflows for multiple items at once. There are two approaches: filtering items by a query, or finding items that reference a specific metaobject.

Start workflows by query

These actions start custom workflows for a list of items matching a Shopify search query:

  • Start custom workflow for list of customers — runs workflows that use the Customer: custom workflow started trigger. The customer list can be filtered with customer query filter parameters using this query search syntax.
  • Start custom workflow for list of orders — runs workflows that use the Order: custom workflow started trigger. The order list can be filtered with order query filter parameters using this query search syntax.
  • Start custom workflow for list of products — runs workflows that use the Product: custom workflow started trigger. The product list can be filtered with product query filter parameters using this query search syntax.
  • Start custom workflow for list of companies — runs workflows that use the Company: custom workflow started trigger. The company list can be filtered with company query filter parameters using this query search syntax.
  • Start custom workflow for list of metaobjects — runs workflows that use the Metaobject: custom workflow started trigger. Enter the metaobject type in the Metaobject type field. Optionally narrow the list in the Query field with metaobject query filter parameters using this query search syntax; leave it empty to include every metaobject of the type. Metaobjects from private (app-owned) definitions of other apps can't be read.

Example

Add the Start custom workflow for list of orders action. Fill in the Trigger specifier field with a value that describes the purpose of the workflow you want to start, and enter a filter in the Query field to select only the needed orders. If the filter contains an error, it will not be applied at all - in that case, the custom workflow will be started for all objects in the store. Start workflows for list of orders – action

Create another workflow that starts with the Order: custom workflow started trigger. Immediately after the trigger, add a condition on the Specifier field so the value equals the one passed from the previous workflow. Add the rest of the logic after the condition. Start workflows for list of orders – trigger

This configures a scheduled run of a workflow for a list of orders.

Start workflows by metaobject reference

These actions find all items that reference a specific metaobject and start custom workflows for each of them:

  • Start product workflows by metaobject reference — finds all products referencing a given metaobject and starts workflows that use the Product: custom workflow started trigger.
  • Start order workflows by metaobject reference — finds all orders referencing a given metaobject and starts workflows that use the Order: custom workflow started trigger.
  • Start customer workflows by metaobject reference — finds all customers referencing a given metaobject and starts workflows that use the Customer: custom workflow started trigger.
  • Start company workflows by metaobject reference — finds all companies referencing a given metaobject and starts workflows that use the Company: custom workflow started trigger.

Parameters

  • Metaobject ID (required) — the GID of the metaobject instance to look up references for. You can get it from the metaobject's system.id property in Flow.
  • Metafield namespace — filter references by metafield namespace. Leave empty to include references from any namespace.
  • Metafield key — filter references by metafield key. Leave empty to include references with any key.
  • Trigger specifier (required) — specifier you should use in a condition right after a trigger.

Duplicate items are automatically skipped — each item will only trigger one workflow per action run. Duplicates can occur when the same item references the metaobject in multiple metafields.

Rate limits and delays

There are no limits on the number of items that can be processed by these actions. However, these actions are subject to Shopify's rate limits. When rate limits are reached, the action's execution will continue as limits become available. This may slow down the action's execution, but it will not result in an error.

You can adjust the delay between workflow starts using the action's configuration parameter Delay between triggering. This allows you to manage the load on Shopify Flow and avoid exceeding limits.

Infinite loop detection

The app includes loop detection to prevent infinite recursive workflows. If the same action step is triggered more than 10 times with the same parameters within 30 minutes, the loop detection will activate and the workflow will terminate with an error.

Debug mode

While building and testing these actions, you may run the same action step many times in a short period — enough to trip loop detection and stop your workflow with an error before you finish testing. Debug mode raises the loop-detection limit from 10 to 500 for the same action step with the same parameters within the same 30-minute window, so testing isn't cut short.

Enable it in the app's settings under Debug mode. It's meant to be temporary and turns itself off automatically after 8 hours, so loop protection is never left weakened by accident — and even while it's on, the 500 limit still stops a genuine runaway loop.

Additional considerations

These actions only start workflows but do not wait for their completion.

Warning! If you have multiple custom workflows, combine them into one to reduce the load on Shopify Flow. Learn more.

See also: