> ## Documentation Index
> Fetch the complete documentation index at: https://flywheel.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Event Trigger

> Respond to specific user actions or events that occur in your application

<iframe src="https://app.flywheel.cx/doc-comp-previews/workflow-node-preview?type=new_event" title="Workflow Node Preview" width="100%" height="250px" className="border dark:border-[#1C1C20]  rounded-xl" />

## How Event Triggers Work

When a user performs an action that matches your trigger configuration, the workflow immediately starts processing that user through your workflow. Event triggers respond to specific user actions or events that occur in your application and are perfect for real-time responses to user behavior.

## Configuration

<Columns cols={2}>
  <Card title="Inputs">
    <ParamField path="Trigger Event" type="string" required>
      Select the specific event name that should start your workflow. Examples: `user_signed_up`, `subscription_created`, `purchase_completed`, `page_viewed`.
    </ParamField>
  </Card>

  <Card>
    <iframe src="https://app.flywheel.cx/doc-comp-previews/workflow-config-preview?type=new_event" title="Workflow Config Preview" width="100%" height="400px" className="" />
  </Card>
</Columns>

<Card title="Outputs">
  <ParamField path="event" type="object" required>
    The complete event data that triggered the workflow.

    <Expandable title="Event Properties">
      <ParamField path="event.id" type="string" required>
        Unique database identifier for this event.
      </ParamField>

      <ParamField path="event.event_id" type="string" required>
        Unique external identifier for this event.
      </ParamField>

      <ParamField path="event.event_name" type="string" required>
        The name of the event that triggered the workflow.
      </ParamField>

      <ParamField path="event.timestamp" type="string" required>
        ISO datetime when the event occurred.
      </ParamField>

      <ParamField path="event.created_at" type="string" required>
        ISO datetime when the event was created in the system.
      </ParamField>

      <ParamField path="event.org_user_id" type="string" required>
        Internal Flywheel user identifier associated with the event.
      </ParamField>

      <ParamField path="event.org_assigned_user_id" type="string">
        Your company's external user identifier, if available.
      </ParamField>

      <ParamField path="event.org_id" type="number" required>
        Organization identifier.
      </ParamField>

      <ParamField path="event.anonymous_id" type="string">
        Anonymous identifier for the user, if available.
      </ParamField>

      <ParamField path="event.event_source" type="string">
        The source of the event (e.g., web, mobile, API).
      </ParamField>

      <ParamField path="event.event_location" type="string">
        The location where the event occurred, if available.
      </ParamField>

      <ParamField path="event.event_type" type="enum">
        The type of event: `track` or `identify`.
      </ParamField>

      <ParamField path="event.schema_id" type="string">
        Schema identifier for the event structure, if applicable.
      </ParamField>

      <ParamField path="event.factory_schema_id" type="string">
        Factory schema identifier, if applicable.
      </ParamField>

      <ParamField path="event.custom_properties" type="object" required>
        Contains all event-specific data and custom properties specific to your application and event type.
      </ParamField>
    </Expandable>
  </ParamField>

  <ParamField path="org_user" type="object" required>
    Comprehensive user information for the user who triggered the event.

    <Expandable title="User Properties">
      <ParamField path="org_user.id" type="string" required>
        Unique user identifier.
      </ParamField>

      <ParamField path="org_user.org_id" type="number" required>
        Organization identifier.
      </ParamField>

      <ParamField path="org_user.org_assigned_user_id" type="string">
        Your company's external user identifier.
      </ParamField>

      <ParamField path="org_user.primary_email" type="string">
        User's primary email address.
      </ParamField>

      <ParamField path="org_user.primary_phone" type="string">
        User's primary phone number.
      </ParamField>

      <ParamField path="org_user.first_name" type="string">
        User's first name.
      </ParamField>

      <ParamField path="org_user.last_name" type="string">
        User's last name.
      </ParamField>

      <ParamField path="org_user.created_at" type="string" required>
        ISO datetime when the user was created.
      </ParamField>

      <ParamField path="org_user.updated_at" type="string" required>
        ISO datetime when the user was last updated.
      </ParamField>

      <ParamField path="org_user.subscription_status" type="enum" required>
        Current subscription status: `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, `unpaid`, `paused`, `inactive`.
      </ParamField>

      <ParamField path="org_user.payment_processor" type="enum" required>
        Payment processor used: `stripe` or `paddle`.
      </ParamField>

      <ParamField path="org_user.mrr" type="number">
        Monthly recurring revenue from this user.
      </ParamField>

      <ParamField path="org_user.ltv" type="number">
        Lifetime value of the user.
      </ParamField>

      <ParamField path="org_user.first_payment_date" type="string">
        ISO datetime of user's first payment.
      </ParamField>

      <ParamField path="org_user.next_payment_date" type="string">
        ISO datetime of user's next scheduled payment.
      </ParamField>

      <ParamField path="org_user.cancels_at" type="string">
        ISO datetime when subscription will be cancelled (if applicable).
      </ParamField>

      <ParamField path="org_user.primary_contact_method" type="string">
        User's preferred contact method.
      </ParamField>

      <ParamField path="org_user.contact_info" type="object" required>
        Additional contact information and preferences.
      </ParamField>

      <ParamField path="org_user.csm" type="object" required>
        Customer Success Manager information assigned to this user.
      </ParamField>

      <ParamField path="org_user.custom_properties" type="object" required>
        Custom user properties you've defined.
      </ParamField>
    </Expandable>
  </ParamField>
</Card>

## Use Cases

**New User Onboarding**

```
Event: user_signed_up
Condition: None (trigger for all new users)
Result: Starts onboarding workflow immediately after signup
```

**High-Value Purchase Follow-up**

```
Event: purchase_completed
Condition: purchase_amount > 1000
Result: Triggers premium customer welcome sequence
```

**Feature Adoption Campaigns**

```
Event: feature_used
Condition: feature_name = "advanced_analytics"
Result: Sends advanced tips and usage guides
```

**Subscription Status Changes**

```
Event: subscription_canceled
Condition: cancellation_reason = "pricing"
Result: Offers discount or alternative pricing options
```

## Best Practices

**Consider Event Frequency**

* Some events may fire multiple times for the same user
* Plan for duplicate events and implement appropriate safeguards
* Use workflow conditions to prevent redundant communications

**Monitor Performance**

* Track trigger activation rates and workflow completion
* Optimize based on user engagement and conversion data
* A/B test different trigger conditions and timing
