# Common mistakes when creating workflows

## General workflow mistakes

These are structural or logical issues that affect the overall behavior of your workflow:

<details>

<summary>Incorrect order of conditions and actions</summary>

*Example:* When a product is restocked, you want to **send an email only to new customers who have no orders yet**.

{% hint style="danger" %}
**Incorrect workflow setup:**

1. **Trigger:** Product restock
2. **Action:** Send email
3. **Condition:** **Order count = 0** (Customer has not purchased this product)

**What goes wrong:**

The email is sent **before** the condition is checked. Even customers who already purchased the product may receive the email, because the workflow doesn’t verify eligibility first.
{% endhint %}

{% hint style="success" %}
**Correct workflow setup:**

1. **Trigger:** Product restock
2. **Condition:** **Order count = 0** (Customer has not purchased this product)
3. **Action (If True):** Send email

**Why this works:**

The workflow checks the condition first and only sends the email to customers who meet the criteria.
{% endhint %}

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

</details>

<details>

<summary>Missing conditions between each step</summary>

*Example:* You want to **send a follow-up email only if the customer has NOT purchased** after receiving the first email.

{% hint style="danger" %}
**Incorrect workflow setup:**

1. **Trigger:** Product restock
2. **Action:** Send back-in-stock email
3. **Wait:** 3 days
4. **Action:** Send follow-up email

**What goes wrong:**

The follow-up email is sent **without checking** whether the customer has already purchased. Customers who already bought the product may still receive the follow-up email.
{% endhint %}

{% hint style="success" %}
**Correct workflow setup:**

1. **Trigger:** Product is back in stock
2. **Action:** Send back-in-stock email
3. **Wait:** 3 days
4. **Condition:** **Order count = 0** (Customer has not purchased this product)
5. **Action (If True):** Send follow-up email

**Why this works:**

The workflow checks the condition **after the wait step** and **only sends the follow-up email to customers who still haven’t purchased**.
{% endhint %}

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

</details>

<details>

<summary>Using static text instead of dynamic variables</summary>

*Example:* You manually enter a product price in the email instead of using a product variable.

{% hint style="danger" %}
Email content includes **static text**, for example:

> “This product is now available for **$49.99**”

**What goes wrong:**

If the product price changes later, the email content **does not update**. Customers may receive emails with an **incorrect or outdated price**.
{% endhint %}

{% hint style="success" %}
Email content uses a **dynamic product variable**, for example:

> “This product is now available for **{{ product.price }}**”

**Why this works:**

The dynamic variable always pulls the **current product price**, ensuring customers see accurate information.
{% endhint %}

</details>

## Mistakes when using conditions in workflows

Errors within your conditions can prevent the workflow from following the right path:

<details>

<summary>Forgetting to add a Wait step for Condition: an event occurred</summary>

*Example:* You want to send a follow-up email **after the customer opens the first back-in-stock email**.

{% hint style="danger" %}
**Incorrect workflow setup:**

* **Trigger:** Product restock
* **Action:** Send back-in-stock email
* **Condition:** Customer purchased
* **Action (If False):** Send follow-up email

**What goes wrong:**

The condition is checked **immediately**, before the customer has had enough time to make a purchase. As a result, the follow-up email might be sent **right away.**
{% endhint %}

{% hint style="success" %}
**Correct workflow setup:**

* **Trigger:** Product restock
* **Action:** Send back-in-stock email
* **Wait:** 3 days
* **Condition:** Customer purchased
* **Action (If False):** Send follow-up email

**Why this works:**

The wait step gives the customer time to decide and make a purchase, ensuring the condition is checked correctly before sending the follow-up email.
{% endhint %}

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

</details>

<details>

<summary>Creating too many separate conditions instead of using logic</summary>

*Example:* You want to send a back-in-stock email to customers who have placed past orders and have a "VIP" tag.

{% hint style="danger" %}
**Incorrect workflow setup:**

* **Trigger:** Product restock
* **Condition:** Order count > 0
* **Condition:** Customer tags = VIP
* **Action (If True):** Send early bird back-in-stock email

**What goes wrong:**

Having two separate conditions for related criteria creates unnecessary complexity.
{% endhint %}

{% hint style="success" %}
**Correct workflow setup:**

* **Trigger:** Product restock
* **Condition:** Order count > 0 **AND** customer tags = VIP
* **Action (If True):** Send early bird back-in-stock email

**Why this works:**

By combining the conditions using AND logic, the workflow becomes cleaner and more efficient. It simplifies the logic, making the workflow easier to manage and understand.
{% endhint %}

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

</details>

<details>

<summary>Using the wrong AND / OR logic</summary>

*Example:* You want to send a special discount email to customers who have spent more than $100 **or** have a VIP tag.

{% hint style="danger" %}
**Incorrect workflow setup:**

* **Trigger:** Product restock
* **Condition:** Total spent amount is greater than $100 **AND** customer tags = VIP
* **Action (If True):** Send special discount email

**What goes wrong:**

Using AND means both conditions must be true. The workflow will only trigger for customers who have spent more than $100 **and** have a VIP tag. However, some VIP customers who have spent less than $100 will be excluded from the campaign.
{% endhint %}

{% hint style="success" %}
**Correct workflow setup:**

* **Trigger:** Product restock
* **Condition:** Total spent amount is greater than $100 **OR** customer tags = VIP
* **Action (If True):** Send special discount email

**Why this works:**

Using OR ensures that the workflow triggers for customers who either spent more than $100 **or** have a VIP tag, broadening the reach of your discount offer.
{% endhint %}

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

</details>

<details>

<summary>Using the wrong data type in conditions</summary>

*Example:* You want to create a condition that checks the **order count**

{% hint style="danger" %}
Order count includes **text**, for example:

> “Compare value = **three**”

**What goes wrong:**

Since the value is entered as text instead of a number, the condition **won't display** the "compare value."
{% endhint %}

{% hint style="success" %}
Order count includes **number**, for example:

> “Compare value = **3**”

**Why this works:**

By entering the correct data type (a number), the condition is evaluated correctly, ensuring the workflow functions as intended.
{% endhint %}

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

</details>

<details>

<summary>Using the wrong boolean value (True / False)</summary>

*Example:* You want to send a follow-up email to customers who have not made a purchase yet.

{% hint style="danger" %}
**Incorrect workflow setup:**

* **Trigger:** Product restock
* **Action:** Send back-in-stock email
* **Wait:** 3 days
* **Condition:** Customer purchased
* **Action (If True):** Send follow-up email

**What goes wrong:**

The condition checks if the customer has made a purchase, but by selecting **True**, the workflow sends the follow-up email to customers who have already purchased, reversing the intended logic.
{% endhint %}

{% hint style="success" %}
**Correct workflow setup:**

* **Trigger:** Product restock
* **Action:** Send back-in-stock email
* **Wait:** 3 days
* **Condition:** Customer purchased
* **Action (If False):** Send follow-up email

**Why this works:**

By selecting **False**, the condition correctly targets customers who **have not** made a purchase, ensuring that the follow-up email is sent to the intended audience.
{% endhint %}

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

</details>

***

#### 📩 **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_common_mistakes_when_creating_workflows&#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/workflows-faqs/common-mistakes-when-creating-workflows.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.
