Understanding triggers in Shopify Flow
A trigger is the event that starts the workflow, and represents the initial set of data that the workflow uses to inform the conditions of the workflow. Essentially, it's the first step, or inciting event, that launches the automation.
Each workflow can have only 1 trigger step.
Choosing a trigger for your workflow
There are many different triggers to choose from to start your workflow, so selecting the most appropriate trigger means that your workflow has the best chance of successfully running.
When deciding which trigger to choose when starting a workflow, review the following considerations based on the task that you want the workflow to automate:
- Consider when you want the workflow to start: event versus schedule.
- Confirm the definition of the trigger you're considering.
- Consider what data you need the workflow to check.
Consider when you want the workflow to start: event versus schedule
Almost all workflow triggers are based on specific events happening in your store. These events have no set schedule and can occur multiple times a day, depending on your store's activity. For example, if you typically fulfill all of your orders on the same day of the week, then a workflow that starts with the Order fulfilled trigger can go for nearly a week without running at all, to running several times in a single day when you start fulfilling your orders. For many tasks, event-based triggers are the correct choice, because they run only when the relevant event occurs.
However, you might want to automate a task that occurs on a set schedule instead of a specific event. In these cases, you must use the Scheduled time trigger, which is a unique trigger that starts a workflow at a specific time and date that you specify. You can also schedule the workflow to recur hourly, daily, weekly, or monthly. This kind of trigger can be useful for setting up schedule-based automations, such as generating a daily list of all of your out of stock products and sending an email to your inventory manager.
Why this matters: Choosing the right timing for your workflow is crucial because it ensures that the automation activates only when it's relevant to your business needs. If you select an event-based trigger, then your workflow starts in direct response to an action in your store, such as a customer placing an order. If you use a scheduled trigger, then your workflow runs at specific times you choose, making it possible to automate tasks at regular intervals.
Confirm the definition of the trigger you're considering
In Shopify Flow, triggers are very literal, with rigid definitions. For example, the Order created and Order transaction created triggers might seem as though they're referring to the same thing, but they actually refer to completely different order events; Order created triggers when an order is created in your store, whereas Order transaction created triggers when a payment-related transaction is created on any existing order, such as manually capturing a payment on an unpaid order, or issuing a refund to a customer.
Why this matters: Because the trigger is the first thing that the workflow is looking for before it begins the rest of its run, having the correct trigger ensures that your workflow starts when the correct event happens. Don't make assumptions about what a trigger name is referring to. If 2 triggers seem similar, then there's definitely a key difference between them that can significantly impact which one is the right one to use for your workflow.
Consider what data you need the workflow to check
Triggers determine the initial dataset the workflow can use when running its conditions. For example, when a workflow begins with the Customer created trigger, the workflow has access to the new customer's information, such as the customer's contact details, their order history, and whether they've agreed to receive marketing material by email. However, it wouldn't have access to other types of data, such as the shipping method that they selected for their most recent order, because that kind of information is stored in the order dataset rather than in the customer dataset.
Triggers also directly determine which conditions, actions, and variables are available to use in the rest of the workflow. If a variable or action isn't available, then it won't be displayed as an option to select.
It's also worth considering that some data won't immediately be available when a trigger occurs. For example, in most cases, if your workflow starts with the Order created trigger, and your workflow tries to use the order.fulfillmentOrders variable, then the workflow might fail because the order doesn't have any fulfillments yet, because it was only just created. The Fulfillment event created might be a more appropriate trigger to use instead.
Why this matters: Workflows can succeed or fail based on the data available from the trigger. The trigger you choose determines exactly which details in your store are accessible for review by the workflow’s conditions and actions. If the data you need isn't present in the trigger’s dataset, then your workflow can't access or use that information for automations or decision-making. Before finalizing your workflow, confirm that the trigger provides all the necessary information to achieve your automation goals.
Examples of triggers used for common workflows
The following table provides examples of common triggers and how you can use them in Shopify Flow workflows.
You can also review other examples of workflows in Shopify Flow that are available as templates.
| Trigger | Example workflow use cases |
|---|---|
| Order created |
|
| Order paid |
|
| Product variant inventory quantity changed |
|
| Product created |
|
| Customer created |
|
| Scheduled time |
|