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

# Introduction

An automation Event is a type of Trigger that will trigger the Automation. When creating an automation, you select an event that determines when the automation will be triggered.

## Available Automation Events

MileApp supports the following automation events:

<div align="center">
  <img src="https://mintcdn.com/mileapp-c1584fbc/jvVKvpPwiK1qABos/images/automation-event.png?fit=max&auto=format&n=jvVKvpPwiK1qABos&q=85&s=b1cbf60faef178fd4e743c15cb7a2d93" alt="Automation Event Dropdown" width="600" data-path="images/automation-event.png" />

  <p><i>Event selection dropdown in Create Automation dialog showing all available automation events</i></p>
</div>

### 1. On Task Created

The event will trigger immediately after you create a Task with the selected Flow. This automation is useful for:

* Automatically creating related tasks
* Sending notifications when new tasks are created
* Updating external systems via webhook

**Note:** The Flow that was linked to the Automation Event must match. Automation Type would only be activated if both Task's Flow and Event are matched with an Automation setting.

For detailed information, see [On Task Created](/pages/automation/automation-event/on-task-created).

### 2. On Task Assigned

The event will trigger after you assign a Task to a user with the selected Flow. This automation is useful for:

* Notifying the assigned user
* Creating follow-up tasks
* Logging assignment events to external systems

For detailed information, see [On Task Assigned](/pages/automation/automation-event/on-task-assigned).

### 3. On Task Finished

The event will trigger after you finish/complete a Task with the selected Flow. This automation is useful for:

* Creating subsequent tasks in a workflow
* Sending completion notifications
* Updating task completion status in external systems

For detailed information, see [On Task Finished](/pages/automation/automation-event/on-task-finished).

### 4. On Data Source Created

The event will trigger when a new Data Source entry is created. This automation is useful for:

* Automatically creating tasks based on new data entries
* Synchronizing data with external systems
* Triggering workflows based on data creation

For detailed information, see [On Data Source Created](/pages/automation/automation-event/on-data-source-created).

### 5. On Routing Finished

The event will trigger when the route optimization calculation is completed. This automation is useful for:

* Sending optimized routing results to external systems
* Notifying planners that routes are ready
* Auto-dispatching routes after optimization

For detailed information, see [On Routing Finished](/pages/automation/automation-event/on-routing-finished).

### 6. On Routing Dispatched

The event will trigger each time you hit the Dispatch button in the Routing/Result menu. This automation is useful for:

* Receiving updated routing result data after manual adjustments
* Notifying drivers that routes have been dispatched
* Synchronizing dispatch status with external systems

For detailed information, see [On Routing Dispatched](/pages/automation/automation-event/on-routing-dispatched).

### 7. On Start Trip

The event will trigger when a field worker starts their trip in the mobile app. This automation is useful for:

* Notifying operations team that field work has begun
* Logging trip start times to external systems
* Creating checkpoint tasks

For detailed information, see [On Start Trip](/pages/automation/automation-event/on-start-trip).

### 8. On Finish Trip

The event will trigger when a field worker finishes their trip in the mobile app. This automation is useful for:

* Generating trip summary reports
* Calculating trip duration and metrics
* Triggering post-trip workflows

For detailed information, see [On Finish Trip](/pages/automation/automation-event/on-finish-trip).

## Event-Flow Matching

**Important:** For task-related events (On Task Created, On Task Assigned, On Task Finished), the automation will only be triggered if the task's Flow matches the Flow selected in the automation configuration. This allows you to create Flow-specific automation rules.

For example:

* If you configure an automation with Event "On Task Created" and Flow "Delivery", the automation will only trigger when a task with Flow "Delivery" is created
* Tasks with other Flows (e.g., "Pickup", "Visit") will not trigger this automation

## Common Use Cases

### Workflow Automation

Chain multiple tasks together by using "On Task Finished" to automatically create follow-up tasks.

### External System Integration

Use webhook automation types with any event to send real-time data to external systems like WMS, ERP, or custom applications.

### Notification Systems

Trigger notifications to relevant stakeholders when specific events occur in your workflow.

### Data Synchronization

Keep external databases synchronized with MileApp data using Data Source and Task events.
