Automation library · Content

Split shared rental utility bills with Postgres and Gmail

Started by another system calling it, and works across Discord, Gmail and Postgres. 29 steps, 4 branches: large, and worth reading before you trust it with anything live.

Large

29 stepsLarge: read it before trusting it with anything live
4Branches: places the flow splits
0Loops or waits
3Services it connects to

The flow

Starts it 2Logic 10Service 17

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

  1. 1When a utility bill is forwardedWebhookStarts it
  2. 2Daily follow up sweepSchedule triggerStarts it
  3. 3Normalize forwarded billSetLogic
  4. 4Find bills from yesterday or olderPostgresService
  5. 5Has a bill image attachedIfLogic
  6. 6Build follow up summaryCodeLogic
  7. 7Build GPT-4o vision requestCodeLogic
  8. 8Alert missing image on DiscordDiscordService
  9. 9Email missing image noticeGmailService
  10. 10Are there open billsIfLogic
  11. 11Read the bill with GPT-4o visionHttp RequestService
  12. 12Post follow up on DiscordDiscordService
  13. 13Post all clear on DiscordDiscordService
  14. 14Parse bill fieldsCodeLogic
  15. 15Email follow up to ownerGmailService
  16. 16Is the bill readableIfLogic
  17. 17Is the amount positiveIfLogic
  18. 18Store rejected billPostgresService
  19. 19Load tenants from rosterPostgresService
  20. 20Alert team on DiscordDiscordService
  21. 21Compute unit sharesCodeLogic
  22. 22Email invalid bill noticeGmailService
  23. 23Store bill in PostgresPostgresService
  24. 24Store unit chargesPostgresService
  25. 25Post split summary to DiscordDiscordService
  26. 26Email split summary to ownerGmailService
  27. 27Build tenant emailsCodeLogic
  28. 28Email each tenant their chargeGmailService
  29. 29Mark bill donePostgresService

How it's built

Starts on
Another system calling it
Steps
29, with 4 branches
Size
Large: read it before trusting it with anything live
Connects to
Discord, Gmail, Postgres
Model
None. This is plumbing, not judgement

Questions

What does it need to run?

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

What starts it?

It starts on another system calling it.

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 29 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 29 steps before you point it at anything that matters.