Get draft order data

In workflows that use draft order data, you can use the Get draft order data action to retrieve draft order information from your store. You can use this action in any workflow, including the Scheduled time trigger. In a workflow that uses the Scheduled time trigger, the workflow starts at a time that you've specified, rather than as a result of an event. Because there is no specific event in your store or from an app that starts the workflow, there is no data automatically included.

Fields

The Get draft order data action contains the following fields.

Fields used in the Get draft order data action.
FieldDescription
Sort data byRequired. The parameters by which the data returned by the search query is sorted.
Maximum number of draft ordersRequired. The maximum amount of draft orders that can be returned by the search query that you select.
Select a query to filter dataRequired. The search query that obtains the data to be used in the workflow. Select Advanced to create your own draft orders query by using Shopify's API search syntax.
Edit queryThe search query that's used to select draft orders. This query can be edited to customize the results.

Returned data

The Get draft order data action itself doesn't take any direct action in your store. Instead, it extracts data from your store based on your query, and makes this data available for use in subsequent steps in your workflow.

When you add a Get draft order data action to a workflow, steps that follow this action have a Get draft order data variable available in the variable picker. To use the data extracted by your query in following conditions or actions, select Get draft order data in the Returned data section of the configuration panel. For custom created variables, use the getDraftOrderData object.

Triggers

The Get draft order data action can be used in any workflow.

Example

Example of a workflow that repeats once a week, checks draft orders created in the past week, and sends an email to review the draft order if the draft order's total price is 500 USD or greater.

In this example workflow, a workflow is scheduled to run every Sunday at 9:00 am. The Get draft order data action is used to collect data for draft orders created in the last week. If the total amount of a draft order is equal to or greater than 500 USD, an internal email is sent to review the draft orders.

Ready to start selling with Shopify?Try it free