---
name: ravn-territory-planning
description: Use when a sales leader wants a territory mapped, listing companies by state, industry and size and then the decision makers at the best-fit accounts.
title: Sales Territory Planning by State and Industry — Ravn
---
# Territory planning

Map a sales territory in two stages. First size it with `search_companies` (which companies, how many, how big), then pick the best-fit accounts and find decision makers at those with `search_people`. The user gets a ranked account list and a contact list per rep.

## When to use

- A new rep is taking over a region and needs a starting account list.
- A sales leader is splitting states or industries between reps and wants to see how big each patch is.
- "Which manufacturing companies with 201-500 staff are in Ohio and Michigan, and who runs operations there?"

## Before you start

1. Check the connection: call `get_account` with `{}` or run `npx ravn whoami`.
2. `search_companies` and `search_people` need your own provider key connected — run `ravn keys add pdl` first; these tools run on your own provider account. If a tool returns 403 `provider_key_required`, stop and tell the human to add their key. `validate_emails` is ours and needs no key. Every call is one lookup; misses are free.
3. A territory can be large. The `total` field tells you how many matches exist without pulling them all. Pull only what the reps will work.
4. Agree an account count per rep with the user.

## Steps

1. Define the territory: states (or countries and cities), industries, `employee_range` values (1-10, 11-50, 51-200, 201-500, 501-1000, 1001-5000, 5001+), and industries to exclude.
2. Size it with a small first page:

```json
{
  "state": ["Ohio", "Michigan"],
  "industry": ["manufacturing"],
  "employee_range": ["201-500"],
  "exclude_industry": ["government"],
  "limit": 5
}
```

Report `total` to the user. If it is far too big or too small, adjust the filters before pulling more.
3. Pull accounts in pages of up to 25, passing `next_cursor` back as `cursor`, until you reach the agreed count.
4. Remove existing customers and open deals if the user provides a list of their domains.
5. Rank the accounts with the user's priorities, for example size first, then industry fit, then city. Assign them to reps (by state, by city cluster or round-robin, as the user prefers).
6. For the top accounts, find decision makers in batches of about 8 to 10 domains:

```json
{
  "company_domain": ["plant-one.com", "midwestparts.com"],
  "department": ["operations"],
  "seniority": ["Director", "VP", "C Suite"],
  "limit": 10
}
```

7. Verify the emails you plan to use with one `validate_emails` call. Keep `valid`, mark `risky` and `unknown` for review.

## Output

- `accounts.csv`: `rep`, `rank`, `name`, `domain`, `industry`, `size`, `employee_count`, `city`, `state`, `country`, `founded`, `linkedin_url`, `naics_codes`.
- `contacts.csv`: `rep`, `account_domain`, `full_name`, `title`, `seniority`, `linkedin_url`, `email`, `rw_verdict`, `rw_risk_score`.
- A territory summary: filters, `total` matches, accounts pulled, accounts per rep, contacts found, verified emails, and lookups used.

## Rules

- Pull a working territory, not a full database export. Stop at the agreed account count.
- People who opted out are removed from the data; also skip anyone the user says asked not to be contacted. See [/privacy#optout](https://askravn.com/privacy#optout).
- Drop invalid and risky emails before outreach.
- No FCRA uses.
- On a 429 `fair_use_exhausted` or a 403 `provider_key_required`, stop, save what you have and tell the human.

## Example prompt

> I'm hiring two reps for the Midwest. Build me a territory plan: manufacturing companies with 201-500 employees in Ohio, Michigan and Indiana, split between two reps, with the head of operations at the top 30.
