Automate Real-Time Quota Attainment Alerts — HubSpot + Slack in n8n — Step by Step
Your reps hit quota on the last day of the month — and you find out three days later when the CRM report finally runs. By then the deal that could have been pulled forward is gone, the rep who stalled
Your reps hit quota on the last day of the month — and you find out three days later when the CRM report finally runs. By then the deal that could have been pulled forward is gone, the rep who stalled at 60% got no nudge, and your forecast was a guess. Quota attainment is the single most important number in a sales org, yet most teams check it on a lag. This article shows you how to make it real-time: a Slack message the moment a deal closes, and an automated 9am risk report that names every rep who's about to miss — built entirely in n8n on top of HubSpot and Slack.
The problem: quota data that arrives too late to act on
Attainment is only useful if it changes behavior while there's still time to change the outcome. The typical setup fails this on two fronts.
First, visibility is batched. Managers pull a HubSpot report Monday morning, or wait for the weekly pipeline review. A deal that closed Wednesday sits invisible for five days. Momentum — the thing you most want to reinforce — goes uncelebrated, and the psychological lift of "we just closed" never reaches the room.
Second, risk is diagnosed in hindsight. You learn a rep missed quota after the month ends, when the only available response is a post-mortem. What you actually need is a mid-month signal: "Marcus is at 48% with 9 selling days left and only $12k in the pipeline." That's a number you can coach against on the 18th. On the 1st it's just an obituary.
The fix isn't a better dashboard. Dashboards are pull — someone has to remember to look. You want push: the data comes to the team, in the channel they already live in, at the moment it matters.
The solution: two flows, one Slack channel
This template is built from two independent n8n workflows that share the same HubSpot connection and the same Slack channel.
Flow 1 — Real-time close alerts. The instant a deal moves to Closed Won in HubSpot, n8n receives the event, looks up the deal owner, recalculates that rep's month-to-date attainment against their quota, and posts a formatted message to Slack: who closed what, and where they now stand against target.
Flow 2 — The 9am risk sweep. Every morning at 9:00, n8n pulls every rep's closed-won total for the current month, compares it to their quota and to how much of the month has elapsed, and flags anyone whose pace puts them at risk of missing. It posts a single digest — attainment leaderboard plus an at-risk callout — so the day starts with a shared picture of reality.
Together they cover both halves of quota management: celebrate and reinforce wins as they happen, and surface risk early enough to do something about it.
Step-by-step: building it in n8n
Here's the node-by-node structure. You'll build two workflows; they don't depend on each other, so you can ship Flow 1 first and add Flow 2 later.
Flow 1 — deal-close alerts
1. Trigger — HubSpot Trigger node. Add the HubSpot Trigger node and authenticate with your HubSpot OAuth2 or Private App token. Set the event to Deal — Property Changed, watching the dealstage property. HubSpot registers a webhook automatically, so closes arrive within seconds — no polling.
2. Filter — IF node. Deal-stage changes fire for every pipeline move, so gate it. Add an IF node checking that dealstage equals your closed-won stage ID (in HubSpot it's an internal ID like closedwon or a numeric ID for custom pipelines). Only the true branch continues.
3. Enrich — HubSpot node (Get Deal + Get Owner). The trigger payload is thin. Add a HubSpot node set to Deal → Get to pull amount, hs_deal_owner, and closedate, then a second call to Owner → Get to resolve the owner ID into a name and email.
4. Calculate — Code node. Add a Code (JavaScript) node that fetches the rep's month-to-date closed-won total and divides by their quota. Store quotas in a simple map inside the node, in an n8n data table, or in a Google Sheet read via the Google Sheets node. Output attainmentPct, mtdClosed, and quota.
5. Notify — Slack node. Add a Slack node set to Message → Send, target your #sales-wins channel, and use Block Kit for a clean layout: 🎉 {{owner}} closed {{dealName}} — ${{amount}} on the header, then a context line Now at {{attainmentPct}}% of ${{quota}} quota ({{mtdClosed}} MTD). Use expressions to pull each value from the prior nodes.
Flow 2 — the 9am risk sweep
1. Trigger — Schedule Trigger node. Add a Schedule Trigger set to a Cron expression 0 9 * * 1-5 (weekdays at 9:00). Set the workflow timezone in Settings so 9am means your 9am.
2. Pull — HubSpot node (Search Deals). Use Deal → Get Many (or Search) with a filter for dealstage = closedwon and closedate within the current month. Enable Return All so you're not capped at the first page.
3. Aggregate — Code node. Group deals by owner, sum amount per rep, and join against the quota map. Then compute the pace flag: expectedPct = (dayOfMonth / businessDaysInMonth), and mark a rep at risk when attainmentPct < expectedPct - 15. Emit a sorted array — leaderboard plus an atRisk list.
4. Format & post — Slack node. Build one Block Kit digest: a ranked attainment list at the top and a ⚠️ At risk of missing section naming each flagged rep with their gap. Post to #sales-daily. One message, full picture.
Test both flows with the Execute Workflow button and a HubSpot sandbox deal before switching them to Active.
The benefits: faster reactions, better forecasts, less manual reporting
Wins get reinforced in real time. Public, instant recognition is the cheapest sales incentive that exists. When a close hits Slack seconds after it happens, the team feels momentum instead of reading about it in a spreadsheet next week.
Risk becomes coachable. The 9am sweep converts quota from a lagging scoreboard into a leading indicator. Managers spend their morning on the two reps who are actually behind pace, not on a generic pipeline review.
Forecasts stop being fiction. Because attainment is recomputed on every close and every morning, the number in Slack is always current. No more reconciling three versions of "where are we" in a Monday meeting.
Zero manual reporting. Nobody exports a CSV, nobody builds a weekly deck. The workflow runs itself, and HubSpot stays the single source of truth — n8n just reads it and routes it.
Common pitfalls (and how to avoid them)
Watching the wrong stage ID. Custom pipelines don't use the literal string closedwon — they use numeric internal IDs. Pull the real ID from HubSpot Settings → Pipelines, and if you run multiple pipelines, your IF node needs to match all of their won stages.
Timezone drift on the schedule. n8n's Schedule Trigger runs in the instance timezone unless you override it. If your server is UTC, 0 9 * * * fires at 4am your time. Set the workflow timezone explicitly.
Pagination silently truncating. HubSpot returns 100 records per page. If you forget Return All on the monthly pull, high-volume teams will under-count attainment and flag reps who are actually fine. Always page through fully.
Quota data going stale. Hard-coding quotas in the Code node works until someone's target changes and nobody updates the workflow. Keep quotas in a Google Sheet or n8n data table so ops can edit them without touching nodes.
Alert fatigue. If every micro-deal pings the channel, people mute it. Consider a floor (only celebrate deals above a threshold) and keep the risk digest to one message a day, not a per-rep spam.
Business-days math. A naive dayOfMonth / 30 pace calc punishes reps early in months with weekends front-loaded. Compute expected pace on business days elapsed, not calendar days, so the risk flag is fair.
Ja construimos isso pra voce
Nao comece do zero. O Real-Time Quota Attainment Alerts — HubSpot + Slack e um workflow n8n pronto para instalar — conecta suas ferramentas em minutos, sem codigo.
Instalar por $129 →