# Workflow condition: An event occurred

<figure><img src="/files/zwfp61x72gJU84V0nzzT" 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: Customer criteria](/xflow-app/workflows/understanding-workflow-conditions/workflow-condition-customer-criteria.md) to unlock more flexible workflow paths.
  {% endhint %}

## Description

**An event occurred** condition checks whether a specific customer action or system event has happened.

{% hint style="success" %}
How to use

* **Event:** Select event type.
* **Email:** Select the email used in any action within the workflow (*Optional* — leave blank to apply to all emails).
  {% endhint %}

## Available events

<table><thead><tr><th width="138.813232421875">Available events</th><th width="198.0908203125">Condition</th><th width="190.0224609375">Evaluates to</th><th>Use case</th></tr></thead><tbody><tr><td>Email opened</td><td><code>email.opened</code></td><td>True if customer opened any email in this workflow</td><td>Send follow-up only if customer engaged</td></tr><tr><td>Email clicked</td><td><code>email.clicked</code></td><td>True if customer clicked any link in the email</td><td>High-intent customers get priority offers</td></tr><tr><td>Customer unsubscribed</td><td><code>customer.unsubscribed</code></td><td>True if customer opted out of notifications</td><td>Stop all further communications</td></tr><tr><td>Customer purchased</td><td><code>customer.purchased</code></td><td>True if customer bought the product (within attribution window)</td><td>Stop follow-ups after conversion</td></tr></tbody></table>

{% hint style="info" %}
*Explore more*: [Available triggers, actions, and conditions](/xflow-app/workflows/available-triggers-actions-and-conditions.md)
{% endhint %}

## Example of workflow condition: An event occurred

{% hint style="info" %}

### Example 1: An event occurred - Email opened

**Trigger:** New customer sign up

**→ Action:** Send email (Send initial engagement email)

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

**→ Condition:** **An event occurred - Email opened**

**→ Action (If False):** Send email (Send win-back email with special offer)\
\
🔗 Learn more: [Win-back campaign for inactive subscribers](/xflow-app/workflows/get-started-with-workflow-templates-library/win-back-campaign-for-inactive-subscribers.md)
{% endhint %}

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

{% hint style="info" %}

### Example 2: An event occurred - Email clicked

**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)\
\
⚠️ Without **CTA links in your email**, the “Email clicked” event cannot be detected.\
\
🔗 Learn more: [Tag engaged customers after email click](/xflow-app/workflows/get-started-with-workflow-templates-library/tag-engaged-customers-after-email-click.md)
{% endhint %}

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

{% hint style="info" %}

### Example 3: An event occurred - Customer unsubscribed

**Trigger:** New customer sign up

**→ Action:** Send email (A marketing or promotional email is sent to the customer)

**→ Action:** Wait (The workflow pauses (e.g., for 7 days) to monitor the customer's interaction with the email)

**→ Condition:** **An event occurred - Customer unsubscribed**

**→ Action (If True):** Update subscription status - Cancelled (If the customer chose to opt-out, the system automatically updates their profile status to Cancelled to stop all future marketing)
{% endhint %}

<figure><img src="/files/3IvX6LMuWtwWq5Eo8Nm1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}

### Example 4: An event occurred - Customer purchased

**Trigger:** Product restock

**→ Action:** Send email (Send an initial "back in stock" notification to customers who requested an alert)

**→ Action:** Wait (The workflow pauses for 1 day to give the customer time to see the first email and complete a purchase)

**→ Condition:** **An event occurred - Customer purchased** (if the customer has made a purchase since the initial notification was sent)

**→ Action (If False):** Send email (if the customer has not purchased, send a follow-up "low stock warning" email to create urgency)\
\
🔗 Learn more: [Urgency back in stock notification](/xflow-app/workflows/get-started-with-workflow-templates-library/urgency-back-in-stock-notification.md)
{% endhint %}

<figure><img src="/files/8ZFFXZIAVe3PcAwT9rCl" alt=""><figcaption></figcaption></figure>

## Best practices

* **Add a Wait step:** Include a **Wait action** before adding a condition. This gives your customers a little breathing room to open the email and check out your message.
* **Include a clickable link:** If you want to track **Email clicked**, make sure your email includes a button or link. No link = no clicks to track 😉
* **Create urgency with follow-ups:** Use the **False** path (for customers who haven’t purchased yet) to send a friendly reminder, such as a *“Limited stock available!”* message. This can help encourage last-minute conversions.
* **Keep your mailing list clean:** Use the **Unsubscribe** condition to automatically remove users who opt out. This helps maintain a healthy list and ensures you’re only communicating with engaged subscribers. *Learn more:* [How the unsubscribe link works?](/xflow-app/email-templates/email-templates-faqs/how-the-unsubscribe-link-works.md)

## Related articles

{% content-ref url="/pages/z6H5lR3v5JpGUipaem6x" %}
[How workflows work](/xflow-app/workflows/how-workflows-work.md)
{% endcontent-ref %}

{% 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_an_event_occurred&#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-an-event-occurred.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.
