Skip to main content

Overview

The On Geofence Entry automation event triggers when a field worker’s GPS position enters a geofence you have drawn and stays inside it for that geofence’s configured dwell time. The automation sends the crossing to an external HTTP endpoint, so an operations dashboard, WMS, or ERP can react the moment a worker arrives at a store, warehouse, customer site, or restricted area. The event belongs to the same family as On Start Trip and On Finish Trip: it is driven by the location history the MileApp Field mobile app reports, not by a task action.
Required permission:
  • View Automation
  • Create Automation
  • View Geofence

Availability

Geofence is not generally available yet. It is enabled for MileApp internal staff and for pilot organizations that have been explicitly allowlisted. If your organization is not in the rollout, the geofence menus and the geofence API return 404 Not Found, and the On Geofence Entry option does not appear in the event dropdown. Contact MileApp support if you would like your organization included.

Constraints

Two constraints apply to this event and are enforced by the API:
  1. Webhook only. Webhook is the only automation type accepted. Create Task, Create and Assign Task, Move Task, Assign Task, Update Task, Create or Update Data Source, and Notification are all rejected with 400 Bad Request.
  2. A geofence group is required. The automation is scoped to exactly one geofence group, chosen in the Geofence Group picker. Saving without one fails validation. The automation then fires only for geofences that belong to that group, so separate groups can feed separate integrations.

When Does This Event Trigger?

  1. The field worker’s mobile app reports a GPS position.
  2. MileApp checks which of your active geofences contain that point.
  3. If the geofence is newly entered, the worker is recorded as inside and the dwell clock starts.
  4. Once the worker has been inside for at least the geofence’s dwell time (dwellMinutes), the entry event fires and the webhook is sent.
A dwell time of 0 fires on the first ping inside the zone. A higher dwell time means a worker who only drives through the zone never triggers the event, which is the point of the setting. The event fires once per visit. A second, third, or hundredth GPS ping while the worker is still inside the same geofence sends nothing more. To trigger it again, the worker has to leave the geofence and come back.

Setting Up On Geofence Entry Automation

Step 1: Create the Geofence and Group

  1. Draw the geofences you want to watch and place them in a geofence group
  2. Set each geofence’s dwell time (minutes the worker must stay inside before the entry counts)
  3. Make sure each geofence is active, inactive geofences are ignored

Step 2: Create the Automation

  1. Log in to the MileApp web portal
  2. Click Flow in the main navigation, then open the Automation tab
  3. Click New
  4. Automation Name: a descriptive name, for example “Notify WMS on store arrival”
  5. Event: select On Geofence Entry
  6. Geofence Group: select the group to watch (required)
  7. Automation Type: Webhook (the only option for this event)

Step 3: Configure the Webhook

  1. URL: the endpoint that should receive the crossing. Required, and must be a valid URL
  2. Header (Optional): custom HTTP headers, for example Authorization
  3. Value (Optional): the matching header value

Step 4: Save and Activate

  1. Click Submit
  2. Confirm the automation toggle is Active
  3. Test by having a field worker enter one of the group’s geofences and stay for the dwell time

Webhook Payload

MileApp sends a POST request whose body is the location history record with the geofence details merged onto it.

Geofence Fields

geofenceGroup is the group name meant for display; geofenceGroupId is the id used for matching. They are different fields, do not treat them as interchangeable.

Location Fields

Response

Your endpoint must return an HTTP 200 status code to acknowledge receipt:

Tracking List Markers

When a geofence entry matches one of your automations, MileApp also writes a marker into the worker’s Tracking List slider so the crossing is visible in the web portal. The marker is written only when an automation matched. An organization with geofences drawn but no On Geofence Entry automation on that group sees no markers. A worker with no task on the selected day shows nothing in the slider at all, which is normal slider behaviour and not related to geofence.

Monitoring and Troubleshooting

Viewing Automation Logs

  1. Go to Flow > Automation
  2. Find your automation in the list
  3. Click the clock history icon to view execution logs
  4. Review successful executions and errors

Common Issues

Issue: The event never fires Possible Causes:
  • The automation is not Active
  • The geofence is not active
  • The worker did not stay inside long enough to satisfy the dwell time
  • The worker was already inside the geofence, so the entry had already been announced
  • The geofence belongs to a different group than the one selected on the automation
  • Your organization is not in the geofence rollout
Solution:
  • Confirm the automation toggle is ON and the geofence is active
  • Lower the dwell time and retest, a drive-through will not fire an entry
  • Have the worker leave the geofence completely and re-enter
  • Check that the geofence sits in the selected group
Issue: The event fires once but not again Explanation: This is intended. An entry fires once per visit. The worker must leave the geofence and re-enter to produce another entry event. Issue: Webhook not receiving data Possible Causes:
  • Incorrect webhook URL
  • Authentication headers missing or incorrect
  • The external endpoint is down or unreachable
Solution:
  • Verify the URL is reachable from the public internet
  • Check the authentication credentials
  • Review the automation logs for the response status and body

Frequently Asked Questions

Q: Can one automation watch several geofence groups? A: No. Each automation is scoped to exactly one group. Create one automation per group. Q: Does the worker need an assigned task for the event to fire? A: No. The event is driven by the GPS position, so it fires whether or not a task is in progress. taskId is null in that case. Q: What does dwellMinutes in the payload mean, the configured threshold or the time spent inside? A: It is the geofence’s configured threshold. It is not a measurement of how long the worker stayed. Q: Can I use Create Task or Notification with this event? A: No. Webhook is the only automation type accepted, and any other type is rejected with a 400 error.