Flow Automation: Building a Workflow to Detect Repeat Return Abuse
Some customers return a high number of low-value orders within a short period of time, a pattern known as repeat return abuse. Reviewing every return by hand to catch this is slow and easy to miss. Flow Automation lets you detect this pattern automatically and cancel a customer's next order before it ships, by combining order data, count, and sum actions in a single workflow.
This guide explains the business scenario, the decision logic behind it, and how to set up the workflow end to end.
Understanding the Repeat Return Abuse Pattern
Repeat return abuse describes a pattern where the same customer returns several low-value orders within a short window — for example, 2 or more returns within the last 6 months, where the total refunded amount from those returns is $20 or less. This combination often points to a customer placing and returning orders repeatedly for a low-value reason, rather than an isolated, one-off return.
Store owners commonly want to catch this pattern automatically and cancel a customer's next order before it ships, instead of reviewing every return by hand. The thresholds used in this guide — 2 returns, $20 — are a starting point; adjust them to match what counts as abuse for your store.
| This workflow uses... | Purpose |
| Batch Query Order | Retrieve the customer's historical orders. |
| Count Function | Count how many of those orders were returned. |
| Sum Function | Add up the refunded amount from those orders. |
| Create Order Risk Assessment | Record the risk finding on the order. |
| Cancel Order | Cancel the current order and refund it. |
How the Workflow Decides Whether to Cancel an Order
The workflow follows one of two paths, depending on whether the customer has already been identified as a repeat offender:
- Already flagged: If the customer is already tagged as a repeat-return customer from a previous review, the workflow skips analysis and cancels the new order right away.
- Not flagged yet: If the customer isn't tagged, the workflow checks their order history. It first counts how many orders they've returned. If the count meets the threshold, it then adds up the refunded amount before deciding whether to cancel the order.
| Note: Checking the count before calculating the sum avoids running an extra query for customers who clearly don't match the pattern, such as first-time customers with no return history. |
Setting Up the Repeat Return Abuse Workflow
Each step below uses one of the actions documented in its own Help Center article. This guide focuses on how the actions fit together — see the linked article for that action's full field reference.
To set up the workflow:
- Start a new workflow with the Order Created trigger.
- Add a condition that checks whether the customer is already tagged as a repeat-return customer.
Yes Branch: Customer Already Tagged
If the customer is already tagged, no further analysis is needed.
- Add a Create Order Risk Assessment action (see "Flow Automation: Creating an Order Risk Assessment via Action") to flag the order as high risk.
- Add a Cancel Order action (see "Flow Automation: Canceling Orders") with Refund and Restock Items turned on.
No Branch: Customer Not Yet Tagged
If the customer isn't tagged, analyze their recent return history before deciding whether to cancel the order.
- Add a Batch query orders action (see "Flow Automation: Querying Orders in Batch") to retrieve the customer's returned orders from the last 6 months.
- Add a Count function action (see "Flow Automation: Counting List Items via Action") to count the number of returned orders.
- Add a condition to check whether the count is 2 or more.
- If No: End the workflow.
- If Yes: Continue to the next step.
- Add another Batch query orders action to retrieve the refunded amount for each returned order.
- Add a Sum function action (see "Flow Automation: Summing List Values via Action") to calculate the total refunded amount.
- Add a condition to check whether the total refunded amount is $20 or less.
- If No: End the workflow.
- If Yes: Continue to the next step.
- Add a Create order risk assessment action (see "Flow Automation: Creating an Order Risk Assessment via Action") to flag the order as high risk.
- Add a Cancel order action (see "Flow Automation: Canceling Orders") with Refund and Restock Items turned on.
Best Practices for Detecting Repeat Return Abuse
- Test with notifications turned on before switching to a silent cancellation, so you can confirm the thresholds match real customer behavior in your store before hiding the cancellation from customers.
- Review flagged orders periodically to confirm the 2-returns / $20 thresholds still fit your store's return patterns, and adjust the condition values if needed.
- Consider having a person review the first few flagged customers before tagging them as repeat offenders, then let the workflow fast-track any future orders from confirmed cases automatically.
Frequently Asked Questions About the Repeat Return Abuse Workflow
Q 1 Can I change the 6-month window or the $20 threshold?
Yes. These are condition values in your own workflow, not fixed platform limits — adjust them to match what counts as return abuse for your store.
Q 2 Could this cancel an order from a legitimate customer who happens to return a few things?
It's possible, since the workflow can't tell why a customer returned an order. Review flagged orders periodically to confirm the thresholds are working as intended before relying on it fully.