Flow Automation: Triggering Workflows When a Return Request Is Approved
You can use the Return created trigger in Flow Automation with a condition so that the workflow starts only when a return is in the "Return in progress" status. When you approve a return request submitted by a customer or create a return directly for an order in your SHOPLINE Admin, the return enters the "Return in progress" status and automatically triggers the workflow. With this setup, you can automatically tag orders with approved returns and look up the customer's order history. Your team can plan for incoming returns, and quickly review the customer's purchase and return history.
This guide explains the supported actions for this trigger, how to test the workflow, and how to automatically tag orders with approved returns in a real-world scenario, so you no longer need to filter these orders manually.
Supported Actions
The following actions are primarily used in workflows initiated by the Return created trigger with a return status condition:
- [Order] Batch query orders
- [Order] Batch query abandoned orders
- [Order] Add order tags
- [Customer] Batch query customers
Testing the Workflow
To test whether the workflow is successfully triggered when a return request is approved, follow these steps:
- In Flow Automation, set up a workflow using the Return created trigger, add a condition that sets the return status equal to "Return in progress," then click Publish to activate the workflow.
-
From your SHOPLINE Admin, open a test order with a pending return request and approve the request.
Note: For details on how to approve a return request, please refer to the "Approving Customer Return Requests" section in the "Setting Up and Managing Self-Service Returns" guide. -
After approving the return request, 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.
Example Use Case
Here is a practical example of using the Return created trigger with a condition to tag orders with approved returns and look up the customer's order history.
Scenario: When you approve a return request, automatically add a "Return approved" tag to the order and look up the customer's order history (up to 100 orders).
- Trigger: Return created
- Condition: Return status equals Return in progress
-
Action 1: Batch query orders (1)
- Query conditions: [Order ID]
- How to sort query results: Earliest order created
- The quantity to keep in the query result: 1
-
Action 2: Batch query orders (2)
- Query conditions: [Buyer ID]
- How to sort query results: Earliest order created
- The quantity to keep in the query result: 100
-
Action 3: Add order tags
- Order_id: [Order ID]
- tags: Return approved
- Outcome: Orders with approved returns are tagged automatically, so your warehouse team can easily filter them and plan for incoming items. The workflow also retrieves up to 100 of the customer's past orders, helping your customer service team quickly review their purchase and return history and follow up on refunds.
| Note: To insert the information shown in square brackets (such as [Order number] and [Buyer ID]), click +Add variable and select the corresponding parameter. |