Route new HubSpot contacts to the right regional sales rep

By General Input

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.

Integrations

  • HubSpot
  • TrueWay Geocoding
  • Slack Bot

Type

Agentic Task

Categories

  • Sales

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.

Related prompts

Explore more prompts
A brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasoniMessage campaign console with pre-flight checks and delivery boardLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsA searchable RFP answer library your bid team drafts fromLinkedIn Ads budget pacing dashboard for every client account