Automate Territory Performance Report — Weekly Manager Alert in n8n — Step by Step
Every Monday, a sales manager opens their pipeline dashboard and stares at fifteen territories, trying to guess which one is quietly bleeding out. The Northeast looks fine on total pipeline — but half
Every Monday, a sales manager opens their pipeline dashboard and stares at fifteen territories, trying to guess which one is quietly bleeding out. The Northeast looks fine on total pipeline — but half of it is stuck in "proposal sent" for 40 days. The Midwest rep closed nothing last week and nobody noticed. By the time a quarterly review surfaces the problem, three deals have gone cold and the region is a fire drill. Manual territory review doesn't scale, and human attention is the least reliable monitoring system you own. This article shows you how to build an automated Territory Performance Report in n8n that scores every territory by weighted pipeline each week and pings managers about at-risk regions before deals die.
The problem: territory risk is invisible until it's expensive
Raw pipeline totals lie. A territory sitting on $400K in open opportunities feels healthy — until you notice that number hasn't moved in three weeks, most of it is early-stage, and the deals that matter are aging past your average sales cycle. Total value hides three things that actually predict failure: stage weighting (early-stage dollars are not real dollars), momentum (is pipeline growing or decaying?), and deal aging (a $50K deal stuck 60 days is a warning, not an asset).
Managers running six to twenty territories can't hold this in their heads. So they default to gut feel and the loudest rep, and the quiet failing territory gets attention only after it misses quota. The fix isn't a bigger dashboard nobody opens — it's a scheduled job that does the weighting math for them and interrupts them only when a territory crosses a risk threshold. That's exactly what n8n is good at: pull data, score it, route the exceptions.
The solution: a weighted territory score, delivered every Monday
The workflow runs on a Monday-morning schedule. It pulls every open opportunity from your CRM, groups them by territory, and computes a single risk score per region using a weighted formula rather than a raw sum. A simple, battle-tested weighting:
Weighted pipeline = Σ (deal_amount × stage_probability × recency_factor), where stage_probability maps each pipeline stage to a win likelihood (e.g. Qualification 0.2, Proposal 0.5, Negotiation 0.8) and recency_factor decays deals that haven't had activity recently (e.g. 1.0 under 14 days, 0.7 under 30, 0.4 beyond). Each territory then gets a status: healthy, watch, or at-risk, based on how weighted pipeline compares to its quota coverage target and how it trends against last week.
Managers get one message summarizing all their territories, with at-risk regions pushed to the top and the specific reason each one is flagged (declining momentum, aging deals, coverage below target). No dashboard login required. The alert comes to them.
Step-by-step setup in n8n
1. Trigger — Schedule Trigger node. Set it to fire weekly on Monday at 07:00. Use the Cron expression 0 7 * * 1. This gives managers the report before their week planning, not buried in Monday afternoon.
2. Pull the data — HTTP Request or your CRM node. If you use HubSpot, Salesforce, or Pipedrive, use the native node (e.g. the Pipedrive node → Get All Deals, filtered to status = open). For any other CRM, use the HTTP Request node against the deals endpoint. Enable Return All / pagination so you get the full open pipeline, not just page one. Request the fields you need: amount, stage, territory/owner region, and the last-activity timestamp.
3. Normalize and score — Code node. Add a Code node (JavaScript) that iterates the deals and computes each deal's weighted value. Define your stageProbability and recencyFactor maps at the top so they're easy to tune. Compute daysSinceActivity from the current date minus the last-activity field, then multiply amount × probability × recency. Emit one item per deal carrying its territory and weighted value.
const stageProb = { Qualification: 0.2, Proposal: 0.5, Negotiation: 0.8 };
const recency = d => d <= 14 ? 1 : d <= 30 ? 0.7 : 0.4;
return items.map(i => {
const deal = i.json;
const days = (Date.now() - new Date(deal.last_activity)) / 86400000;
const weighted = deal.amount * (stageProb[deal.stage] || 0.1) * recency(days);
return { json: { territory: deal.territory, weighted, days, amount: deal.amount } };
});
4. Group by territory — Item Lists / Aggregate node. Use the Aggregate node (or a second Code node) to sum weighted pipeline per territory and count deals aging past 30 days. Compare each territory's total to its quota-coverage target (store targets in a Set node or a small config object) and against last week's value, which you persist between runs.
5. Persist last week's numbers — a stored value. To measure momentum you need last week's score. Write each run's per-territory totals to a lightweight store: a Google Sheets append, an Airtable record, or n8n's static workflow data. On the next run, read the previous week and compute the delta. This turns a snapshot into a trend, which is where the real signal lives.
6. Classify and filter — IF / Switch node. Add a Switch node that labels each territory healthy / watch / at-risk based on your thresholds (e.g. at-risk = coverage below target OR week-over-week decline > 15% OR more than three deals aging past 30 days). Route at-risk and watch territories into the alert branch.
7. Format and send — Set node + Slack/Email/WhatsApp. Build the message in a Set or Code node: lead with at-risk regions, one line each with the flagged reason and the weighted number. Deliver with the Slack node (post to each manager's channel or DM), the Send Email node, or an HTTP Request to a WhatsApp API. Route by manager using a lookup so each person sees only their territories.
Benefits: what changes once this runs
Risk surfaces early. A territory that's decaying gets flagged the Monday it starts declining, not at quarter-end. That's the difference between a coaching conversation and a missed number.
Attention goes where it's needed. Managers stop scanning healthy territories and spend their time on the two that are actually at risk. The report does the triage.
The math is consistent. Every territory is scored the same way, every week. No more "the Southeast looks fine" based on a raw total that's mostly stalled early-stage deals.
Zero manual effort. Once it's live, the report builds and sends itself. No one has to remember to run it, and it never skips a Monday because someone was on PTO.
Common pitfalls to avoid
Trusting raw pipeline totals. If you skip the stage-probability and recency weighting, you've rebuilt the exact dashboard that already fails managers. The weighting is the whole point — don't shortcut the Code node.
Forgetting pagination. The single most common bug: the CRM node returns 100 deals, your biggest territory has 300, and half the pipeline silently vanishes. Always enable Return All and verify counts on the first run against your CRM's reported total.
No persistence, no momentum. Without storing last week's numbers you can only ever report a snapshot. Set up the Google Sheets or Airtable store on day one — retrofitting trend data later means starting the history from scratch.
Alerting on everything. If every territory generates a line and every manager gets the full list, people tune it out within two weeks. Filter to watch and at-risk only. A quiet week should produce a short message — or no message at all.
Timezone drift on the schedule. Set your n8n instance timezone explicitly (Settings → Timezone) so the Monday 07:00 trigger fires in your managers' local time, not UTC. A report that lands at 2 a.m. gets buried.
Stale stage mappings. If sales renames or adds pipeline stages, your stageProbability map falls out of sync and unmapped stages default to near-zero, understating real pipeline. Review the mapping whenever your CRM stages change.
Build it once and every Monday your managers open a message that already did the analysis — territories ranked by real risk, reasons attached, cold deals caught while they're still warm. That's a monitoring system that doesn't depend on anyone remembering to look.
Ja construimos isso pra voce
Nao comece do zero. O Territory Performance Report — Weekly Manager Alert e um workflow n8n pronto para instalar — conecta suas ferramentas em minutos, sem codigo.
Instalar por $79 →