Flow Automation: Finding Draft Orders via Action
You can use the Find draft order action in Flow Automation to find all draft orders in your store that match conditions such as status and last updated time, in a single step. The results can then be passed to later steps in your workflow, such as sending an email that reminds staff to follow up, or counting how many draft orders are still incomplete. This means you no longer need to check the draft order list in your admin manually every day.
This guide explains when to use this action, its field descriptions, the applicable workflows, how to test it, a practical example, and its usage limits.
| Note: The Find draft order action only retrieves draft orders. It does not modify any draft order. |
When to Use the Query Draft Orders Action
Use the Find draft order action when:
- You need to regularly check for incomplete draft orders and remind staff to follow up, so potential sales are not lost.
- You want to review other draft orders from the same time period after a new draft order is created.
- You need a list of draft orders to pass to later steps in your workflow, such as the Loop or Count action.
Field Descriptions
The Find draft order action allows you to define which draft orders to retrieve, how to sort them, and how many to return.
Field | Description |
| Query Conditions | Filters the draft orders to retrieve. You can filter by:
|
| Sort By | Sorts the results by creation time, with either the most recently created or the earliest created draft orders first. |
| Maximum Result Limit | The maximum number of draft orders returned each time the action runs (up to [number] draft orders). |
Applicable Workflows
The Find draft order action is primarily used in workflows initiated by the following triggers:
- Scheduled Time
- Draft order created
| Note: For more details on how to set up the Scheduled Time trigger, please refer to "Flow Automation: Scheduled Trigger." |
Testing the Workflow
To test whether the workflow successfully retrieves the draft orders that match your query conditions, follow these steps:
- In Flow Automation, set up a workflow using the Draft order created trigger and the Query draft orders action, set Draft order status to Processing, then click Publish.
- From your SHOPLINE admin panel, go to Orders > Draft Orders and click Create draft order.
- Add the products and customer details, then click Save.
- After saving the draft order, go to Flow Automation to check the execution results.
| Note: For more information on how to monitor the execution of your workflows, please refer to the "How to View the Running of a Flow" section in the "Introduction to Flow Automation" guide. |
- In the execution results, verify that the Find draft order action returned the draft orders that match your query conditions, including the draft order you just created.
Example Use Case
Here is a practical example of using the Find draft order action to remind staff to follow up on draft orders every day.
Scenario: Every day at 9:00 AM, find draft orders that were updated in the past 7 days but are still processing, and send an email reminding the sales team to follow up.
- Trigger: Scheduled Time (every day at 09:00)
- Action: Query draft orders
- Draft order status: Processing
- Updated time range: Past 7 days
- Sort By: Earliest created first
- Action: Count (counts the number of draft orders retrieved)
- Condition: The count is greater than 0
- Action: Send email
- Recipient: Enter your sales team's email address manually.
- Email subject: Draft orders to follow up today: [Draft order count]
- Email content: There are currently [Draft order count] draft orders that are still incomplete. Please log in to your SHOPLINE admin and go to Orders > Draft Orders to review them and contact the customers.
- Outcome: Your sales team receives a follow-up reminder every morning, so draft orders that have been quoted but not yet paid for are no longer missed.
| Note: To insert the information shown in square brackets (such as [Draft order count]), click Add variables and select the corresponding parameter. |
Usage Limits & Notes
- Results are capped: Each run returns no more draft orders than the number set in Maximum Result Limit. If many draft orders match your conditions, narrow the time range and process them over multiple runs.
- Read-only: This action does not modify draft orders. To process the retrieved draft orders further, add other actions after it.
- No matching draft orders: If no draft orders match your conditions, later steps receive an empty list. We recommend adding a condition after this action that checks whether the result count is greater than 0 before continuing.