Route new HubSpot contacts to the right regional sales rep
When a new contact lands in HubSpot, turn their address into clean coordinates, write the territory back, and hand the lead off in the right regional Slack channel.
Build an agent that routes brand-new HubSpot contacts to the right regional sales rep by geocoding their address.
Trigger: a HubSpot webhook on the contact.creation event so the workflow fires the moment a new contact is created.
What the agent should do on every event:
1. Call HubSpot Get Contact to pull the full record, including address, city, state, postal code, country, plus name, email, company, and the HubSpot record URL.
2. Call TrueWay Geocoding's forward geocode to convert that address into latitude, longitude, and a cleaned, standardized city, state, postal code, and country. If only partial data is available (e.g. postal code only, or country only), geocode whatever is there and use the best match.
3. Match the resolved location against this territory map to pick the assigned rep and Slack channel:
- US Northeast | owner @sarah-northeast | #leads-northeast | states CT, MA, ME, NH, NJ, NY, PA, RI, VT
- US South | owner @marcus-south | #leads-south | states AL, AR, FL, GA, KY, LA, MS, NC, SC, TN, TX, VA, WV
- US Midwest | owner @priya-midwest | #leads-midwest | states IL, IN, IA, KS, MI, MN, MO, NE, ND, OH, SD, WI
- US West | owner @diego-west | #leads-west | states AK, AZ, CA, CO, HI, ID, MT, NV, NM, OR, UT, WA, WY
- EMEA | owner @emma-emea | #leads-emea | all European, Middle Eastern, and African countries
- APAC | owner @kenji-apac | #leads-apac | all Asia-Pacific countries
4. Call HubSpot Update Contact to write back the cleaned address components, latitude, longitude, and a territory property set to the matched region name.
5. Post a message into the matched regional Slack channel that @-mentions the rep and includes the contact name, company, email, the resolved city/state/country, a one-line summary of who the lead is, and a clickable link back to the HubSpot contact record.
Edge cases to handle gracefully: if the address cannot be resolved at all, or the resolved country does not map to any region in the territory map, skip the rep handoff and post a clear notice in a default #leads-unrouted Slack channel so a human can pick it up. Never guess a rep when the territory is ambiguous.
Use the Slack Bot integration (not the user Slack one) so the handoff message is clearly attributed to the bot and works even if the person who set up the workflow leaves the company.
Additional information
What does this prompt do?
- Watches for new contacts created in HubSpot and pulls their full address details.
- Turns messy or partial addresses into clean coordinates plus a standardized city, state, postal code, and country.
- Matches every new contact to one of your sales territories and the rep who owns it.
- Writes the cleaned address and territory back to HubSpot and posts a handoff in the matching regional Slack channel that @-mentions the rep.
What do I need to use this?
- A HubSpot account where you can read and update contact properties.
- A TrueWay Geocoding account from RapidAPI for address lookups.
- A Slack workspace with one channel per region you want to route into.
- A list of your territories and which sales rep owns each one.
How can I customize it?
- Edit the territory map at the top of the prompt to match your regions, reps, and Slack channels.
- Adjust what goes into the Slack handoff message, like the lead summary, custom fields, or rep mentions.
- Pick what happens when an address cannot be resolved, such as routing to a default rep or posting a soft alert for a human to pick up.
Frequently asked questions
What happens if a contact only has a country or a postal code?
Will this overwrite the address fields in HubSpot?
How do I add a new region?
Does this work on HubSpot Free?
Will the assigned rep actually get a notification?
Related templates
Stop hand-routing every new lead to the right rep.
Connect HubSpot, TrueWay Geocoding, and Slack once, and Geni hands every new contact off to the owning regional rep within seconds.