← All work

Make · Automation breakdown

Invoice dunning & reconciliation

An iterator fans invoice line items into a 4-route router, with a second nested router gating account suspension after a 72-hour dunning delay. Results aggregate back into one warehouse write.

Platform
Make
Scope
17 modules
Triggers
2 routers
Pattern
error handler
Invoice Dunning & Reconciliation
Scheduled · every 15m
Router 14 routesroute 1 · dueroute 2 · overdueroute 3 · disputedroute 4 · fallbacknoyes1Watch InvoicesScheduled · 15m2Iteratorsplit: line_items3Get CustomerAirtable · search$4Charge CardStripe · createCharge5Mark PaidAirtable · update6Notify #billingSlack · message7Dunning EmailGmail · send8Sleep 72hTools · delay9Router 2paid yet?!10Suspend AccountAPI · PATCH11Clear FlagAirtable · update12Classify DisputeOpenAI · JSON out13Open TicketZendesk · create14Log SkippedSheets · append15Aggregatorbundle: array16BigQueryinsert: rows17Error Handlerbreak · retry 3x

Scroll horizontally to pan the full canvas.

The problem

Failed payments were being chased manually from a spreadsheet. Suspensions were inconsistent — some accounts were cut off immediately, others ran unpaid for months — and finance had no single reconciled record of what happened to each invoice.

Stage by stage

How it actually runs.

01

Watch & iterate

A scheduled trigger polls for invoices every fifteen minutes. An Iterator splits each invoice into its individual line items so downstream modules operate on one item at a time, which is what makes per-item error handling possible later.

02

Route by invoice state

The first router splits four ways on invoice state: due, overdue, disputed, and a catch-all fallback. Having an explicit fallback route rather than assuming three states cover reality is the difference between a scenario that runs for a year and one that breaks the first time finance invents a new status.

03

Due — collect

Cards are charged, the record is marked paid, and the billing channel is notified. This is the happy path and it is intentionally the shortest one.

04

Overdue — dunning with a second router

A dunning email goes out, then the scenario sleeps for seventy-two hours before a second nested router re-checks payment state. Paid in the meantime clears the flag; still unpaid suspends the account through an API call. The delay-then-recheck pattern is what prevents suspending a customer who paid an hour after the reminder.

05

Disputed — classify and escalate

Disputes are classified by a model into a structured reason code, then opened as a helpdesk ticket with that context attached, so the person picking it up starts with the dispute already categorized.

06

Aggregate & reconcile

All routes converge into an Aggregator that bundles the per-item results back into a single array, written to the warehouse in one insert rather than one write per line item. A dedicated error handler with a retry policy catches module failures so a single bad record does not halt the run.

Stack

Make (Iterator, Router, Aggregator)StripeAirtableOpenAIZendeskGmailSlackBigQuery

Decisions that matter

  • The nested router re-checks payment state before suspending anyone.
  • An explicit fallback route handles invoice states nobody planned for.
  • The Aggregator collapses per-item results into a single warehouse write.
  • Retries are scoped per-item, so one failure does not kill the batch.

Other automations

Start a project

Have a business that needs a system, not just a site?

adrian.afable@gmail.comUsually replies within a day