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

# Event Trigger

> Configure workflows to start automatically when specific events occur in your system.

# Event Trigger

Event triggers start your workflow automatically when a specific event is emitted. This enables real-time, event-driven automation based on actions in your system.

## Overview

Event triggers are ideal for:

* Responding to user actions immediately
* Processing data as it arrives
* Building reactive workflows
* Integrating with external systems via webhooks

## Configuration

When you configure an Event trigger, you'll need to:

### Select an Event

Choose the event that will start your workflow. Events are defined in your Flowripple account and represent specific occurrences in your system.

<Note>
  If you don't see the event you need, create it first in the Events section of your dashboard. Events define the data structure (variables) that will be available in your workflow.
</Note>

### Event Variables

Once you select an event, the event's variables become available throughout your workflow. These variables represent the data payload that comes with the event.

**Example Event Variables:**

* `user.id` - User identifier
* `user.email` - User email address
* `order.amount` - Order total amount
* `order.items` - Array of order items

<Tip>
  Event variables are automatically parsed and available in all subsequent workflow steps. Use the variable picker (`{{variable.name}}`) to insert them into step configurations.
</Tip>

## How Event Triggers Work

1. **Event is Emitted**: An event occurs in your system (e.g., user signs up, order is created)
2. **Workflow Starts**: All workflows with matching event triggers start executing
3. **Variables Available**: Event data is available as workflow variables
4. **Steps Execute**: Workflow steps run in sequence, using event data

```
Event Emitted: "user.signup"
  ↓
Workflow Triggered
  ↓
Variables Available: user.id, user.email, user.name
  ↓
Workflow Steps Execute
```

## Example Use Cases

### User Onboarding

Trigger a welcome sequence when a user signs up:

```
Event Trigger: user.signup
  Variables: user.id, user.email, user.name
  ↓
Send Email (Welcome Email)
  Subject: Welcome {{user.name}}!
  Body: Thanks for signing up...
  ↓
Time Delay (1 day)
  ↓
Send Email (Follow-up Email)
```

### Order Processing

Process orders immediately when they're created:

```
Event Trigger: order.created
  Variables: order.id, order.amount, order.items, user.email
  ↓
HTTP Request (Create Order in External System)
  URL: https://api.example.com/orders
  Body: {
    "orderId": "{{order.id}}",
    "amount": {{order.amount}}
  }
  ↓
Send Email (Order Confirmation)
  To: {{user.email}}
  Subject: Order #{{order.id}} Confirmed
```

### Webhook Integration

Trigger workflows from external systems:

```
Event Trigger: webhook.received
  Variables: webhook.data, webhook.source
  ↓
True/False Branch (webhook.source === "stripe")
  ├─ True → HTTP Request (Process Payment)
  └─ False → Send Email (Unknown Webhook Notification)
```

## Best Practices

<AccordionGroup>
  <Accordion title="Define Clear Event Structures">
    When creating events, define clear variable structures that match your use case. This makes it easier to use event data in workflows.
  </Accordion>

  <Accordion title="Use Descriptive Event Names">
    Use clear, descriptive event names (e.g., `user.signup` instead of `event1`) to make workflows easier to understand and maintain.
  </Accordion>

  <Accordion title="Validate Event Data">
    Use flow control steps to validate event data before processing. This prevents errors from invalid or unexpected data.
  </Accordion>

  <Accordion title="Handle Missing Variables">
    Consider using flow control steps to check if required variables exist before using them in subsequent steps.
  </Accordion>
</AccordionGroup>

<Tip>
  You can test event triggers by manually emitting test events from the Events section of your dashboard. This helps verify that workflows start correctly and variables are available.
</Tip>

<Warning>
  If an event is deleted or its structure changes, workflows using that event may fail. Always update workflows when modifying event structures.
</Warning>
