Automation library · Money admin

Process and approve invoices with OpenAI and Google Sheets

Started by another system calling it, and works across Gmail and Google Sheets. It hands the judgement calls to OpenAI. 27 steps, 3 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

27 stepsLarge: read it before trusting it with anything live
3Branches: places the flow splits
1Loop or waits
2Services it connects to

The flow

Starts it 2Model 6Logic 10Service 9

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

  1. 1Webhook - Receive InvoiceWebhookStarts it
  2. 2AI - Extract Invoice Data - Chat ModelLm Chat Open AiModel
  3. 3AI - Extract Invoice Data - Output ParserOutput Parser StructuredModel
  4. 4AI - Analyze and Categorize Invoice - Chat ModelLm Chat Open AiModel
  5. 5AI - Analyze and Categorize Invoice - Output ParserOutput Parser StructuredModel
  6. 6Error Trigger - Workflow FailureError triggerStarts it
  7. 7Set - Prepare Invoice MetadataSetLogic
  8. 8AI - Extract Invoice DataAgentModel
  9. 9AI - Analyze and Categorize InvoiceAgentModel
  10. 10Send Email - Notify AdministratorGmailService
  11. 11Extract From File - Get Invoice TextExtract From FileService
  12. 12Code - Clean and Normalize DataCodeLogic
  13. 13Code - Verify Invoice TotalCodeLogic
  14. 14Code - Validate Required FieldsCodeLogic
  15. 15Switch - Determine Approval PathSwitchLogic
  16. 16IF - Is Invoice ValidIfLogic
  17. 17Code - Auto Approve InvoiceCodeLogic
  18. 18Send Email - Approval RequestGmailService
  19. 19Google Sheets - Search Existing InvoiceGoogle SheetsService
  20. 20Send Email - Request Missing InfoGmailService
  21. 21Google Sheets - Store Invoice RecordGoogle SheetsService
  22. 22Wait - Wait for Approval DecisionWaitLogic
  23. 23IF - Is Duplicate InvoiceIfLogic
  24. 24Send Email - Final Notification to FinanceGmailService
  25. 25Code - Process Approval DecisionCodeLogic
  26. 26Google Sheets - Update Status DuplicateGoogle SheetsService
  27. 27Send Email - Notify Finance DuplicateGmailService

How it's built

Starts on
Another system calling it
Steps
27, with 3 branches, 1 loop or waits
Size
Large: read it before trusting it with anything live
Connects to
Gmail, Google Sheets
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Gmail and Google Sheets accounts, and a key for OpenAI. 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?

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