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

# On Alert Resolved

> Create a task, call your system or send an email when an alert of the type you choose is resolved.

**On Alert Resolved** runs when someone marks a monitoring [alert](https://docsv4.mile.app/pages/monitoring/alert.md) of the type you choose as resolved. Use it to close the matching ticket in your own system, tell the team an SOS is handled, or log who resolved it and how.

The event belongs to the **Alert** group, with [On Alert Created](https://docsv4.mile.app/pages/workflow/automation/events/on-alert-created.md). Both share the same alert types, actions and fields; this page covers what is different.

> [!NOTE]
>
> Required permission:
>
> * View automation
> * Create automation

## Constraints

1. **One alert type per automation.** Pick it in **Alert type**, from the [same eight types](https://docsv4.mile.app/pages/workflow/automation/events/on-alert-created.md#alert-types) as On Alert Created.
2. **Three actions.** [Create Task](https://docsv4.mile.app/pages/workflow/automation/actions/create-task.md), [Webhook](https://docsv4.mile.app/pages/workflow/automation/actions/webhook.md) and [Notification](https://docsv4.mile.app/pages/workflow/automation/actions/notification.md) by **Email**.
3. **No rules.** The alert type is the automation's only scope.
4. **Saved in an automation group.** Alert events are set up on the automation group canvas. They can't be created through `POST /automation`.

## When it runs

1. Someone resolves the alert in **Monitoring › Alert** or on the Tracking page, optionally with a note.
2. Every active automation whose **Alert type** matches the alert's code runs its action.

It runs **once per alert**, when the alert first becomes resolved. Like On Alert Created, it does not run for repeated alerts or for alerts raised by an automation's **Alert** action.

## Set it up

1. Open **Workflow › Automation** and create or open an automation group.
2. In **Add first step**, under **Alert**, pick **On Alert Resolved**.
3. **Alert type**: required. Pick the one type to watch, for example **SOS: Panic**.
4. Click **+** under the trigger, pick **Create Task**, **Webhook** or **Notification**, and fill it in as described for [On Alert Created](https://docsv4.mile.app/pages/workflow/automation/events/on-alert-created.md#set-it-up).
5. Click **Save**, and switch the group on.

## Alert fields

Every [field of On Alert Created](https://docsv4.mile.app/pages/workflow/automation/events/on-alert-created.md#alert-fields), including the type's own `data` fields, plus who resolved the alert:

| Label | Key | Description |
| - | - | - |
| Resolved | `isResolved` | Always `true` on this event. |
| Resolved By | `resolvedBy` | Email of the user who resolved the alert. |
| Resolved By Name | `resolvedByName` | Their name. |
| Resolution Notes | `resolvedNotes` | The note entered when resolving, or empty. |
| Resolved Time | `resolvedTime` | When the alert was resolved. |

## Webhook payload

An example for **SOS: Panic**:

```json theme={null}
{
  "docId": "6731c0e89a8ee9d8830baac9",
  "organizationId": "660a1b2c4f1a2b3c4d5e6f03",
  "alertCode": "user.panic",
  "alertName": "Panic",
  "title": "Panic button pressed",
  "message": "Budi pressed the panic button.",
  "assignee": "budi@example.com",
  "hubId": "6ae400a6ea63638295070382",
  "eventTime": "2026-11-10T03:15:00+00:00",
  "createdTime": "2026-11-10T03:15:02+00:00",
  "updatedTime": "2026-11-10T03:40:11+00:00",
  "isResolved": true,
  "resolvedBy": "ops@example.com",
  "resolvedByName": "Rina Ops",
  "resolvedNotes": "Called the driver, flat tyre. Mechanic sent.",
  "resolvedTime": "2026-11-10T03:40:11+00:00",
  "data": {
    "driverName": "Budi",
    "phone": "+6281234567890",
    "address": "Jl. Sudirman No. 1, Jakarta",
    "lat": -6.2088,
    "lon": 106.8456,
    "locationSource": "gps",
    "locationTime": "2026-11-10T03:14:58+00:00",
    "userId": "660a1b2c4f1a2b3c4d5e6f10",
    "trackingDate": "2026-11-10"
  }
}
```

A failed webhook is tried up to four times. Your endpoint must answer with HTTP 200.

## Troubleshooting

**The event never runs.**

* Check that the automation group is switched on and the trigger's **Alert type** matches the resolved alert.
* The alert was already resolved before the automation was switched on. The event runs only at the moment an alert becomes resolved.

**Resolution Notes is empty.** The person who resolved the alert left the note blank.

## Questions

**Does it run again if an alert is resolved twice?** No. It runs when the alert first becomes resolved.

**Can I use one automation for both created and resolved?** No. Add one trigger for **On Alert Created** and one for **On Alert Resolved**; they can sit in the same automation group.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.