Lead routing rules
@revopslab/lead-routing-rules
Design, test, and apply lead routing rules outside your CRM. Write ordered rules in a JSON file (existing-account match, partner, segment, region, junk filters), prove them with rule tests, then route a leads CSV with weighted round robin, out-of-office skips, and a fallback queue. Works with HubSpot, Salesforce, or any CSV.
- Activity
- New: be the first to try it
- Installs
- 0 installs
- Likes
- 0 likes
- Clones
- 0 clones
- 1# Lead routing rules
- 3Keeps your lead routing in one readable rules file, with tests that prove each rule works, and routes any leads CSV the same way every time. Weighted round robin, out-of-office skips, existing-account matching, and a fallback queue are built in.
- 5## Who it is for
- 7RevOps and marketing ops teams designing or debugging routing, and anyone routing a list from an event before importing it into HubSpot, Salesforce, or another CRM.
- 9## Example
- 11Input: `examples/routing-rules.json` (junk filter, personal email to nurture, partner leads, enterprise, mid-market, and SMB pools, one rep out of office), `examples/leads.csv` (10 leads), and `examples/accounts.csv`.
- 13Output: `out/routed.csv` with four new columns, for example:
- 15```text
- 16buyer@northwind.example,...,Rep A,owner,existing-account,existing account northwind.example
- 17cto@fabrikam.example,...,Rep A,pool,enterprise,"1,000+ employees"
- 18someone@gmail.com,...,nurture,queue,free-email-students,Personal email and no company size
- 19new@unknownco.example,...,routing-review,queue,fallback,no rule matched
- 20```
- 22And `out/routed-summary.json`: counts per rule and per person, rules nobody hit, and test results (5/5 pass).
- 24## What it can access
- 26- Runs `node scripts/route.mjs` (Node built-ins only, no network).
- 27- Reads `data/` (plus the kit's own `examples/`), writes `data/` (round robin state) and `out/`.
- 29## Setup
- 31None. Copy `examples/routing-rules.json` to `data/` and edit it, or ask Claude to write it from your routing policy.
