# Common mistakes when creating workflows ## General workflow mistakes These are structural or logical issues that affect the overall behavior of your workflow: *Example:* When a product is restocked, you want to **send an email only to new customers who have no orders yet**. **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. **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. ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20(39)_b4rD150H.jpg) *Example:* You want to **send a follow-up email only if the customer has NOT purchased** after receiving the first email. **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. **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**. ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20(40)_BvGVSiYT.jpg) *Example:* You manually enter a product price in the email instead of using a product variable. 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**. 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. ## Mistakes when using conditions in workflows Errors within your conditions can prevent the workflow from following the right path: *Example:* You want to send a follow-up email **after the customer opens the first back-in-stock email**. **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.** **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. ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20(41)_qNSj299O.jpg) *Example:* You want to send a back-in-stock email to customers who have placed past orders and have a "VIP" tag. **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. **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. ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20(42)_YzAinIq3.jpg) *Example:* You want to send a special discount email to customers who have spent more than $100 **or** have a VIP tag. **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. **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. ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20(43)_ts23QmbR.jpg) *Example:* You want to create a condition that checks the **order count** 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." 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. ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20(45)_Rlp93x4u.jpg) *Example:* You want to send a follow-up email to customers who have not made a purchase yet. **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. **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. ![image](https://docs-assets.foxecom.app/xflow-app/XFlow%20docs%20screenshot%20(44)_lGXqRYTW.jpg)