Skip to content

Create or update a territory custom object record when an account is assigned to a territory

One of 565 written HubSpot workflow specs, by a collective of independent HubSpot consultants.

Enterprise

Seat pricing: Enterprise edition. To build it, a GTM Seat or an Ops Seat (an Ops Seat cannot create marketing emails or sequences). Per-hub plans: Sales Hub Enterprise.

Custom4 stepsUpdated for HubSpot seat pricing
OutcomeEvery distinct territory value used on companies gets exactly one Territories record with a running account count, instead of sales ops keeping a separate spreadsheet of who owns which patch.
Workflow mapsales-ops-022
Company Territory property changes leads to Custom code: find or create territory record, adjust counts. Custom code: find or create territory record, adjust counts leads to Sync failed?. Sync failed? leads to Yes: Notify sales ops of failure; No: End, counts and associations updated. Yes No Company Territory property changes Custom code: find or create territory record, adjust counts Sync failed? Notify sales ops of failure End, counts and associations updated
Company Territory property changes leads to Custom code: find or create territory record, adjust counts. Custom code: find or create territory record, adjust counts leads to Sync failed?. Sync failed? leads to Yes: Notify sales ops of failure; No: End, counts and associations updated. Yes No Company Territory property changes Custom code: find or create territory record, adjust counts Sync failed? Notify sales ops of failure End, counts and associations updated

When to use it, when not to

Use it

  • Use it when territory reporting needs to live on a record you can associate other objects to (deals, contacts, tasks) rather than staying stuck as a text or enumeration value on the company alone.
  • Use it once your Territory values are stable and standardized (a fixed list, not free text) so one company value maps to exactly one territory record.
Read more on when to use itShow less

Skip it

  • Do not use it if your territory model changes shape often (frequent re-splits, renames); every rename means a new territory record accumulates unless you actively archive the old one, since this workflow only creates or increments, it never merges or renames existing records.
  • Do not build this if you only need territory reporting inside a dashboard filter on the company property itself; a dedicated custom object is worth it mainly when you need to associate other records (like a territory owner's tasks or plan documents) to the territory itself.
Read more on when to skip itShow less

The rest of this spec

Prerequisites · 5 items

Every property with its label, internal name, type and options, plus the assets the workflow needs.

Enrollment · 4 parts

The trigger, the criteria as ticked in the UI, the re-enrollment rule and the suppression list.

Steps · 4 numbered actions

Each action in order with its parameters, branches and delays.

Known pitfalls · 5

Traps seen in production, each with what breaks and what to do instead.

Test plan and UAT script · 4 cases, 3 variants

How to prove it works in a test portal, one case per branch, and a sign-off sheet.

Files · PDF, Markdown, JSON, CSV, code

The properties JSON creates the fields in one call. The workflow JSON documents the build. The custom coded action ships as a ready-to-paste .js file.

Install · 1 click, switched off

The installer creates the properties and the workflow, switched off, then opens a task for what it cannot create. Nothing is deleted, enabled or enrolled.

Unlock all 565 specs, 149 EUR

One-time, excl. VAT. 30-day refund. Installs in 3 portals. Founding price until 30 November.

Read the free Sales ops spec

Read 12 complete specs before you pay.

One per category, same format as the paid ones. Email only, no card.

We email the link, then a short note when specs change. Nothing else.

149 EUR199

Full library, 565 specs
Get the full library