# Back in stock with exclusive discount for loyal customers

<figure><img src="/files/EWZjIB9zu0nKQZ8XQMpR" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}

## Before you begin

Not sure where to use this template? Check out [Get started with workflow templates library](/xflow-app/workflows/get-started-with-workflow-templates-library.md)
{% endhint %}

## 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

{% stepper %}
{% step %}

### Trigger – Product restock

The workflow starts when a product is restocked and becomes available again.

{% hint style="success" %}
📝 Learn more about triggers: [Understanding workflow triggers](/xflow-app/workflows/understanding-workflow-triggers.md)
{% endhint %}

<figure><img src="/files/ijV5mxljAvEzN7yEl3QF" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 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.

{% hint style="info" %}
Tips: Set a **clear order count** to clearly define who qualifies as a loyal customer and avoid unexpected results.
{% endhint %}

{% hint style="success" %}
📝 Learn more about actions: [Workflow condition: Customer criteria](/xflow-app/workflows/understanding-workflow-conditions/workflow-condition-customer-criteria.md)
{% endhint %}

<figure><img src="/files/jeKxSNewO3yfdNXdQ9EV" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Action – Create discount code

Create a unique discount code for the customer when the condition is met.

{% hint style="success" %}
📝 Learn more about actions: [Understanding workflow actions](/xflow-app/workflows/understanding-workflow-actions.md)
{% endhint %}

<figure><img src="/files/poktOKTcglR8eOUHmUwk" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Action – Send email

Send a **Back in Stock notification email** that includes the newly created discount code.

{% hint style="success" %}

1. Enter the **email subject**.
2. Select the **email template** that you have prepared in advance.
   {% endhint %}

{% hint style="info" %}
If you don’t have an **email template** yet, check out [Create an email template](/xflow-app/email-templates/create-an-email-template.md)

Read more about the **variables** you can use in email: [Available variables in email templates](/xflow-app/email-templates/understanding-personalization-variables-in-email-templates/available-variables-in-email-templates.md)
{% endhint %}

<figure><img src="/files/LMxHjeckwTaFc9razGML" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="success" %}
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.
{% endhint %}

{% hint style="info" %}
**🌟 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.
  {% endhint %}

## 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.

***

#### 📩 **Need help?**

We’re here to make your XFlow experience smooth and successful.\
Our support team is always ready to assist you—no matter how big or small your question is.

<a href="https://admin.shopify.com/apps/xflow?chat=true&#x26;utm_source=foxecom&#x26;utm_medium=help_center_xflow_back_in_stock_with_exclusive_discount_for_loyal_customers&#x26;utm_campaign=cta_button&#x26;utm_term=chat_now" class="button primary" data-icon="comment-lines">Chat now</a> <a href="mailto:contact@help.xflow.so" class="button secondary" data-icon="envelopes">Message us</a>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.foxecom.com/xflow-app/workflows/get-started-with-workflow-templates-library/back-in-stock-with-exclusive-discount-for-loyal-customers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
