OTOMY
AUTOMATIONJune 6, 20266 min

Automate Invoicing & Payment Reminders with n8n + Supabase

Tired of chasing unpaid invoices manually? Here's how to build a fully automated invoicing and reminder pipeline using n8n and Supabase — running 24/7 with zero human intervention.

M

By

Melissa Slimani

Automate Invoicing & Payment Reminders with n8n + Supabase

Why Automating Invoicing with n8n Is a Game-Changer for SMBs

In a typical SMB — whether in France or Algeria — invoicing often follows the same painful pattern: an Excel spreadsheet, a manual email, and follow-ups… when someone remembers. The result? Mounting payment delays, cash flow pressure, and hours wasted every week.

Automating invoicing with n8n lets you build a complete pipeline — from invoice generation to automatic payment reminders — without building a full application or depending on expensive SaaS tools.

In this article, we'll build a concrete system using n8n (workflow orchestration), Supabase (database + API), and a few complementary tools.


System Architecture

Here are the building blocks we'll assemble:

  • Supabase (PostgreSQL): stores clients, invoices, payment statuses
  • n8n: orchestrates all workflows (creation, sending, reminders)
  • Resend or Brevo: transactional email delivery
  • Claude AI (optional): generates personalized reminder messages
  • Vercel: hosts a mini client portal (optional)
[Supabase DB] → [n8n Workflow] → [Send invoice via email]
                     ↓
              [Daily CRON job]
                     ↓
         [Check overdue invoices]
                     ↓
     [Reminder D+7 / D+15 / D+30]

Step 1: Model Your Data in Supabase

Create three core tables in your Supabase project:

-- Clients table
CREATE TABLE clients (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  name TEXT NOT NULL,
  email TEXT NOT NULL,
  company TEXT,
  created_at TIMESTAMPTZ DEFAULT now()
);

-- Invoices table
CREATE TABLE invoices (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  client_id UUID REFERENCES clients(id),
  invoice_number TEXT UNIQUE NOT NULL,
  amount NUMERIC(10,2) NOT NULL,
  issue_date DATE DEFAULT CURRENT_DATE,
  due_date DATE NOT NULL,
  status TEXT DEFAULT 'sent', -- sent, paid, overdue
  reminder_count INT DEFAULT 0,
  last_reminder TIMESTAMPTZ,
  created_at TIMESTAMPTZ DEFAULT now()
);

-- Reminder history table
CREATE TABLE reminder_history (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  invoice_id UUID REFERENCES invoices(id),
  reminder_type TEXT NOT NULL, -- D7, D15, D30
  sent_at TIMESTAMPTZ DEFAULT now(),
  channel TEXT DEFAULT 'email'
);

Enable Row Level Security (RLS) policies to secure access through the Supabase API.


Step 2: n8n Workflow — Automatic Invoice Delivery

This first workflow triggers every time a new row is inserted into the invoices table:

  1. Supabase Webhook Trigger: configure a Supabase webhook (or use n8n's Supabase Trigger node) that listens for INSERT events on the invoices table
  2. Supabase Node: fetch the associated client information using client_id
  3. HTML/Template Node: generate the email body with the invoice number, amount, and due date
  4. Resend/Brevo Node: send the transactional email with the invoice attached as a PDF (generated via an HTTP node calling a PDF API like pdf.co or a custom template)

Pro tip: store your email templates in a Supabase email_templates table so you can modify them without touching the workflow.


Step 3: n8n Workflow — Intelligent Automatic Reminders

This is where invoicing automation with n8n truly shines. Create a scheduled workflow (CRON) that runs every day at 9:00 AM:

[Cron 9:00] → [Query Supabase: invoices WHERE status = 'sent' AND due_date < now()]
     ↓
[Switch node: reminder_count]
     ↓
[0 → Reminder D+7] [1 → Reminder D+15] [2 → Reminder D+30 + internal alert]
     ↓
[Send email] → [Update Supabase: reminder_count + 1, last_reminder = now()]
     ↓
[Insert reminder_history]

Detailed Reminder Logic:

  • D+7 (soft reminder): friendly nudge, professional tone
  • D+15 (firm reminder): explicit mention of the delay, offer to discuss
  • D+30 (final reminder): formal tone, mention of potential consequences, Slack/email notification to the business owner

Personalization with Claude AI

To avoid generic reminders, add an HTTP node calling the Claude AI (Anthropic) API:

{
  "model": "claude-sonnet-4-20250514",
  "messages": [{
    "role": "user",
    "content": "Write a professional payment reminder email for an invoice of €{{amount}}, {{days_overdue}} days overdue, addressed to {{client_name}}. Tone: {{reminder_tone}}. Language: English."
  }]
}

The result: unique, context-aware reminders that achieve significantly better response rates.


Step 4: Dashboard and Notifications

Complete your system with:

  • Supabase Realtime view: use Supabase Realtime subscriptions to feed a dashboard (React/Next.js deployed on Vercel)
  • Slack alerts: add a Slack node in n8n to notify the team when an invoice passes D+30
  • Weekly report: a Monday morning n8n workflow that sends an overdue invoice summary to the business owner
-- Useful view for the dashboard
CREATE VIEW overdue_invoices_view AS
SELECT i.invoice_number, c.name, c.email, i.amount,
       i.due_date, i.reminder_count,
       CURRENT_DATE - i.due_date AS days_overdue
FROM invoices i
JOIN clients c ON c.id = i.client_id
WHERE i.status = 'sent'
  AND i.due_date < CURRENT_DATE
ORDER BY days_overdue DESC;

Real Results From Our Client Deployments

At Otomy, we've deployed this stack for several SMBs. Here are the average results:

Metric Before After
Average payment delay 38 days 17 days
Forgotten / unfollowed invoices ~25% 0%
Time spent on reminders / week 3-4h < 10 min
Collection rate at D+30 68% 94%

Important Considerations

  • GDPR compliance: only store necessary data, plan for automatic deletion after archiving
  • n8n error handling: enable Error Workflows to get alerted if a send fails
  • Sending limits: respect your email provider quotas (Resend: 100/day free tier, Brevo: 300/day)
  • Transparency: your clients should know they'll receive automated communications

Ready to Automate Your Invoicing?

Invoicing automation with n8n combined with Supabase delivers a powerful, flexible, and cost-effective solution. You don't need a €500/month ERP — just a well-designed architecture.

At Otomy, we help French and Algerian SMBs implement these systems end to end. From data modeling to workflow deployment, we build solutions that run on autopilot.

Losing time on payment follow-ups? Contact us for a free audit of your invoicing process.

OTOMY

Ready to automate your business?

Book a free call — 30 minutes to identify what we can automate for you.