Route new HubSpot leads to the right sales territory

When a new contact lands in HubSpot, we work out where they are connecting from, note the company behind it, and post them to the right territory channel.

Agentic Task
HubSpotIPinfoSlack BotSalesLead EnrichmentNotifications & Alerts
PromptCreate

Whenever a new contact is created in HubSpot, look up where that lead is connecting from, save what I learn back onto the contact, and route them to the right sales territory channel in Slack. Use a poll trigger on HubSpot for newly created contacts.

HubSpot records the visitor IP address on the contact, so the new contact from the trigger already carries what the lookup needs and there is no extra fetch. Read the IP address from the contact. If the contact has no IP address, or the address is a private or non routable one, skip that contact and do nothing.

Run the IPinfo Get Full IP Details operation on that address to resolve the city, region, country and timezone.

Then run the IPinfo Core / Plus IP Lookup on the same address to surface the company and network owner behind it, along with the privacy and network type flags that say whether this is a residential ISP connection or a datacenter or hosting range.

If the lookup shows the address belongs to a VPN, a proxy, a Tor exit node, or a hosting or datacenter provider, do not assign a territory. The location is not trustworthy enough to route on. Flag the lead for manual review instead: post it to the manual review channel in Slack with the contact details, the raw location, the network owner, and the reason it was held back. Do not post it to a territory channel.

For every other lead, write the resolved country, region, timezone and network owner back onto the contact with the HubSpot Update Contact operation.

Then run HubSpot Search Companies on the organisation name behind the IP to check whether that account already exists in my CRM, so we do not open a duplicate account. Treat a confident name match as an existing account and anything else as net new. Do not create a company record either way; this step is only a check.

Finally, post to the Slack channel for the matching sales territory using the Slack Bot Send a Message operation. Map the resolved country to a territory: Europe, the Middle East and Africa go to the EMEA channel, North and South America go to the AMER channel, and Asia Pacific countries go to the APAC channel. If the country does not map cleanly to one of the three, send it to the manual review channel rather than guessing.

Each territory message should name the contact and their email, the city, region and country the lead is connecting from, the inferred company and network owner, and whether that organisation is an existing account or net new. Keep it to a short readable summary a rep can act on, and link to the HubSpot contact record where possible.

Additional information

What does this prompt do?
  • Watches HubSpot for new contacts and works out where each one is connecting from, including city, region, country and time zone.
  • Identifies the company or network behind the connection and checks whether that organisation is already an account in your CRM.
  • Saves the location and network owner onto the contact record, then posts the lead to the matching territory channel in Slack: EMEA, AMER or APAC.
  • Flags leads connecting through a VPN or a hosting provider for manual review, because their location is not reliable enough to assign a territory.
What do I need to use this?
  • A HubSpot account where new contacts are created, with the visitor IP address recorded on the contact record.
  • An IPinfo account. A free account covers the basic location lookup; the company details and VPN detection come with a paid plan.
  • A Slack workspace with a channel for each sales territory you route to, plus one channel for leads held back for manual review.
How can I customize it?
  • Change the territory map. The default splits EMEA, AMER and APAC by country, but you can route by region or by individual country, or add more territories.
  • Choose which channel each territory posts to, and where flagged leads go for manual review.
  • Decide which details get saved onto the contact. Country, region, time zone and network owner are the defaults.

FAQs

Will this work on HubSpot Free?
Yes. It only reads new contacts and updates standard fields on the contact record, so any HubSpot plan you can connect will work.
Where does the location actually come from?
HubSpot records the IP address of visitors who fill in your forms or browse your site with tracking enabled. We look that address up to work out the country, region and time zone. Contacts that were imported from a list or typed in by hand often have no IP address, and those are simply skipped.
What happens if someone is browsing through a VPN?
They get flagged for manual review instead of being routed. A VPN or a company data centre puts the lead somewhere they are not, so assigning a territory from it would send the lead to the wrong team. Those leads go to a separate review channel with the details, so a human can decide.
Is location from an IP address accurate enough to assign a territory?
Country level is reliable, which is what territory routing needs. City level is a good hint but can be off, especially on mobile networks, so the routing decision is made on the country and the city is shown as context only.
Will it create duplicate companies in my CRM?
No. Before posting, it searches your existing companies for the organisation behind the connection and labels the lead as an existing account or net new. It never creates a company record on its own.

Related templates

Chase past-due JobNimbus invoices with escalating emails

Every weekday, find every unpaid JobNimbus invoice, email each customer one reminder that gets firmer as it ages, and post a receivables summary to Slack.

JobNimbus
Gmail
Slack Bot
Agentic Task
Flag at-risk students in Canvas before they fall behind

Every weekday at 7am, your active courses are checked for missing work, silent logins, and slipping grades, with a ranked list sent to your advising channel.

Canvas
Google Sheets
Slack Bot
Agentic Task
Catch Jira service desk tickets before their SLA runs out

Every hour, find the tickets closest to breaching, leave a nudge on each one, and post a ranked at-risk list to your support channel.

Jira Service Management
Slack Bot
Agentic Task
Send Canvas students a kind nudge about missing work

Every weekday afternoon, each student who is behind gets a warm, personal message in their Canvas inbox listing exactly what they owe.

Canvas
Slack Bot
Agentic Task
Weekly Canvas grading backlog report in Slack and Sheets

Every Monday at 8am, see exactly which assignments have work waiting, sorted worst first, posted to Slack and logged to a spreadsheet.

Canvas
Slack Bot
Google Sheets
Deterministic Code
Revoke Bitwarden access when someone leaves in BambooHR

Every weekday morning we compare your password vault against your HR records and suspend access for anyone who has already left.

Bitwarden
BambooHR
Slack Bot
Agentic Task

Stop guessing which rep owns an inbound lead.

Every new contact lands in the right territory channel, already enriched and checked against your CRM.