Skip to main content
On Alert Created runs when MileApp raises a monitoring alert of the type you choose, for example an SOS from the panic button, an overspeed or a low battery. Use it to open a follow-up task for the alert, push it to your own system, or email the people who must react. The event belongs to the Alert group, with On Alert Resolved.
Required permission:
  • View automation
  • Create automation

Constraints

  1. One alert type per automation. The automation watches exactly one Alert type. To react to several types, add one trigger per type.
  2. Three actions. Create Task, Webhook and Notification by Email. WhatsApp and SMS are not offered on alert events.
  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.

Alert types

An alert type switched off in Alert Setting is never raised, so it never runs this event.

When it runs

  1. A detector or the field app raises an alert, for example a driver presses the panic button.
  2. The alert is saved and appears in Monitoring › Alert.
  3. Every active automation whose Alert type matches the alert’s code runs its action.
It does not run for:
  • Repeats. While a driver keeps overspeeding, or a battery stays low, the alert is raised again with Repeated set. Only the first alert runs the event.
  • Alerts raised by an automation. An alert from the Alert action (automation.alert) never starts an alert event, so automations can’t trigger each other in a loop.
  • Other codes. Only the eight alert types above can be chosen.

Set it up

  1. Open Workflow › Automation and create or open an automation group.
  2. In Add first step, under Alert, pick On Alert Created.
  3. Alert type: required. Pick the one type to watch, for example Device: Low battery.
  4. Click + under the trigger and pick an action in Add Automation:
    • Create Task: pick the flow and the Hub, then fill each task field with a value or an alert field from the search button.
    • Webhook: fill in the URL and any headers.
    • Notification: the channel is Email. The alert’s user is also sent the email, on top of the recipients you choose.
  5. Click Save, and switch the group on.
Test it by raising an alert of that type, for example by pressing the panic button in the field app for SOS: Panic.

Alert fields

The same fields fill a Create Task mapping, an email’s variables and the webhook body. In the app they show by their label; the key is what a webhook receives. The webhook body also carries docId (the alert’s ID) and organizationId. Each alert type adds its own details under data. In the app they are labelled Data …, for example Data Driver Name: A field the alert did not record is empty.

Webhook payload

An example for Device: Low battery:
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.
  • Check the trigger’s Alert type is the type that was raised.
  • The alert type may be switched off in Alert Setting, so no alert was raised. Check Monitoring › Alert.
  • A repeat of an alert that is already open does not run the event.
The email reaches only the field worker. The alert’s user always receives it. Add the other recipients in the Notification’s To. The webhook receives nothing. Check the URL is reachable from the internet and the authentication header, then read the response in the log.

Questions

Can one trigger watch several alert types? No. Add one On Alert Created trigger per type; they can sit in the same automation group. Can I filter, for example only overspeeds above 100 km/h? Not yet. The alert type is the only scope. Does an automation’s own Alert action start this event? No, see When it runs.