How to Automate API Usage at 80%+ → Timed Upsell Email + HubSpot Log with n8n
Your SaaS has accounts hammering their API limits right now — and most of them will hit the ceiling, get a 429 error, and churn before anyone on your team notices. The signal that a customer is ready
Your SaaS has accounts hammering their API limits right now — and most of them will hit the ceiling, get a 429 error, and churn before anyone on your team notices. The signal that a customer is ready to pay you more (heavy usage) is the exact same signal that they're about to have a bad experience. Whoever reaches them first at the 80% mark wins the expansion revenue. This is a fully automated n8n workflow that watches usage hourly, catches accounts crossing 80% of their quota, and fires a contextual upsell email — with frequency capping so you never spam the same account twice, and a full HubSpot log so your sales team sees every touch.
The Problem: Usage-Based Churn Is Invisible Until It's a Refund Request
Expansion revenue is the cheapest revenue you'll ever earn — no CAC, no cold outreach, just a customer who already trusts you and is outgrowing their plan. But the window to capture it is tiny. An account that quietly climbs from 60% to 95% of its API quota over a week gives you a perfect upsell moment, and almost every SaaS misses it because nobody is watching per-account usage in real time.
The naive fixes all fail. A weekly usage report lands after the account already hit the wall. A hard "you're over your limit" transactional email reads as a threat, not an offer. And the moment you try to build alerting manually, you run into the spam problem: if a heavy account sits at 85% for two weeks, an hourly check will email them 336 times. Frequency capping isn't a nice-to-have — it's the thing that makes proactive usage outreach safe to turn on at all.
The Solution: An Hourly Cron That Watches, Filters, and Caps
The workflow runs on a simple loop. Every hour, it pulls current usage numbers per account, calculates each account's percentage against its plan limit, and isolates the ones that just crossed 80%. For each qualifying account it checks a suppression record — "have we emailed this account in the last N days?" — and only if the answer is no does it send a warm, contextual upsell email and log the touch to HubSpot. The frequency cap is the heart of the design: it turns a firehose of hourly checks into at most one thoughtful email per account per cooldown window.
The email itself isn't a limit warning. It's positioned as good news: "You're getting real value out of the API — here's how to keep going without hitting a wall." That framing converts because it matches the customer's actual state. They're succeeding with your product; you're removing the friction from their success.
Step-by-Step: Building It in n8n
1. Schedule Trigger. Start with a Schedule Trigger node set to a Cron expression of 0 * * * * — every hour on the hour. Keep the interval hourly rather than every few minutes; API usage doesn't move fast enough to justify tighter polling, and you'll thank yourself on the rate-limit budget.
2. Pull usage data. Add an HTTP Request node (or a Postgres/MySQL node if usage lives in your own database) to fetch current period usage per account. If you query your metering database directly, a single SQL statement that returns account_id, email, usage_count, plan_limit is cleaner than looping API calls. Set the HTTP node to return JSON and enable "Split Into Items" so each account becomes its own item downstream.
3. Calculate the percentage. Drop in a Code node (or a Set node with an expression) that computes usage_pct = (usage_count / plan_limit) * 100 for each item. Doing the math in a dedicated node keeps your filter logic readable and makes the threshold trivially tunable later.
4. Filter to the 80%+ band. Use an IF or Filter node with the condition usage_pct >= 80. Consider adding an upper guard like usage_pct < 100 if accounts already over their limit get a different (harder) transactional email — you don't want to double-message someone who's already blocked.
5. Enforce the frequency cap. This is the step most home-built versions skip. Before sending, look up whether this account was contacted recently. The clean pattern: query a small table (or an n8n Data Store / static workflow data) keyed by account_id with a last_upsell_sent_at timestamp. Add an IF node that passes the item only when last_upsell_sent_at is null or older than your cooldown (e.g., 14 days). If your suppression lives in HubSpot, use a HubSpot node to read a custom contact property like last_upsell_email_date and branch on it.
6. Send the email. For accounts that clear the cap, use a Send Email (SMTP), SendGrid, or Gmail node. Personalize the body with expressions — pull in {{$json.usage_pct}} rounded, the plan name, and a direct upgrade link with the account pre-identified so the checkout is one click.
7. Log to HubSpot and update the timestamp. Add a HubSpot node to create an engagement (or update the contact) recording the upsell touch, and write the current time back to last_upsell_email_date. Updating the suppression field in the same run is what makes the cap actually work — do it right after the send, not in a separate workflow that might not fire.
Benefits: What This Actually Moves
Expansion revenue you were leaving on the table. You reach the highest-intent moment — active, heavy usage — before the customer feels the pain. That's the difference between an upsell and a save.
Zero manual monitoring. No dashboards to babysit, no ops person eyeballing usage graphs. The cron runs 24/7 and only surfaces action when it's warranted.
Sales gets full visibility. Because every touch lands in HubSpot, your AE can see that an account was auto-nudged at 82% and follow up with a personal call — no double-messaging, no guessing what marketing already sent.
Trust stays intact. Frequency capping means a customer parked at 90% for a month hears from you once, framed as help. That's the difference between "this vendor watches out for me" and "this vendor spams me."
Common Pitfalls (and How to Dodge Them)
No frequency cap = instant spam. If you skip step 5, an account sitting above threshold gets emailed every single hour. This is the most common way self-built versions get switched off within a day. Build the cap first, test it second, turn on sending last.
Forgetting to write back the timestamp. Reading last_upsell_sent_at without updating it after the send means the cap never engages — every run thinks it's the first. Always close the loop in the same execution.
Percentage math on missing limits. If an account has a null or zero plan_limit (enterprise, trial, legacy plan), your division either errors or produces Infinity and floods the filter. Add a guard in the Code node to skip accounts without a valid numeric limit.
Polling too aggressively. Sub-hourly cron schedules burn your metering API's rate limit and gain you nothing — usage crossing 80% is not a same-minute event. Hourly is the sweet spot.
Not testing the branch logic. Run the workflow manually with n8n's "Execute Workflow" and inspect the item count after each node. You want to see the funnel narrow: all accounts → 80%+ band → not-recently-contacted → sent. If the count doesn't drop at the cap node, your suppression check is misconfigured.
One suppression window for everyone. A 14-day cap is a fine default, but a customer at 98% deserves a faster follow-up than one hovering at 81%. Once the basic flow is live, consider tiering the cooldown by severity — shorter windows for accounts closer to the ceiling.
Ja construimos isso pra voce
Nao comece do zero. O API Usage at 80%+ → Timed Upsell Email + HubSpot Log e um workflow n8n pronto para instalar — conecta suas ferramentas em minutos, sem codigo.
Instalar por $29 →