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

# Manage Schedule

## View Schedule

<Note>
  Required permission:

  * View Routing Schedule
</Note>

Every schedule you create appears in the table on **Route Optimization → Schedule**. The page follows the hub selector in the upper-right corner, so it lists the schedules of the hub you are currently working in — switching hubs reloads the list and clears the filters.

The table includes the following columns:

* **No.**: Row number.
* **Schedule Name**: The name you gave the schedule.
* **Profile**: The Configuration Profile the schedule uses. If that profile has since been deleted, the cell reads **"Profile not found"** in red — the schedule will be skipped on every run until you point it at a profile that exists.
* **Repeat Cycle**: How often the schedule runs, and at what times.
* **Auto Dispatch**: **Yes** or **No**. This column is read-only on purpose. Turning Auto Dispatch on means routes go straight to your field users, so the change is only possible through the edit form, never with a single click from the list.
* **Last Execution Status**: The outcome of the most recent run. See below.
* **Action**: Edit or delete the schedule.

Above the table are three controls that narrow the list: a **status** filter, a **profile** filter, and a **search** box that matches part of a schedule name. They combine, and clearing a filter removes it.

## Last Execution Status

This is the column to read when a schedule is not producing what you expect. It shows a colored badge for the last run, and hovering over the badge reveals the time of that run followed by one line of detail.

| Badge               | Meaning                                                                                                                                       |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **Success** (green) | The optimization finished. If Auto Dispatch was on, the routes were dispatched as well, and the detail line shows how many vehicles went out. |
| **Ongoing** (grey)  | The run has started and is still working. Optimization for a large hub takes a while; the badge changes once it finishes.                     |
| **Skipped** (grey)  | The run did not start at all. The detail line says why — see the table below. Nothing was created, and nothing was dispatched.                |
| **Failed** (red)    | The run started but the optimization did not finish. Nothing was dispatched.                                                                  |

A schedule that has never run yet shows a dash (**-**) instead of a badge.

<Note>
  The list shows the **most recent** run only. To see what a schedule has actually produced over time, open [Route Optimization → Result](/pages/route-optimization/result/introduction), where every scheduled result is listed under the schedule's name.
</Note>

### Why a Run Was Skipped

When a run cannot go ahead, it is skipped rather than left half-finished, and the reason is recorded. Hover the **Skipped** badge to read it.

| Reason shown                        | What it means                                                             | What to do                                                                                                                                                                                    |
| ----------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **No visit found**                  | There were no active visits at the hub at the moment the run started.     | Normal on a quiet day. If you expected visits, check the [Visit](/pages/route-optimization/visit/introduction) page and whether the schedule runs early enough for the day's visits to exist. |
| **Profile has no vehicle**          | The Configuration Profile the schedule points at has no vehicle selected. | Open the profile and select the vehicles this hub uses. The next run picks them up.                                                                                                           |
| **Configuration profile not found** | The profile has been deleted, or is no longer reachable.                  | Edit the schedule and select a profile that exists.                                                                                                                                           |
| **Hub not found**                   | The hub the profile belongs to is no longer there.                        | Point the schedule at a profile on an existing hub.                                                                                                                                           |
| **Visit limit reached**             | The run would have gone past the visit allowance of your plan.            | Check your plan usage with your admin, or reduce the number of visits going into this run.                                                                                                    |
| **Active vehicle limit reached**    | The profile carries more active vehicles than your plan allows.           | Reduce the vehicles on the profile, or ask your admin about the plan.                                                                                                                         |
| **Previous run is still ongoing**   | An earlier run of this same schedule had not finished yet.                | Space the run times further apart, so each run has room to finish before the next one starts.                                                                                                 |

Two reasons show as **Failed** rather than Skipped, because the run did start:

| Reason shown                  | What it means                                            | What to do                                                                                                     |
| ----------------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| **Route optimization failed** | The optimization itself did not complete.                | Try optimizing the same hub manually from the Visit page to see the error, and contact support if it persists. |
| **Unexpected error**          | Something went wrong that the system could not classify. | Contact support with the schedule name and the time of the run.                                                |

<Note>
  A skipped or failed run is never retried automatically. The schedule simply runs again at its next scheduled time.
</Note>

## Edit

<Note>
  Required permission:

  * View Routing Schedule
  * Edit Routing Schedule
</Note>

To edit a schedule, click the pencil icon in the Action column. The same form you used to create it opens, filled in with its current values, and every field can be changed — including the Configuration Profile.

Changes take effect on the **next** run. A run already in progress is not affected.

<Note>
  You rarely need to edit a schedule just because the routing needs to change. Vehicles, constraints, and optimization settings live on the Configuration Profile, and each run reads the profile fresh — so editing the profile is enough.
</Note>

## Delete

<Note>
  Required permission:

  * View Routing Schedule
  * Delete Routing Schedule
</Note>

To delete a schedule, click the trash icon in the Action column. A confirmation dialog appears — *"Delete this schedule?"* — listing the schedule by name. Select **"Delete"** to confirm.

The schedule stops running immediately and disappears from the list. Routing results it produced in the past are **not** deleted: they stay in Route Optimization → Result and can still be opened and dispatched.

<Note>
  Deleting is the way to stop a schedule. There is no on/off switch — if you may want the schedule back later, note down its profile, name, and repeat cycle before deleting it.
</Note>

## On a Phone

On a narrow screen the table is replaced by a stacked card for each schedule, carrying the same information: the profile name and the status badge on the first line, then the schedule name, the repeat cycle, and whether Auto Dispatch is on. The detail of the last run is printed on the card instead of hidden behind a hover, since there is nothing to hover on a touch screen.

The filters fold behind a funnel button, and **New** becomes a round button in the lower corner. Edit and delete are buttons at the bottom of each card, shown according to your permissions.
