# 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.

- Workflow type: agent
- Services: HubSpot, TrueWay Geocoding, Slack Bot
- Categories: Sales
- Published: 2026-06-26

## What it does

- 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 you'll need

- 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.

## Prompt

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.

## How to customize

- 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.

## FAQ

### What happens if a contact only has a country or a postal code?

The workflow still tries to resolve the address with whatever it has and routes on the best match. If even the country cannot be matched to a region, it skips the rep handoff and posts a soft notice in a default channel so a human can pick the lead up.

### Will this overwrite the address fields in HubSpot?

It writes back cleaned, standardized values plus latitude, longitude, and the matched territory. Your original fields stay as they were unless you tell the workflow to replace them.

### How do I add a new region?

Edit the territory map in the prompt to add a region name, its countries or states, the owning rep, and the Slack channel to post into. The workflow picks up the change on the very next contact it sees.

### Does this work on HubSpot Free?

Yes. The workflow uses standard contact properties and the contact creation event, which are available on every HubSpot plan.

### Will the assigned rep actually get a notification?

Yes. The Slack message @-mentions the rep tied to that territory, so they get a direct ping on desktop and mobile, not just another message in a busy channel.

Use this prompt in General Input: https://www.generalinput.com/prompts/route-new-hubspot-contacts-to-the-right-regional-sales-rep