Filter Typeform leads by service area with a drive-time map
The moment someone fills out your intake form, check if their address is inside your service area and post a Slack alert with drive time and a map.
Build me an agent workflow that qualifies inbound Typeform leads by whether they fall inside my service area, so my ops team stops wasting time on leads we can't reach.
Trigger: a Typeform webhook, fired every time someone submits my intake form. The form collects the prospect's name, phone, service they want, and an address (street, city, state, zip). Configure the webhook end-to-end so I don't have to touch the Typeform dashboard.
Configurable inputs I want to set once at setup time:
- My HQ / dispatch address (or its longitude,latitude).
- Service-area drive-time in minutes (default 30).
- Slack channel id for qualified leads.
- Slack channel id for out-of-area leads (also used for ambiguous / ungeocodable addresses).
- A short 'suggested next action' string to append to qualified-lead messages (e.g. 'call within 5 minutes').
On each submission, do this:
1. Pull the address, name, phone, and requested service out of the Typeform payload.
2. Call Mapbox Forward Geocode (v6) on the lead's address to get its longitude,latitude. Prefer high-confidence matches; if the result is ambiguous, low-confidence, or empty, skip to the 'needs manual review' branch below (do not silently drop the lead).
3. Call Mapbox Get Isochrone from my HQ coordinates for the configured drive-time (minutes contour, driving profile) to get the service-area polygon.
4. Determine whether the geocoded lead point sits inside that isochrone polygon (standard point-in-polygon check).
5. Call Mapbox Get Directions from HQ to the lead's coordinates (driving-traffic profile) to get a live drive-time in minutes and distance.
6. Call Mapbox Get Static Map Image to render a PNG that overlays: the isochrone polygon (semi-transparent fill), an HQ marker, and a lead marker. Size it for Slack (about 800x500).
Then branch:
- Inside service area: post a Send a Message to the qualified-leads Slack channel with the lead's name, phone, requested service, formatted address, live drive time in minutes, and the static-map image. End with the configured 'suggested next action' line so the on-call rep knows exactly what to do.
- Outside service area: post a briefer Send a Message to the out-of-area Slack channel with the address and drive time so ops has a paper trail. Include the static map so we can eyeball whether it's worth making an exception.
- Ambiguous or ungeocodable address: post to the out-of-area channel with the raw address, the Typeform response id, and a clear 'needs manual review' note. Do not drop the lead silently.
Keep the message formatting clean and scannable in Slack (fielded key/value lines, not a wall of text). Every submission should end up posted somewhere so nothing is lost.
What does this prompt do?
- Watches your Typeform intake form and reacts the second someone submits it.
- Turns the lead's address into a location, then checks whether it sits inside a drive-time zone around your office (default 30 minutes).
- Posts qualified leads to your 'new qualified leads' Slack channel with contact info, requested service, live drive time, and a map preview.
- Posts out-of-area leads to a separate Slack channel so ops has a paper trail and can decide whether to make an exception.
What do I need to use this?
- A Typeform account with an intake form that collects address, name, phone, and the service the lead is asking about.
- A Mapbox account (free tier works for most small businesses).
- A Slack workspace with two channels: one for qualified leads, one for out-of-area leads.
- The address of your office or dispatch hub, and how many minutes of drive time you consider 'in service area'.
How can I customize it?
- Change the drive-time radius. 30 minutes is the default; bump it to 45 or 60 for wider coverage, or drop to 15 for dense urban service areas.
- Pick which Slack channels get qualified leads versus out-of-area leads, and tune the message copy for each.
- Add a suggested next action to the qualified-lead message, like 'call within 5 minutes' or a booking link for the requested service.
FAQs
What happens if the address is misspelled or too vague to place on a map?
Do I need to build a map or do any coding?
Can I use this for a business that isn't home services?
Will out-of-area leads be lost forever?
How fast does it react to a new form submission?
Related templates
When someone leaves, we check which shared passwords they used in their final months and post a ranked rotation list to your security channel.
Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.
Twice every weekday, the conversations from your social inbox land on the right HubSpot contact timelines, with a Slack recap for sales.
Every morning, find the addresses that hard bounced or filed a spam complaint, update the matching HubSpot contacts, and post a short Slack recap.
Every weekday at 4pm, spot the threads that went quiet, stage a ready-to-send nudge in your mailbox, and get a ranked Slack recap.
When you merge a fix in GitHub, this agent checks the matching dead-letter queue, replays the failed messages, and reports back on the pull request and in Slack.
Stop wasting sales time on leads you can't serve.
Connect Typeform, Mapbox, and Slack once. Every new intake gets gated by your service area and lands in the right channel with a map.