# Understanding workflow conditions

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

## What are the conditions

A condition checks whether certain criteria are met before the workflow continues. Based on the result, the workflow can follow different paths or decide whether to run specific actions.

{% hint style="info" %}
A workflow can have multiple conditions that determine which path to follow.
{% endhint %}

## Types of conditions

<table><thead><tr><th width="152.15814208984375">Condition</th><th width="154.079833984375">Evaluates</th><th width="243.94512939453125">Available options</th><th>Configuration</th></tr></thead><tbody><tr><td><p>An event occurred</p><p>(Event-based)</p></td><td>Has a specific event happened?</td><td><ul><li>Email opened</li><li>Email clicked</li><li>Customer unsubscribed</li><li>Customer purchased</li></ul></td><td><ul><li>Event type</li><li>Time email selection (optional)</li></ul></td></tr><tr><td><p>Customer criteria</p><p>(Data comparison)</p></td><td>Does customer data match criteria?</td><td><ul><li>8 customer fields with flexible operators</li></ul></td><td><ul><li>Field selector</li><li>Operator</li><li>Compare value</li><li>AND/OR logic</li></ul></td></tr></tbody></table>

{% tabs %}
{% tab title="An event occured" %}

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

* **Event:** Select the event you want to check for.
* **Email:** Choose the specific email associated with the event, or leave it as **Any email** to check whether the event occurred for any customer.

{% hint style="info" %}
*Examples:*

**Trigger:** New customer sign-up

**→ Action:** Send email (Send promotional email with CTA links)

**→ Action:** Wait (Wait for email delivery and potential click)

**→ Condition:** An event occurred - **Email clicked** (Check if customer clicked email link)

**→ Action (If True):** Add customer tags (Tag customer as `engaged`)\
\
\&#xNAN;*Suggested reading:* [Tag engaged customers after email click](/xflow-app/workflows/get-started-with-workflow-templates-library/tag-engaged-customers-after-email-click.md)
{% endhint %}

{% hint style="success" %}
📝 Learn more: [Workflow condition: An event occurred](/xflow-app/workflows/understanding-workflow-conditions/workflow-condition-an-event-occurred.md)
{% endhint %}
{% endtab %}

{% tab title="Customer criteria" %}

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

* **Select variable:** Choose the customer attribute you want to evaluate.
* **Operator:** Pick the comparison rule (Equal to, Not equal to, Greater than, Less than, Greater than or equal to, Less than or equal to).
* **Compare value:** Enter the value you want to compare against the selected variable.
* **AND / OR:** Combine multiple criteria to create more advanced conditions—use **AND** when all conditions must be true, or **OR** when any single condition can trigger the branch.
* **Add criteria:** Click *Add criteria* to include additional conditions as needed.

{% hint style="info" %}
*Examples:*

**Trigger:** New customer sign up

**→ Condition:** Customer criteria - **Order count > Greater than or equal to > 1**

**→ 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)\
\
\&#xNAN;*Suggested reading*: [Loyalty program enrollment](/xflow-app/workflows/get-started-with-workflow-templates-library/loyalty-program-enrollment.md)
{% endhint %}

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

### Get to know each condition type in more detail

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Workflow condition: An event occurred</strong></td><td>Check if specific customer engagement events have happened</td><td></td><td><a href="/pages/tHc1zs5mWPxKAQVVbTzY">/pages/tHc1zs5mWPxKAQVVbTzY</a></td></tr><tr><td><strong>Workflow condition: Customer criteria</strong></td><td>Filter based on customer profile data and behavior patterns</td><td></td><td><a href="/pages/udpTXo3Wev04gF8mECIj">/pages/udpTXo3Wev04gF8mECIj</a></td></tr></tbody></table>

## Order of conditions

Conditions are checked one by one, in the order they appear in the workflow. The system starts from the top and moves down step by step.

{% hint style="success" %}
You can build workflows with multiple conditions, where each condition can lead to a different action.
{% endhint %}

{% hint style="info" %}

#### *Examples:*

**Trigger:** New customer sign up\
\&#xNAN;**→ Condition:** Customer criteria (Check if subscriber has past orders)

\
If **True**

→ **Action:** Create discount code (Create exclusive VIP discount code)

→ **Action:** Send email (Send VIP welcome email with discount)\
\
If **False** \
→ **Action:** Send email (Send standard welcome email)

→ **Condition:** An event occurred – **Email clicked** (Check if customer clicked a link in the welcome email)

→ **Action (If True):** Add customer tags (Tag customer as **engaged**)\
\
Conditions are evaluated one by one, in the order they appear in the workflow. Each True or False branch can trigger different actions or lead to another condition.
{% endhint %}

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

## How conditions work

{% stepper %}
{% step %}
A workflow reaches a condition step.
{% endstep %}

{% step %}
The condition evaluates data from the trigger or previous actions.
{% endstep %}

{% step %}
If the condition is met, the workflow continues along the **Yes** path.
{% endstep %}

{% step %}
If the condition is not met, the workflow follows the **No** path or stops, depending on your setup.
{% endstep %}
{% endstepper %}

{% hint style="success" %}
Want a full picture? Learn more about how workflows work: [How workflows work](/xflow-app/workflows/how-workflows-work.md)
{% endhint %}

## 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/NWmkFOfstlDd2472afEb" %}
[Create a workflow](/xflow-app/workflows/create-a-workflow.md)
{% endcontent-ref %}

{% content-ref url="/pages/2vPjRx3iv0sn0W8FiqsT" %}
[Assign a workflow to your campaign](/xflow-app/workflows/assign-a-workflow-to-your-campaign.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_understanding_workflow_conditions&#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.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.
