> ## 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.

# How to Create Automation

In this section, we will guide you through the process of creating an automation. To start, simply click on the "New" button on the Automation page.

<Note>
  Required permission:

  * View Automation
  * Create Automation
</Note>

<div align="center">
  <img src="https://t3837933.p.clickup-attachments.com/t3837933/aa36d17f-30ea-4eca-a503-12fd85c5783d/image.png" alt="New Button on Automation Page" width="600" />

  <p><i>New Button on Automation Page</i></p>
</div>

Here's the detail of the automation form:

<div align="center">
  <img src="https://t3837933.p.clickup-attachments.com/t3837933/fbc1c26d-481f-431f-8d9b-ad2f68e6df0f/image.png" alt="Automation form details" width="600" />
</div>

## Automation Form Fields

1. **Name**: Provide a descriptive name for your automation. This will help you easily identify its purpose.

2. **Event**: The event acts as the trigger for the automation. This specifies when the automation should be activated. Events can include task creation, task updates, routing finished, etc.

<div align="center">
  <img src="https://t3837933.p.clickup-attachments.com/t3837933/c4115125-5905-4697-9d27-facf4df3bbda/image.png" alt="Event selection dropdown" width="600" />
</div>

3. **Flow**: Specify the task flow, such as Pickup or Delivery. This defines the type of tasks the automation will apply to.

4. **Automation Type**: Determine the action that should occur when the event is triggered. The available automation types will vary based on the selected event. Examples include creating a task, updating a task, assigning a task, sending webhook etc.

<div align="center">
  <img src="https://t3837933.p.clickup-attachments.com/t3837933/8aa456f5-43ea-4ccd-a053-b857d5402ec4/image.png" alt="Automation type dropdown" width="600" />
</div>

5. **Rules**: Rules act as filters that define the conditions under which the automation should run. For example, if you want the automation to trigger when there is a Pickup task where the "Customer Name" is "William," you would set this rule accordingly.
   * **Example**: Choose the field "Customer Name" and set the value to "William." This means the automation will run only for Pickup tasks where the customer name is William.
   * **Note**: Rules can be left empty if no specific filtering is needed.

6. **Automation Details**: Define the specifics of what the automation will do based on the selected Automation Type.
   * **Example**: If you choose the Automation Type "Create Task," you will need to fill in all relevant information about what the new task should look like, including task address, coordinate, assignees, etc.
