Skip to main content

Geofence Occupancy

The Geofence Occupancy trigger fires when the number of devices currently inside one geofence crosses a threshold you set. Use it for a live headcount: minimum staffing on a site, or a yard or dock that's over capacity.

This is different from Aggregate Geofence, which counts entry or exit events over a rolling time window. Geofence Occupancy counts devices inside right now, and re-evaluates on every entry and exit at that geofence.

What It Does​

SpatialFlow recomputes the geofence's current occupancy every time a device enters or leaves it, and compares the count against your threshold with below or above. When the condition is met, and hasn't already been notified since it last cleared, the workflow fires.

The trigger watches exactly one geofence; it has no group or tag targeting.

When to Use​

  • Minimum staffing: alert when fewer than 2 crew are on a site
  • Overcrowding: alert when more than 20 vehicles are in the yard
  • Any live headcount that a per-arrival or per-departure alert would spam

Configuration​

FieldTypeDefaultDescription
geofence_idUUID(required)The one geofence to watch. Not a list
comparisonstring(required)below or above
thresholdinteger(required)A non-negative integer to compare the current count against
notify_once_until_resetbooleantrueWhen true, fires once when the condition is met and stays quiet until it clears and re-occurs. When false, fires on every qualifying entry or exit while the condition holds

In the builder, this is Condition (Fewer than (below threshold) or More than (above threshold)), Threshold, and Notify once until reset.

Trigger Payload​

{
"event_type": "exit",
"geofence_id": "b2c3d4e5-6789-01ab-cdef-1234567890ab",
"geofence_name": "Job Site A",
"device_id": "truck-42",
"timestamp": "2026-05-20T14:12:00+00:00",
"comparison": "below",
"current_count": 1,
"threshold": 2,
"is_test_event": false
}

Template Variables​

VariableResolved Value
{{trigger.event_type}}"entry" or "exit"; the event that caused this re-evaluation
{{trigger.geofence_id}}UUID of the watched geofence
{{trigger.geofence_name}}Human-readable geofence name
{{trigger.device_id}}The device whose entry or exit triggered the recount
{{trigger.timestamp}}ISO 8601 timestamp of that entry or exit
{{trigger.comparison}}"below" or "above" (echoed back)
{{trigger.current_count}}The number of devices inside the geofence at evaluation time
{{trigger.threshold}}The threshold the trigger was configured with (echoed back)

Example Use Case​

Scenario. A warehouse wants a Slack alert whenever headcount on the loading dock drops below 2 during a shift, so dispatch knows to hold outbound trucks.

Workflow.

  1. Trigger: Geofence Occupancy on the loading dock geofence, comparison: "below", threshold: 2, notify_once_until_reset: true.
  2. Action - Slack: Notify #dispatch with the current count and the geofence name.

Because notify_once_until_reset is on, the alert fires once when the count drops below 2, then stays quiet until the count reaches 2 or more and drops below again.

Three workflow templates count something similar but not the same: Smart Venue Monitoring (Arrivals) alerts on every arrival with no threshold, and Capacity Alert (Aggregate) and Smart Venue Monitoring (Occupancy) both count arrivals over a time window rather than the live count inside right now. Build from Geofence Occupancy directly for a true headcount.

Testing this trigger​

The Workflow Builder's Test Event button simulates a qualifying event without changing real occupancy, and without consuming the hysteresis state a real alert depends on: a simulated firing doesn't suppress the next genuine one. Run Now, by contrast, evaluates against the live count and can fire for real.

End-to-end runnable guides for routing this trigger to external systems:

See Also​