# Workflow condition: Customer criteria

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

{% hint style="info" %}

## Before you begin

* New to workflows? Take a quick look at[How workflows work](/xflow-app/workflows/how-workflows-work.md) and[Understanding workflow conditions](/xflow-app/workflows/understanding-workflow-conditions.md) to get up to speed.
* You can also check out the [Workflow condition: An event occurred](/xflow-app/workflows/understanding-workflow-conditions/workflow-condition-an-event-occurred.md) to unlock more flexible workflow paths.
  {% endhint %}

## Description

Filter and branch workflows based on customer profile data and behavior, so each customer follows the path that best fits them.

{% hint style="success" %}
How to set up Customer criteria condition:

1. **Add criteria** and choose **AND / OR** logic.
2. **Select a variable** that matches your needs (you can edit or remove it anytime).
3. **Set the operator and value** to define the condition.
4. **Add more criteria** if you need multiple conditions.
   {% endhint %}

## Available customer data fields

A list of customer data fields you can use to build conditions and personalize workflow paths.

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

<table><thead><tr><th width="276.50701904296875">Field</th><th width="147.89202880859375">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>Order count<br><code>customer.numberOfOrders</code></td><td>Number</td><td>Total number of orders placed</td></tr><tr><td>Total spent<br><code>customer.amountSpent.amount</code></td><td>Number</td><td>The total amount a customer has spent on orders in their lifetime.</td></tr><tr><td>Signed up date<br><code>customer.signUpDate</code></td><td>Date</td><td>When customer signed up for notification</td></tr><tr><td>Last order date<br><code>customer.lastOrder.createdAt</code></td><td>Date</td><td>Date of most recent order</td></tr><tr><td>Customer tags<br><code>customer.tags</code></td><td>Text/Array</td><td>Tags assigned to customer</td></tr><tr><td>Accepts marketing<br><code>customer.acceptsMarketing</code></td><td>Boolean (True/False)</td><td>Email marketing opt-in status</td></tr></tbody></table>

{% hint style="warning" %}
If the correct data type is not entered, the "compare value" will not appear in the workflow condition.
{% endhint %}

{% hint style="info" %}
You can **combine these fields with** [**operators**](#available-operators) **and** [**AND/OR logic**](#combining-multiple-criteria-with-and-and-or-logic-in-a-condition) to:

* Segment customers
* Personalize workflow paths
* Send different messages based on customer behavior or profile data
  {% endhint %}

*Examples:*

* Order count: Target customers who have placed at least 3 orders.
* Total spent: Target customers who have spent more than $500 in total.
* Signed up date: Target customers who signed up before Jan 1, 2024
* Last order date: Target customers whose most recent order was more than 90 days ago.
* Customer tags: Target customers who are tagged as VIP.
* Accepts marketing: Target customers who have opted in to email marketing.

## Available operators

Operators define **how a customer data value is compared** in a condition. They help you check whether a customer meets specific rules.

{% hint style="info" %}
Operators are evaluated **at the moment the workflow runs**, ensuring your conditions always use the most up-to-date customer data.
{% endhint %}

<details>

<summary>🧾 Order count: <code>customer.numberOfOrders</code> </summary>

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

You can use **Order count criteria** with operators:

<table><thead><tr><th width="140.78424072265625">Operator</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>Equal to</td><td>Checks if the order count matches an exact number.</td><td>Order count <strong>equal to 3</strong> → customers who placed exactly 3 orders</td></tr><tr><td>Not equal to</td><td>Checks if the order count is different from a specific number.</td><td>Order count <strong>not equal to 0</strong> → customers who have placed at least 1 order</td></tr><tr><td>Greater than</td><td>Checks if the order count is higher than a number.</td><td>Order count <strong>greater than 5</strong> → customers with more than 5 orders</td></tr><tr><td>Greater than or equal to</td><td>Checks if the order count meets or exceeds a number.</td><td>Order count <strong>≥ 3</strong> → customers with 3 or more orders</td></tr><tr><td>Less than</td><td>Checks if the order count is lower than a number.</td><td>Order count <strong>less than 2</strong> → customers with 0 or 1 order</td></tr><tr><td>Less than or equal to</td><td>Checks if the order count is at or below a number.</td><td>Order count <strong>≤ 1</strong> → customers with 0 or 1 order</td></tr></tbody></table>

{% hint style="info" icon="star" %}
**Pro Tip:**

* Combine **Order count** with other criteria (like **Total spent** or **Last order date**) for more accurate segmentation.
* When possible, prefer **ranges** (e.g. ≥ 3 orders) instead of exact values to keep workflows flexible as customer data changes.
  {% endhint %}

*Example:*&#x20;

**Trigger:** New customer sign-up

→ **Condition:** Order count = 0

* **True:** Send welcome email
* **False:** Create discount code **→ Action:** Send VIP email

</details>

<details>

<summary>💰 Total spent: <code>customer.amountSpent.amount</code></summary>

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

You can use **Total spent criteria** with operators:

<table><thead><tr><th width="140.78424072265625">Operator</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>Equal to</td><td>Checks if the total spent is exactly a specific amount.</td><td>Total spent <strong>= 500</strong></td></tr><tr><td>Not equal to</td><td>Checks if the total spent is not a specific amount.</td><td>Total spent <strong>≠ 0</strong></td></tr><tr><td>Greater than</td><td>Checks if the total spent is higher than a value.</td><td>Total spent <strong>> 500</strong></td></tr><tr><td>Greater than or equal to</td><td>Checks if the total spent is at least a value.</td><td>Total spent <strong>≥ 1,000</strong></td></tr><tr><td>Less than</td><td>Checks if the total spent is below a value.</td><td>Total spent <strong>&#x3C; 100</strong></td></tr><tr><td>Less than or equal to</td><td>Checks if the total spent is at most a value.</td><td>Total spent <strong>≤ 50</strong></td></tr></tbody></table>

{% hint style="info" icon="star" %}
**Pro Tip:**

* Use **Greater than / Greater than or equal to** to identify **VIP or high-value customers**.
* Combine **Total spent** with **Order count** to better understand customer behavior (big spenders vs frequent buyers).
* Avoid using **Equal to** for large amounts unless you’re targeting a very specific case.
* Pair with **Last order date** to find **high-value but inactive customers**.
* Use ranges (e.g. ≥ 500) instead of exact values to keep workflows flexible over time.
  {% endhint %}

*Example:*

**Trigger:** Product restock

→ **Condition:** Total spent ≥ 500

* **True:** Send back-in-stock email with VIP early access
* **False:** Send standard back-in-stock email

</details>

<details>

<summary>🗓️ Signed up date: <code>customer.signUpDate</code></summary>

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

You can use **Signed up date criteria** with operators:

<table><thead><tr><th width="167.64306640625">Operator</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>Equal to</td><td>Checks if the signup date matches a specific date.</td><td>Signed up date <strong>= 2026-01-01 at 09:00</strong></td></tr><tr><td>Not equal to</td><td>Checks if the signup date does not match a specific date.</td><td>Signed up date <strong>≠ 2026-01-01 at 09:00</strong></td></tr><tr><td>Is after</td><td>Checks if the customer signed up after a given date.</td><td>Signed up date <strong>after 2026-01-01 at 00:00</strong></td></tr><tr><td>Is before</td><td>Checks if the customer signed up before a given date.</td><td>Signed up date <strong>before 2026-01-01 at 23:59</strong></td></tr><tr><td>Between</td><td>Checks if the signup date falls within a date range.</td><td>Signed up date <strong>between 2026-04-01 00:00 and 2026-06-30 23:59</strong></td></tr><tr><td>Days ago</td><td>Checks if the customer signed up a specific number of days ago.</td><td>Signed up date <strong>30 days ago</strong><br>(<em>Running on Nov 11)</em> → Matches dates on or before <strong>Oct 11, 2026</strong></td></tr><tr><td>Days from now on</td><td>Checks if the signup date is a certain number of days from now.</td><td>Signed up date <strong>in 7 days</strong><br><em>(Running on Nov 11)</em> → Matches dates on or before Nov 18, 2026</td></tr></tbody></table>

{% hint style="info" icon="star" %}
**Pro Tip:**

* Use **Days ago** to create **welcome or onboarding flows** (e.g. 1 day, 7 days after sign-up).
* Combine with **Order count = 0** to target **new but inactive customers**.
* Use **Between** to analyze or re-engage customers from a specific campaign period.
* Add **time** if your workflow depends on same-day or time-sensitive follow-ups.
* Pair with **Accepts marketing = true** to ensure messages are sent only to opted-in customers.
  {% endhint %}

*Example:*&#x20;

**Trigger:** Product restock

→ **Condition:** Signed up date is **30 days ago**

* **True:** Send follow-up email (30-day welcome / reminder)

</details>

<details>

<summary>⏰ Last order date: <code>customer.lastOrder.createdAt</code></summary>

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

You can use **Last order date criteria** with operators:

<table><thead><tr><th width="167.64306640625">Operator</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>Equal to</td><td>Checks if the last order happened on an exact date and time.</td><td>Last order date <strong>= 2026-01-01 at 09:00</strong></td></tr><tr><td>Not equal to</td><td>Checks if the last order did not occur on a specific date/time.</td><td>Last order date <strong>≠ 2026-01-01 at 09:00</strong></td></tr><tr><td>Is after</td><td>Checks if the last order was placed after a given date/time.</td><td>Last order date <strong>after 2026-01-01 at 00:00</strong></td></tr><tr><td>Is before</td><td>Checks if the last order was placed before a given date/time.</td><td>Last order date <strong>before 2026-01-01 at 23:59</strong></td></tr><tr><td>Between</td><td>Checks if the last order falls within a specific time range.</td><td>Last order date <strong>between 2026-04-01 00:00 and 2026-06-30 23:59</strong></td></tr><tr><td>Days ago</td><td>Checks if the last order was placed a specific number of days ago.</td><td>Last order date <strong>30 days ago</strong><br>(<em>Running on Nov 11)</em> → Matches dates on or before <strong>Oct 11, 2026</strong></td></tr><tr><td>Days from now on</td><td>Checks if the last order was placed a specific number of days ago.</td><td>Last order date <strong>in 7 days</strong><br><em>(Running on Nov 11)</em> → Matches dates on or before Nov 18, 2026</td></tr></tbody></table>

{% hint style="info" icon="star" %}
**Pro Tip:**

* Use **Days ago** to identify **inactive customers** (e.g. no orders in 60 or 90 days).
* Combine with **Total spent** to find **high-value but inactive customers** for win-back campaigns.
* Use **Between** for campaign analysis or seasonal targeting.
* Include **time** when you need precise control (e.g. same-day follow-ups after purchase).
* Pair with **Accepts marketing** to ensure you only message customers who opted in.
  {% endhint %}

*Example:*&#x20;

**Trigger:** Product restock

→ **Condition:** Last order date is **more than 60 days ago**

* **True:** Send win-back email with a discount

</details>

<details>

<summary>🏷️ Customer tags: <code>customer.tags</code></summary>

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

You can use **Customer tags criteria** with Quantifiers:

<table><thead><tr><th width="191.37432861328125">Quantifiers</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>None of items</td><td>None of the customer’s tags match the condition.</td><td>Customer does <strong>not</strong> have the tag <code>VIP</code>.</td></tr><tr><td>At least one of items</td><td>At least one tag matches the condition.</td><td>Customer has <strong>either</strong> <code>VIP</code> <strong>or</strong> <code>Loyal</code>.</td></tr><tr><td>All of items</td><td>All specified tags must match the condition.</td><td>Customer has <strong>both</strong> <code>VIP</code> <strong>and</strong> <code>Wholesale</code>.</td></tr></tbody></table>

You can use **Items of customer tags** with operators:

<table><thead><tr><th width="133.86602783203125">Operator</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>Equal to</td><td>Tag exactly matches the given value.</td><td>Tag equals <code>VIP</code>.</td></tr><tr><td>Not equal to</td><td>Tag does not match the given value.</td><td>Tag is not <code>VIP</code>.</td></tr><tr><td>Includes</td><td>Tag contains the given text.</td><td>Tag includes <code>vip</code> (matches <code>vip_gold</code>).</td></tr><tr><td>Excludes</td><td>Tag does not contain the given text.</td><td>Tag excludes <code>internal</code>.</td></tr><tr><td>Start with</td><td>Tag starts with the given text.</td><td>Tag starts with <code>promo_</code>.</td></tr><tr><td>End with</td><td>Tag ends with the given text.</td><td>Tag ends with <code>_2026</code>.</td></tr></tbody></table>

{% hint style="info" icon="star" %}
**Pro Tip:**

* **Be consistent with tag naming:** Avoid similar tags like `VIP`, `vip`, and `Vip` to prevent confusion.
* **Use “At least one of items” for flexible targeting:** This works best when customers may belong to multiple segments.
* **Combine tags with other criteria:** For example, use **Customer tags + Total spent** to target high-value VIPs.
* **Avoid overcomplicated logic:** Too many OR/AND conditions can make workflows hard to debug later.
  {% endhint %}

*Example:*&#x20;

**Trigger:** Product restock

→ **Condition:** Customer tags **at least one of** `VIP`, `Loyal`

* **True:** Send early-access back-in-stock email
* **False:** Send standard back-in-stock email

</details>

<details>

<summary>📧 Accepts marketing: <code>customer.acceptsMarketing</code></summary>

<figure><img src="/files/1deyVNuV5ETvJsXk0dqU" alt=""><figcaption></figcaption></figure>

You can use **Accepts marketing criteria** with operators:

<table><thead><tr><th width="123.43365478515625">Operator</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>True</td><td>The customer has opted in to receive email marketing.</td><td>Send a promotional email only to subscribed customers.</td></tr><tr><td>False</td><td>The customer has not opted in to email marketing.</td><td>Exclude unsubscribed customers from campaigns.</td></tr></tbody></table>

{% hint style="info" icon="star" %}
**Pro Tip:**

* **Use this condition before sending marketing emails:** This helps you stay compliant with email marketing regulations.
* **Combine with other criteria for better targeting:** For example:\
  `Accepts marketing = True` + `Total spent > 500` to target high-value subscribers.
* **Do not rely on tags alone:** A customer may have a `VIP` tag but still opt out of marketing.
* **Use carefully in non-marketing workflows:** For transactional or operational emails, this condition may not be required.
  {% endhint %}

*Example:*&#x20;

**Trigger:** New customer sign up

→ **Action:** Send welcome email

→ **Condition:** Accepts marketing = **True**

* **True:** Send promotional follow-up email

</details>

## Combining multiple criteria with AND/OR logic in a condition

When building a condition, you can add **multiple criteria**. You can then choose **how these criteria are combined** to decide whether the condition is evaluated as **true or false**.

### AND - If all criteria are met

**Selecting AND** means the condition is true **only when all criteria are met**.

{% hint style="success" %}
AND logic: Enabling highly precise and controlled targeting.
{% endhint %}

{% hint style="info" %}

#### *Example:*

**Trigger:** New customer sign-up

→ **Condition:** Customer criteria (Check if **Total spent ≥ 300 AND Customer tags include `Loyal`**)

**If True**

→ **Action:** Create discount code\
→ **Action:** Send email (Send loyalty welcome email with special offer)

**If False**\
→ **Action:** Send email (Send standard welcome email)
{% endhint %}

<figure><img src="/files/939oP6yKl0yEOrhG6Ex6" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
This condition is **True only when both criteria are met**.

If either the total spent is below 300 or the customer does not have the `Loyal` tag, the workflow goes to the False branch.
{% endhint %}

### OR - If any criteria are met

**Selecting OR** means the condition is true **when at least one criterion is met**.

{% hint style="success" %}
OR logic: Providing flexible targeting with multiple paths to entry.
{% endhint %}

{% hint style="info" %}

#### *Example:*

**Trigger:** New customer sign-up

→ **Condition:** Customer criteria (Check if **Order count = 0 OR Signed up date is today**)

\
**If True**\
→ **Action:** Send email (Send first-time welcome email)

\
**If False**\
→ **Action:** Send email (Send returning customer email)
{% endhint %}

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

{% hint style="info" %}
With **OR logic**, the condition is **True if at least one criterion is met**.

If Order count = 0 or Signed up date equals February 1, 2026, the workflow follows the True branch.

If neither condition is met, the workflow follows the False branch.
{% endhint %}

## Example of workflow condition: Customer criteria

{% hint style="info" %}

#### Example 1: Customer criteria - Order count&#x20;

**Trigger:** New customer sign-up

**→ Condition:** Customer criteria - **Order count > Greater than or equal to > 1** (customer has placed at least one order)

**→ Action (If True):** Add customer tags (automatically adds the "loyalty member" tag to the customer's profile)

**→ Action:** Send email (sends a loyalty program welcome email to the customer)\
\
🔗 Learn more: [Loyalty program enrollment](/xflow-app/workflows/get-started-with-workflow-templates-library/loyalty-program-enrollment.md)
{% endhint %}

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

{% hint style="info" %}

#### Example 2: Customer criteria - Total spent

**Trigger:** Product restock

→ **Condition:** Customer criteria (**Total spent ≥ 1000**) (Check if customer is VIP / high spender)

**If True**\
→ **Action:** Create discount code (Create VIP discount code)\
→ **Action:** Send email (Send VIP back-in-stock email with discount)

**If False**\
→ **Action:** Send email (Send standard back-in-stock notification)\
\
🔗 Learn more: [Back in stock with tiered response](/xflow-app/workflows/get-started-with-workflow-templates-library/back-in-stock-with-tiered-response.md)
{% endhint %}

<figure><img src="/files/930iaJJhHaD75F1heVWA" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}

#### Example 3: Customer criteria - Signed up date

**Trigger:** New customer sign-up

→ **Condition:** Customer criteria (**Signed up date = 2026-02-14**) (Check if **Signed up date equals a specific date**)

**If True**\
→ **Action:** Send email (Send special welcome or anniversary email - Valentine)
{% endhint %}

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

{% hint style="info" %}

#### Example 4: Customer criteria - Last order date

**Trigger:** Product restock

→ **Condition:** Customer criteria (Last order date) (Check if **Last order date is 90 days ago**)

**If True**\
→ **Action:** Send email (Send special back-in-stock email)
{% endhint %}

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

{% hint style="info" %}

#### Example 5: Customer criteria - Customer tags

**Trigger:** New customer sign-up

→ **Condition:** Customer criteria (Customer tags) (Check if customer tags include `Wholesale`)

**If True**\
→ **Action:** Send email (Send wholesale welcome email)

**If False**\
→ **Action:** Send email (Send standard welcome email)
{% endhint %}

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

{% hint style="info" %}

#### Example 6: Customer criteria - Accepts marketing

**Trigger:** New customer sign-up

→ **Action:** Send email (Send welcome email)

→ **Condition:** Customer criteria (Accepts marketing) (Check if **Accepts marketing = True**)

**If True**\
→ **Action:** Send email (Send promotional follow-up email)
{% endhint %}

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

## Best practices

* **Start with the most important condition first:** Place high-impact or broad conditions at the top to reduce unnecessary checks later in the workflow.
* Choose AND vs OR carefully:
  * Use AND for precise targeting when all conditions must be met.
  * Use OR for broader targeting when any condition can qualify.
* **Keep conditions simple and readable:** Avoid adding too many criteria in a single condition. If logic becomes complex, consider splitting it into multiple conditions.
* **Use clear, meaningful values:** Choose thresholds that make sense (for example: order count ≥ 1).
* **Plan for the False branch:** Decide what should happen when conditions are not met.
* **Avoid overlapping criteria:** Ensure conditions do not unintentionally target the same customers across branches.
* **Test with real scenarios:** Validate your conditions using example customers to ensure the logic behaves as expected.

## Related articles

{% content-ref url="/pages/3ajXS0dZtcdbezZlA3XI" %}
[Available triggers, actions, and conditions](/xflow-app/workflows/available-triggers-actions-and-conditions.md)
{% endcontent-ref %}

{% content-ref url="/pages/tq1dkTftd6RRjQFhhWjO" %}
[Get started with workflow templates library](/xflow-app/workflows/get-started-with-workflow-templates-library.md)
{% endcontent-ref %}

{% content-ref url="/pages/NWmkFOfstlDd2472afEb" %}
[Create a workflow](/xflow-app/workflows/create-a-workflow.md)
{% endcontent-ref %}

***

#### 📩 **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_workflow_condition_customer_criterias&#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/understanding-workflow-conditions/workflow-condition-customer-criteria.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.
