Automation library · Money admin

Process and validate invoices from Gmail and forms with OpenAI

Started by someone submitting a form, and works across Gmail, Google Drive, Google Sheets and Slack. It hands the judgement calls to OpenAI. 22 steps, 2 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

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

The flow

Starts it 3Model 3Logic 7Service 9

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

  1. 1Watch Gmail for InvoicesGmail triggerStarts it
  2. 2Upload Invoices by FormForm triggerStarts it
  3. 3OpenAI Chat ModelLm Chat Open AiModel
  4. 4Force Strict JSON OutputOutput Parser StructuredModel
  5. 5Every Monday at 08:00Schedule triggerStarts it
  6. 6One Item per PDFCodeLogic
  7. 7Extract Invoice Fields with AIChain LlmModel
  8. 8Read the Invoice TrackerGoogle SheetsService
  9. 9Keep Only PDF FilesFilterLogic
  10. 10Validate the Invoice DataCodeLogic
  11. 11Build the Weekly DigestCodeLogic
  12. 12Extract Text from the PDFExtract From FileService
  13. 13Look Up Invoice in TrackerGoogle SheetsService
  14. 14Send the Digest to SlackSlackService
  15. 15Flag Duplicates Before They PostCodeLogic
  16. 16Is This a Duplicate?IfLogic
  17. 17Tell Slack a Duplicate Was SkippedSlackService
  18. 18File the PDF in Google DriveGoogle DriveService
  19. 19Append Invoice to the TrackerGoogle SheetsService
  20. 20Does It Need a Human?IfLogic
  21. 21Email Finance for ReviewGmailService
  22. 22Post the Invoice to SlackSlackService

How it's built

Starts on
Someone submitting a form
Steps
22, with 2 branches
Size
Large: read it before trusting it with anything live
Connects to
Gmail, Google Drive, Google Sheets, Slack
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Gmail, Google Drive, 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 someone submitting a form.

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?

Take your time. At 22 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 22 steps before you point it at anything that matters.