Auto-dispatch service requests to the closest technician on Slack
Every new intake form submission gets routed straight to the closest technician's Slack DM, with the address, phone, and a one-tap map link.
Build me a field service dispatch workflow that auto-assigns new service requests to the closest technician. It should run every 10 minutes on a cron.
On each run, use Jotform's Get Form Submissions to pull the latest entries from a Jotform intake form I'll choose. Filter to submissions created after the last run (track a watermark timestamp between runs so I don't process the same submission twice). The form captures customer name, phone, and a site address.
For each new submission, use OpenStreetMap Nominatim's Search (Forward Geocode) to convert the site address into latitude and longitude.
Then compare that point against a config block of technician home bases that I (the workflow owner) can edit. Each technician entry has: name, home base latitude, home base longitude, and Slack user ID. Pick the closest technician using great-circle distance (haversine formula, inline math is fine).
Once the closest tech is picked, use Slack's Open a Conversation with that technician's Slack user ID to get a DM channel, then use Slack's Send a Message to post the assignment. The message should include: customer name, customer phone, the formatted address returned by Nominatim, the distance in miles from the technician's home base (rounded to one decimal), and a one-tap Google Maps link built from the geocoded coordinates (https://www.google.com/maps/search/?api=1&query=LAT,LON).
Fallback rules: if the site address is blank on the submission, or Nominatim returns no result, or the closest technician is beyond a configurable max radius (default 30 miles), then instead of DMing a tech, use Slack's Send a Message to post to a fallback triage Slack channel (channel ID also configurable) with the raw submission fields so a human dispatcher can route it manually. Include the reason for the fallback (missing address / no geocode / out of radius).
Config values I want to be able to edit without touching workflow logic: the Jotform form ID, the technician list (name, home lat, home lon, Slack user ID for each), the max radius in miles, and the fallback triage channel ID. Respect Nominatim's fair-use rate limit (roughly 1 request per second) by pacing geocode calls if there are multiple new submissions in a single run.
Additional information
What does this prompt do?
- Every 10 minutes, checks your Jotform service request form for new submissions and turns each one into an assignment automatically.
- Picks the closest technician based on the customer's site address and each tech's home base, so no dispatcher has to eyeball a map.
- Sends the assigned technician a clean Slack DM with customer name, phone, formatted address, distance from their home base, and a one-tap Google Maps link.
- If an address is blank, cannot be found on the map, or nobody is within your maximum drive radius, the job gets posted to a fallback triage channel so a human can route it.
What do I need to use this?
- A Jotform account with the intake form you already use for service requests (customer name, phone, and site address).
- A Slack workspace where your technicians and dispatcher already work.
- A short list of your technicians with a name, home base location, and their Slack handle.
- A fallback Slack channel for jobs that need a human dispatcher.
How can I customize it?
- How often it checks for new submissions (every 10 minutes by default, but you can slow it to hourly or speed it up).
- The list of technicians and their home bases. Add, remove, or move someone at any time.
- The maximum distance you're willing to send a tech before the job gets kicked to your triage channel.
- Which Slack channel picks up jobs that need a human dispatcher, and what the fallback message looks like.
Frequently asked questions
Does this work with any Jotform intake form?
How does it know where each technician is based?
What happens if two technicians are the same distance away?
What if the customer's address is missing or cannot be located on the map?
Do my technicians need to install anything?
Related templates
Stop hand-assigning every service call.
Connect Jotform and Slack once, and Geni sends each new job straight to the closest technician with a map link ready to go.