How to Set Up Average Deal Size Monitor — Weekly Trend Alert in n8n

Your average deal size is the fastest-moving signal in your revenue engine — and the one nobody watches until it's too late. A 12% drop over three weeks doesn't trigger any dashboard alarm, but it qui

How to Set Up Average Deal Size Monitor — Weekly Trend Alert in n8n

Your average deal size is the fastest-moving signal in your revenue engine — and the one nobody watches until it's too late. A 12% drop over three weeks doesn't trigger any dashboard alarm, but it quietly erases a quarter of your pipeline value. By the time it shows up in a monthly board deck, you've already lost the window to react. This guide shows you how to build an automated Average Deal Size Monitor in n8n that tracks your ACV week over week, compares it against a rolling 3-month baseline, and pings sales ops the moment it drifts more than 10% in either direction.

The Problem: Deal Size Drift Is Invisible Until It's Expensive

Most sales teams monitor deal count and total revenue. Both are lagging, both are noisy, and neither tells you why a number moved. Average deal size is different — it's a compositional metric that reveals what kind of business you're actually closing.

When it shrinks, one of a few things is happening: reps are discounting harder to hit quota, your inbound mix has shifted toward smaller accounts, or a competitor is undercutting you on your enterprise tier. When it grows unexpectedly, you might be over-indexing on a handful of whales and starving your repeatable mid-market motion. Either way, the drift matters more than the absolute number.

The catch is that ACV is volatile week to week. One $80k deal in a slow week spikes the average; a burst of small self-serve conversions tanks it. Staring at raw weekly numbers gives you whiplash and false alarms. What you need is a baseline — a smoothed 3-month average — and an alert that only fires when the current week deviates enough to be signal, not noise. Nobody has time to compute that by hand every Monday, which is exactly why it never gets done.

The Solution: A Self-Running Weekly Trend Alert

The workflow runs on a schedule (weekly is the sweet spot), pulls your closed-won deals from your CRM, and computes two figures: the current-period average deal size and the trailing 3-month baseline average. It then calculates the percentage delta between them. If the delta exceeds your threshold — the template ships with 10% — it sends a formatted alert to Slack, email, or wherever sales ops lives.

Crucially, the alert isn't just "the number changed." It tells you the direction (growing / shrinking), the magnitude (+/- X%), the current value, the baseline value, and the deal count behind each — so ops can immediately tell whether the shift is real or a small-sample artifact. This is the difference between an alert people act on and one they mute after a week.

Because it's built in n8n, it's CRM-agnostic. Whether your deals live in HubSpot, Pipedrive, Salesforce, or a Postgres table, you swap one node and the logic downstream stays identical.

Step-by-Step Setup in n8n

Here's how the workflow is wired. Five nodes do the entire job.

1. Schedule Trigger. Add a Schedule Trigger node set to run weekly — Monday at 07:00 is a good slot so the number is waiting when ops opens their week. Use the Cron expression 0 7 * * 1 if you want fine control over timezone behavior.

2. Fetch closed-won deals. Add your CRM node — for HubSpot, use the HubSpot node with resource Deal and operation Get All. Filter on dealstage = closedwon and pull deals with a close date in the last ~90+ days (enough to cover both the current week and the 3-month baseline). Map at minimum two fields: the deal amount and the closedate. For Pipedrive use the Pipedrive node (Get All Deals, status won); for Salesforce, a Salesforce query node with SOQL SELECT Amount, CloseDate FROM Opportunity WHERE IsWon = true AND CloseDate = LAST_N_DAYS:100.

3. Compute the averages. Add a Code node (JavaScript). This is the brain. Split deals into two buckets by close date — the current 7-day window and the full trailing 90-day baseline — then average each:

const now = new Date();
const weekAgo = new Date(now - 7*864e5);
const baseStart = new Date(now - 90*864e5);
const deals = items.map(i => ({amt: Number(i.json.amount)||0, date: new Date(i.json.closedate)}));
const cur = deals.filter(d => d.date >= weekAgo);
const base = deals.filter(d => d.date >= baseStart);
const avg = a => a.length ? a.reduce((s,d)=>s+d.amt,0)/a.length : 0;
const curAvg = avg(cur), baseAvg = avg(base);
const delta = baseAvg ? ((curAvg-baseAvg)/baseAvg)*100 : 0;
return [{json:{curAvg, baseAvg, delta, curCount:cur.length, baseCount:base.length}}];

4. Gate on the threshold. Add an IF node. Set the condition to Number, value {{ Math.abs($json.delta) }}, operation larger, second value 10. Only deltas beyond ±10% pass through to the alert. Everything else exits quietly — no news is good news, and no alert fatigue.

5. Send the alert. On the true branch, add a Slack node (or Send Email / Gmail). Build a message from an expression so it reads like a human wrote it:

{{ $json.delta > 0 ? '📈 GROWING' : '📉 SHRINKING' }} Avg deal size {{ $json.delta.toFixed(1) }}% vs 3-mo baseline.
This week: ${{ Math.round($json.curAvg) }} ({{ $json.curCount }} deals)
Baseline: ${{ Math.round($json.baseAvg) }} ({{ $json.baseCount }} deals)

Save, then click Test Workflow to run it once against live data. Confirm the numbers match a manual spot-check in your CRM, then toggle the workflow Active. That's it — it now runs itself every Monday.

Why This Beats a Dashboard

Dashboards are pull; this is push. A dashboard requires someone to remember to look, interpret the number, and know what "normal" is. This workflow inverts that: it stays silent until something is worth your attention, then it hands you a pre-interpreted, direction-and-magnitude alert in the channel you already live in.

The baseline comparison is what makes it trustworthy. Raw weekly ACV bounces around too much to act on, but measured against a 90-day mean, a >10% move is genuinely unusual. You catch discount creep before it's a quarter-wide habit, spot a shift in lead quality within a week instead of a month, and get early warning when a pricing change moves your mix. For technical founders and lean ops teams, it replaces a recurring manual analysis nobody has bandwidth for — and it costs nothing to run once it's live.

Common Pitfalls to Avoid

Small-sample false alarms. In a slow week with two closed deals, one outlier swings the average wildly. Guard against it: in the IF node, add a second condition requiring curCount to be at least 3–5 before an alert fires. The template exposes this as a config value.

Timezone drift in date math. CRM close dates and your n8n server may be in different timezones, causing deals to land in the wrong week bucket. Normalize everything to UTC in the Code node, and set your Schedule Trigger's timezone explicitly in the node settings rather than relying on the instance default.

Currency mixing. If you sell in multiple currencies, averaging raw amount fields blends dollars and euros into nonsense. Pull the normalized/converted amount field your CRM provides (HubSpot's amount_in_home_currency, for example) so every deal is measured on the same scale.

Overlapping windows are intentional — don't "fix" them. The current week is a subset of the 90-day baseline, which slightly dampens the delta. That's a feature: it keeps the baseline stable and prevents the current week from being compared against a version of itself that excludes it. Leave it as-is unless you have a specific reason to use a non-overlapping trailing window.

Pagination limits. CRM "Get All" operations often cap at 100 records per call. If you close more than that in 90 days, enable the node's Return All option or handle pagination — otherwise your baseline silently truncates and every delta is wrong.

Average Deal Size Monitor — Weekly Trend Alert
PRONTO PARA USAR

Ja construimos isso pra voce

Nao comece do zero. O Average Deal Size Monitor — Weekly Trend Alert e um workflow n8n pronto para instalar — conecta suas ferramentas em minutos, sem codigo.

Instalar por $59 →