Automation library · Money admin

Process Gmail invoices with OpenAI and Google Sheets

Started by a clock, and works across Gmail, Google Sheets and Slack. It hands the judgement calls to OpenAI. 18 steps, 2 branches: a working afternoon to understand properly.

MediumCalls a model: OpenAI

18 stepsMedium: a working afternoon
2Branches: places the flow splits
0Loops or waits
3Services it connects to

The flow

Starts it 2Model 1Logic 6Service 9

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

  1. 1Monitor Incoming Invoice EmailsGmail triggerStarts it
  2. 2Daily Invoice Reminder SchedulerSchedule triggerStarts it
  3. 3Download Invoice AttachmentGmailService
  4. 4Load Pending Invoice RecordsGoogle SheetsService
  5. 5Extract Text from Invoice PDFExtract From FileService
  6. 6Calculate Remaining Due DaysCodeLogic
  7. 7AI Invoice Data ExtractionOpen AiModel
  8. 8Generate Reminder Priority & StatusCodeLogic
  9. 9Format Extracted Invoice DataCodeLogic
  10. 10Check Reminder Action RequiredIfLogic
  11. 11Check Existing Invoice RecordGoogle SheetsService
  12. 12Send Invoice Reminder EmailGmailService
  13. 13Send Slack Reminder NotificationSlackService
  14. 14Is Duplicate Invoice?IfLogic
  15. 15Update Invoice Status in SheetGoogle SheetsService
  16. 16Prepare Duplicate Invoice AlertSetLogic
  17. 17Save Invoice to Tracker SheetGoogle SheetsService
  18. 18Send Duplicate Alert to SlackSlackService

How it's built

Starts on
A clock
Steps
18, with 2 branches
Size
Medium: a working afternoon
Connects to
Gmail, Google Sheets, Slack
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Gmail, Google Sheets and Slack accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Plan an afternoon. 18 steps is enough that you should read each one before running it.

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