Complete Guide: Stripe Overdue Invoice → 4-Level Escalation Sequence with n8n
Every month you invoice through Stripe, a slice of that revenue quietly slips into "past due" limbo. Not because the customer refused to pay — because nobody chased them. The card expired, the AP cont
Every month you invoice through Stripe, a slice of that revenue quietly slips into "past due" limbo. Not because the customer refused to pay — because nobody chased them. The card expired, the AP contact went on vacation, the email got buried. Stripe will retry a failed subscription charge, but for one-off and manual invoices it does almost nothing proactive. So your cash sits uncollected while you focus on shipping product. A single overdue $2,000 invoice ignored for 45 days is a real hole in a founder's runway.
The Problem: Overdue Invoices Die of Neglect, Not Refusal
Most unpaid invoices aren't disputes. They're forgotten. The data on collections is blunt: the probability of recovering a debt drops sharply with every week that passes. An invoice chased at day 3 gets paid; the same invoice chased at day 60 becomes a write-off negotiation. Yet manual dunning is exactly the kind of repetitive, emotionally awkward work that busy teams push to "later" and never do.
The naive fix is a single reminder email blasted at everyone the moment an invoice goes past due. That fails in both directions. A good customer who's two days late gets a threatening "FINAL NOTICE" and churns. A deadbeat 40 days late gets the same polite nudge they've already ignored four times. Effective collections require escalation: the tone, urgency, and channel must scale with how overdue the invoice actually is. Doing that by hand across dozens of invoices is unsustainable. Doing it with n8n is a one-time build.
The Solution: A Days-Past-Due Escalation Engine
This template runs as a daily cron that scans Stripe for every open invoice, calculates how many days each one is past its due date, and routes it to exactly one of four escalation levels:
- Level 1 — Reminder (1–7 days past due): friendly, assume good faith. "Just a heads up, invoice #1042 is a few days overdue — here's the payment link."
- Level 2 — Warning (8–20 days): firmer, references the prior reminder, restates the amount and due date.
- Level 3 — Final Notice (21–35 days): formal, mentions consequences (service suspension, late fees), sets a hard deadline.
- Level 4 — Slack Collections Alert (36+ days): stops emailing the customer and pings your internal collections/finance channel so a human decides on a call, a payment plan, or write-off.
The key design principle: each invoice receives one action per run, and the system tracks which level was last sent so a customer never gets two escalation emails in a single day. The result is a fully automated, tone-appropriate dunning sequence that costs nothing to run and never forgets.
Step-by-Step Setup in n8n
Here's how the workflow is wired. You can build it from these nodes or install the ready-made template and just plug in credentials.
1. Schedule Trigger. Add a Schedule Trigger node set to run once daily — 9:00 AM in your business timezone is ideal, so emails land during working hours. Use the Cron expression 0 9 * * *.
2. Fetch overdue invoices from Stripe. Use an HTTP Request node (more flexible than the native Stripe node for invoice queries) calling GET https://api.stripe.com/v1/invoices with query params status=open and limit=100. Authenticate with a Stripe API credential (Header Auth: Authorization: Bearer sk_live_...). Enable pagination on the starting_after cursor if you carry more than 100 open invoices.
3. Calculate days past due. Add a Code node (JavaScript). For each invoice, Stripe gives you due_date as a Unix timestamp. Compute:
const daysPastDue = Math.floor((Date.now()/1000 - item.json.due_date) / 86400);
Filter out anything with daysPastDue < 1 or a null due date, and attach daysPastDue to each item so downstream nodes can route on it.
4. Route by escalation level. Use a Switch node with four outputs, keyed on the daysPastDue value: 1–7, 8–20, 21–35, and 36+. The Switch guarantees each invoice takes exactly one branch — no double-sends.
5. Build the emails. On the first three branches, add a Set node to assemble subject and body from templated strings, pulling customer_email, amount_due (remember Stripe amounts are in cents — divide by 100), number, and hosted_invoice_url straight from the invoice object. Always include the hosted_invoice_url — a one-click pay link removes all friction. Then send via a Send Email (SMTP) or Gmail node. Escalate the copy per level; keep the pay link constant.
6. Slack alert for Level 4. On the fourth branch, add a Slack node using the Send Message operation to your #collections channel. Post the customer name, invoice number, amount, days overdue, and the Stripe dashboard link so finance can act immediately.
7. Log the action (optional but recommended). Append a row to a Google Sheets or Postgres node recording invoice ID, level sent, and date. This gives you an audit trail and lets a follow-up run skip anything already escalated that day.
The Benefits: Cash Recovered on Autopilot
Once live, this workflow turns collections from a task nobody owns into a background process. Concretely:
- Faster recovery. Chasing at day 3 instead of day 30 dramatically lifts the odds an invoice gets paid at all.
- Right tone, right time. Good customers get gentle nudges; genuinely delinquent accounts get firm, escalating pressure — protecting relationships you want to keep.
- Zero human overhead. No calendar reminders, no awkward "hey, about that invoice" emails to write. The system handles levels 1–3 entirely; humans only touch level 4, where judgment actually matters.
- Full visibility. The Slack alert and log turn your overdue pipeline into something the whole finance team can see, instead of a spreadsheet one person forgets to open.
For a small team, recovering even one or two otherwise-forgotten invoices a month pays for the automation many times over.
Common Pitfalls (and How to Avoid Them)
Double-sending. If your cron runs more than once a day, or you re-trigger manually, a customer can get the same email twice. Guard against it by logging each send and checking the log before dispatching — or simply keep the trigger to a strict once-daily schedule.
Emailing paid or voided invoices. Always filter on status=open at the Stripe query. An invoice paid an hour ago but still cached will generate an embarrassing "you owe us" email. Never trust a stale list.
Timezone drift on the due date. Stripe timestamps are UTC. If your daysPastDue math mixes local time and UTC, invoices flip levels a day early or late. Do the arithmetic entirely in Unix seconds as shown, then format for display only.
Amounts in cents. Stripe returns amount_due in the smallest currency unit. Forgetting to divide by 100 produces a "$200000 overdue" email. Always convert and format with the correct currency symbol from invoice.currency.
Deliverability. Dunning emails hit spam filters harder than marketing. Send from a real, monitored business domain with SPF/DKIM configured, not a no-reply address, so customers can actually reply and pay.
No off-ramp. Build a way to exclude an invoice mid-dispute (e.g., a metadata flag on the Stripe invoice that your Code node checks). Nothing burns goodwill faster than a "FINAL NOTICE" sent to a customer you're actively negotiating with.
Set this up once and your overdue pipeline collects itself — quietly, consistently, and in the right tone for every account. That's the difference between revenue you earned and revenue you actually receive.
Ja construimos isso pra voce
Nao comece do zero. O Stripe Overdue Invoice → 4-Level Escalation Sequence e um workflow n8n pronto para instalar — conecta suas ferramentas em minutos, sem codigo.
Instalar por $59 →