# Back in stock with exclusive discount for loyal customers
_EWZjIB9z.jpg)
Not sure where to use this template? Check out [Get started with workflow templates library](https://docs.foxecom.com/xflow-app/workflows/get-started-with-workflow-templates-library)
## About this template
When a product is **back in stock**, check if the interested customer is a **loyal one (has multiple orders)** and send them an **exclusive discount code** along with the notification.
## Step-by-step guide to set up this template
### Trigger β Product restock
The workflow starts when a product is restocked and becomes available again.
π Learn more about triggers: [Understanding workflow triggers](https://docs.foxecom.com/xflow-app/workflows/understanding-workflow-triggers)

### Condition β Customer criterias: Order count
Set the condition to: **Order count β Greater than β a number.** This checks whether the customer has placed more than a specific number of orders.
Tips: Set a **clear order count** to clearly define who qualifies as a loyal customer and avoid unexpected results.
π Learn more about actions: [Workflow condition: Customer criteria](https://docs.foxecom.com/xflow-app/workflows/understanding-workflow-conditions/workflow-condition-customer-criteria)
_jeKxSNew.jpg)
### Action β Create discount code
Create a unique discount code for the customer when the condition is met.
π Learn more about actions: [Understanding workflow actions](https://docs.foxecom.com/xflow-app/workflows/understanding-workflow-actions)
_poktOKTc.jpg)
### Action β Send email
Send a **Back in Stock notification email** that includes the newly created discount code.
1. Enter the **email subject**.
2. Select the **email template** that you have prepared in advance.
If you donβt have an **email template** yet, check out [Create an email template](https://docs.foxecom.com/xflow-app/email-templates/create-an-email-template)
Read more about the **variables** you can use in email: [Available variables in email templates](https://docs.foxecom.com/xflow-app/email-templates/understanding-personalization-variables-in-email-templates/available-variables-in-email-templates)
_LMxHjeck.jpg)
That way, you will send a **back-in-stock notification with an exclusive discount** to **loyal customers**, helping you reward repeat buyers and increase conversion when products are restocked.
**π Pro Tip:**
* Set a clear order count to define which customers qualify as loyal.
* Use exclusive, single-use discount codes to avoid misuse.
* Reuse the discount logic in other loyalty or VIP workflows.
## Common use cases
The **Back in stock with exclusive discount for loyal customers** workflow template is commonly used when:
* You want to reward customers who have placed multiple orders.
* You want to increase conversions on back in stock notifications.
* You want to give loyal customers early access to back in stock notifications.