Automation library · Money admin

Send staged invoice payment reminders with Microsoft SQL

Started by a clock, and works across Gmail. 42 steps, 8 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large

42 stepsLarge: read it before trusting it with anything live
8Branches: places the flow splits
1Loop or waits
1Service it connects to

The flow

Starts it 1Logic 21Service 20

The steps in the order they run, from what starts it.

  1. 1Daily at 9 AMSchedule triggerStarts it
  2. 2Fetch Unpaid InvoicesMicrosoft SqlService
  3. 3Has Unpaid Invoices?IfLogic
  4. 4Process Each InvoiceSplit In BatchesLogic
  5. 5No Invoices to ProcessSetLogic
  6. 6Merge All StagesMergeLogic
  7. 7Calculate Days Until DueDate TimeLogic
  8. 8Aggregate SummaryAggregateLogic
  9. 9Route to Reminder StageSwitchLogic
  10. 10Generate Summary ReportSetLogic
  11. 11Already Sent 7 Before?IfLogic
  12. 12Already Sent 3 Before?IfLogic
  13. 13Already Sent Due Today?IfLogic
  14. 14Already Sent 1 Overdue?IfLogic
  15. 15Already Sent 7 Overdue?IfLogic
  16. 16Already Sent 15 Overdue?IfLogic
  17. 17Create HTML ReportHtmlLogic
  18. 18Prepare Email 7 BeforeSetLogic
  19. 19Prepare Email 3 BeforeSetLogic
  20. 20Prepare Email Due TodaySetLogic
  21. 21Prepare Email 1 OverdueSetLogic
  22. 22Prepare Email 7 OverdueSetLogic
  23. 23Prepare Email 15 OverdueSetLogic
  24. 24Send Summary to FinanceGmailService
  25. 25Send Email 7 BeforeGmailService
  26. 26Send Email 3 BeforeGmailService
  27. 27Send Email Due TodayGmailService
  28. 28Send Email 1 OverdueGmailService
  29. 29Send Email 7 OverdueGmailService
  30. 30Send Email 15 OverdueGmailService
  31. 31Update DB 7 BeforeMicrosoft SqlService
  32. 32Update DB 3 BeforeMicrosoft SqlService
  33. 33Update DB Due TodayMicrosoft SqlService
  34. 34Update DB 1 OverdueMicrosoft SqlService
  35. 35Update DB 7 OverdueMicrosoft SqlService
  36. 36Update DB 15 OverdueMicrosoft SqlService
  37. 37Log Audit 7 BeforeMicrosoft SqlService
  38. 38Log Audit 3 BeforeMicrosoft SqlService
  39. 39Log Audit Due TodayMicrosoft SqlService
  40. 40Log Audit 1 OverdueMicrosoft SqlService
  41. 41Log Audit 7 OverdueMicrosoft SqlService
  42. 42Log Audit 15 OverdueMicrosoft SqlService

How it's built

Starts on
A clock
Steps
42, with 8 branches, 1 loop or waits
Size
Large: read it before trusting it with anything live
Connects to
Gmail
Model
None. This is plumbing, not judgement

Questions

What does it need to run?

An n8n account, plus your own Gmail account. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Take your time. At 42 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 42 steps before you point it at anything that matters.