DEV Community

StackOps Labs
StackOps Labs

Posted on

Automating SaaS Subscription Audits with the Notion API, Google Apps Script, and n8n

One recurring issue when running small projects or freelancing is losing track of $10 to $49/mo SaaS and API subscriptions. Most spreadsheet or Notion trackers fail after two weeks because nobody wants to manually open their email, copy invoice totals, and type them into a table.

To fix this without paying for another recurring SaaS tool, I put together a lightweight setup that logs invoice emails into a Notion database automatically and calculates whether each tool is worth keeping.

1. Grading Subscriptions by Cost per Hour Saved

Looking at raw monthly cost alone isn't very useful—a $20/mo tool you use 20 hours a month is cheap, while a $15/mo tool you haven't opened in 60 days is pure waste.

In Notion Formula 2.0, we can calculate the monthly equivalent cost (normalizing annual plans) and divide it by estimated hours saved per month:

/* Monthly Equivalent ($) */
if(prop("Billing Cycle") == "Yearly", round(prop("Billed Amount ($)") / 12 * 100) / 100, prop("Billed Amount ($)"))

/* Cost per Hour Saved ($) */
if(prop("Hours Saved / Month") > 0, round(prop("Monthly Equivalent ($)") / prop("Hours Saved / Month") * 100) / 100, prop("Monthly Equivalent ($)"))
Enter fullscreen mode Exit fullscreen mode

From there, a simple conditional formula flags each row as Keep, Downgrade, or Cancel (Unused).

2. Zero-Server Sync from Gmail to Notion (Google Apps Script)

Instead of paying for Zapier just to parse receipt emails, you can run a 40-line Google Apps Script on a daily time trigger inside your Google account:

  1. Search Gmail threads matching subject:(invoice OR receipt) newer_than:1d.
  2. Extract the sender name, date, and dollar amount via regex.
  3. Send a POST request to https://api.notion.com/v1/pages to append the row directly to the Notion database.

3. Alternative: 4-Node n8n Workflow

If you already self-host n8n, you can get cleaner extraction by passing the email body through gpt-4o-mini before writing to Notion:

  1. Gmail Trigger (watches new invoice emails)
  2. OpenAI Chat Model (extracts vendor, amount, and billing cycle as JSON)
  3. Notion Node (creates the database page)
  4. Slack Node (optional notification when a yearly renewal hits)

Links & Files

If you want to copy this setup instead of building the formulas and scripts from scratch, I put the files here:

Top comments (0)