# Workflow condition: Customer criteria ![image](https://docs-assets.foxecom.app/xflow-app/image_ZTDWiITX.png) * New to workflows? Take a quick look at[How workflows work](https://docs.foxecom.com/xflow-app/workflows/how-workflows-work) and[Understanding workflow conditions](https://docs.foxecom.com/xflow-app/workflows/understanding-workflow-conditions) to get up to speed. * You can also check out the [Workflow condition: An event occurred](https://docs.foxecom.com/xflow-app/workflows/understanding-workflow-conditions/workflow-condition-an-event-occurred) to unlock more flexible workflow paths. ## Description Filter and branch workflows based on customer profile data and behavior, so each customer follows the path that best fits them. 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. ## Available customer data fields A list of customer data fields you can use to build conditions and personalize workflow paths. ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20\(17\)_gR3HxIpu.jpg) | Field | Data Type | Description | | --------------------------------------------------- | -------------------- | ------------------------------------------------------------------ | | Order count
`customer.numberOfOrders` | Number | Total number of orders placed | | Total spent
`customer.amountSpent.amount` | Number | The total amount a customer has spent on orders in their lifetime. | | Signed up date
`customer.signUpDate` | Date | When customer signed up for notification | | Last order date
`customer.lastOrder.createdAt` | Date | Date of most recent order | | Customer tags
`customer.tags` | Text/Array | Tags assigned to customer | | Accepts marketing
`customer.acceptsMarketing` | Boolean (True/False) | Email marketing opt-in status |
If the correct data type is not entered, the "compare value" will not appear in the workflow condition. You can **combine these fields with** [**operators**](#available-operators) **and** [**AND/OR logic**](#combining-multiple-criteria-with-and-or-logic-in-a-condition) to: * Segment customers * Personalize workflow paths * Send different messages based on customer behavior or profile data *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. Operators are evaluated **at the moment the workflow runs**, ensuring your conditions always use the most up-to-date customer data. ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20\(18\)_p0kUSouL.jpg) You can use **Order count criteria** with operators: | Operator | Description | Example | | ------------------------ | -------------------------------------------------------------- | --------------------------------------------------------------------------- | | Equal to | Checks if the order count matches an exact number. | Order count **equal to 3** β†’ customers who placed exactly 3 orders | | Not equal to | Checks if the order count is different from a specific number. | Order count **not equal to 0** β†’ customers who have placed at least 1 order | | Greater than | Checks if the order count is higher than a number. | Order count **greater than 5** β†’ customers with more than 5 orders | | Greater than or equal to | Checks if the order count meets or exceeds a number. | Order count **β‰₯ 3** β†’ customers with 3 or more orders | | Less than | Checks if the order count is lower than a number. | Order count **less than 2** β†’ customers with 0 or 1 order | | Less than or equal to | Checks if the order count is at or below a number. | Order count **≀ 1** β†’ customers with 0 or 1 order |
**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. *Example:* **Trigger:** New customer sign-up β†’ **Condition:** Order count \= 0 * **True:** Send welcome email * **False:** Create discount code **β†’ Action:** Send VIP email
![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20\(19\)_fRNrdYaE.jpg) You can use **Total spent criteria** with operators: | Operator | Description | Example | | ------------------------ | ------------------------------------------------------- | ----------------------- | | Equal to | Checks if the total spent is exactly a specific amount. | Total spent **\= 500** | | Not equal to | Checks if the total spent is not a specific amount. | Total spent **β‰  0** | | Greater than | Checks if the total spent is higher than a value. | Total spent **> 500** | | Greater than or equal to | Checks if the total spent is at least a value. | Total spent **β‰₯ 1,000** | | Less than | Checks if the total spent is below a value. | Total spent **\< 100** | | Less than or equal to | Checks if the total spent is at most a value. | Total spent **≀ 50** |
**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. *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
![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20\(20\)_zqwbvOZF.jpg) You can use **Signed up date criteria** with operators: | Operator | Description | Example | | ---------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | | Equal to | Checks if the signup date matches a specific date. | Signed up date **\= 2026-01-01 at 09:00** | | Not equal to | Checks if the signup date does not match a specific date. | Signed up date **β‰  2026-01-01 at 09:00** | | Is after | Checks if the customer signed up after a given date. | Signed up date **after 2026-01-01 at 00:00** | | Is before | Checks if the customer signed up before a given date. | Signed up date **before 2026-01-01 at 23:59** | | Between | Checks if the signup date falls within a date range. | Signed up date **between 2026-04-01 00:00 and 2026-06-30 23:59** | | Days ago | Checks if the customer signed up a specific number of days ago. | Signed up date **30 days ago**
(*Running on Nov 11)* β†’ Matches dates on or before **Oct 11, 2026** | | Days from now on | Checks if the signup date is a certain number of days from now. | Signed up date **in 7 days**
*(Running on Nov 11)* β†’ Matches dates on or before Nov 18, 2026 |
**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. *Example:* **Trigger:** Product restock β†’ **Condition:** Signed up date is **30 days ago** * **True:** Send follow-up email (30-day welcome / reminder)
![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20\(21\)_CdPiTKtw.jpg) You can use **Last order date criteria** with operators: | Operator | Description | Example | | ---------------- | ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- | | Equal to | Checks if the last order happened on an exact date and time. | Last order date **\= 2026-01-01 at 09:00** | | Not equal to | Checks if the last order did not occur on a specific date/time. | Last order date **β‰  2026-01-01 at 09:00** | | Is after | Checks if the last order was placed after a given date/time. | Last order date **after 2026-01-01 at 00:00** | | Is before | Checks if the last order was placed before a given date/time. | Last order date **before 2026-01-01 at 23:59** | | Between | Checks if the last order falls within a specific time range. | Last order date **between 2026-04-01 00:00 and 2026-06-30 23:59** | | Days ago | Checks if the last order was placed a specific number of days ago. | Last order date **30 days ago**
(*Running on Nov 11)* β†’ Matches dates on or before **Oct 11, 2026** | | Days from now on | Checks if the last order was placed a specific number of days ago. | Last order date **in 7 days**
*(Running on Nov 11)* β†’ Matches dates on or before Nov 18, 2026 |
**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. *Example:* **Trigger:** Product restock β†’ **Condition:** Last order date is **more than 60 days ago** * **True:** Send win-back email with a discount
![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20\(23\)_quebYGSn.jpg) You can use **Customer tags criteria** with Quantifiers: | Quantifiers | Description | Example | | --------------------- | ------------------------------------------------ | ------------------------------------------------ | | None of items | None of the customer’s tags match the condition. | Customer does **not** have the tag `VIP`. | | At least one of items | At least one tag matches the condition. | Customer has **either** `VIP` **or** `Loyal`. | | All of items | All specified tags must match the condition. | Customer has **both** `VIP` **and** `Wholesale`. |
You can use **Items of customer tags** with operators: | Operator | Description | Example | | ------------ | ------------------------------------ | ---------------------------------------- | | Equal to | Tag exactly matches the given value. | Tag equals `VIP`. | | Not equal to | Tag does not match the given value. | Tag is not `VIP`. | | Includes | Tag contains the given text. | Tag includes `vip` (matches `vip_gold`). | | Excludes | Tag does not contain the given text. | Tag excludes `internal`. | | Start with | Tag starts with the given text. | Tag starts with `promo_`. | | End with | Tag ends with the given text. | Tag ends with `_2026`. |
**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. *Example:* **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
![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20\(24\)_1deyVNuV.jpg) You can use **Accepts marketing criteria** with operators: | Operator | Description | Example | | -------- | ----------------------------------------------------- | ------------------------------------------------------ | | True | The customer has opted in to receive email marketing. | Send a promotional email only to subscribed customers. | | False | The customer has not opted in to email marketing. | Exclude unsubscribed customers from campaigns. |
**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. *Example:* **Trigger:** New customer sign up β†’ **Action:** Send welcome email β†’ **Condition:** Accepts marketing \= **True** * **True:** Send promotional follow-up email
## 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**. AND logic: Enabling highly precise and controlled targeting. **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) ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20\(31\)_939oP6yK.jpg) 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. ### OR - If any criteria are met **Selecting OR** means the condition is true **when at least one criterion is met**. OR logic: Providing flexible targeting with multiple paths to entry. **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) ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20\(32\)_WSqZJcrF.jpg) 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. ## Example of workflow condition: Customer criteria **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) ![image](https://docs-assets.foxecom.app/xflow-app/image_EMn654P0.png) **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)
![image](https://docs-assets.foxecom.app/xflow-app/image_930iaJJh.png) **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) ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20\(33\)_s6DzYFSj.jpg) **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) ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20\(34\)_OCD2x24s.jpg) **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) ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20\(35\)_Vw6sPepF.jpg) **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) ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20\(36\)_j44m4Sld.jpg) ## 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 Available triggers, actions, and conditions Get started with workflow templates library Create a workflow