# Process and approve invoices with OpenAI and Google Sheets: n8n workflow

> Started by another system calling it, and works across Gmail and Google Sheets. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/process-and-approve-invoices-with-openai-and-google-sheets (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Money admin](https://millionrounds.com/workflows?category=Money+admin#library)

# 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.

Large Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fprocess-and-approve-invoices-with-openai-and-google-sheets)

**27 steps** Large: read it before trusting it with anything live

**3** Branches: places the flow splits

**1** Loop or waits

**2** Services it connects to

## The flow

Starts it 2 Model 6 Logic 10 Service 9

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

- 1 **Webhook - Receive Invoice** Webhook *Starts it*
- 2 **AI - Extract Invoice Data - Chat Model** Lm Chat Open Ai *Model*
- 3 **AI - Extract Invoice Data - Output Parser** Output Parser Structured *Model*
- 4 **AI - Analyze and Categorize Invoice - Chat Model** Lm Chat Open Ai *Model*
- 5 **AI - Analyze and Categorize Invoice - Output Parser** Output Parser Structured *Model*
- 6 **Error Trigger - Workflow Failure** Error trigger *Starts it*
- 7 **Set - Prepare Invoice Metadata** Set *Logic*
- 8 **AI - Extract Invoice Data** Agent *Model*
- 9 **AI - Analyze and Categorize Invoice** Agent *Model*
- 10 **Send Email - Notify Administrator** Gmail *Service*
- 11 **Extract From File - Get Invoice Text** Extract From File *Service*
- 12 **Code - Clean and Normalize Data** Code *Logic*
- 13 **Code - Verify Invoice Total** Code *Logic*
- 14 **Code - Validate Required Fields** Code *Logic*
- 15 **Switch - Determine Approval Path** Switch *Logic*
- 16 **IF - Is Invoice Valid** If *Logic*
- 17 **Code - Auto Approve Invoice** Code *Logic*
- 18 **Send Email - Approval Request** Gmail *Service*
- 19 **Google Sheets - Search Existing Invoice** Google Sheets *Service*
- 20 **Send Email - Request Missing Info** Gmail *Service*
- 21 **Google Sheets - Store Invoice Record** Google Sheets *Service*
- 22 **Wait - Wait for Approval Decision** Wait *Logic*
- 23 **IF - Is Duplicate Invoice** If *Logic*
- 24 **Send Email - Final Notification to Finance** Gmail *Service*
- 25 **Code - Process Approval Decision** Code *Logic*
- 26 **Google Sheets - Update Status Duplicate** Google Sheets *Service*
- 27 **Send Email - Notify Finance Duplicate** Gmail *Service*

## 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.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fprocess-and-approve-invoices-with-openai-and-google-sheets)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)

## Workflows like it

Also money admin, with the same services where possible, closest in size first.

- [**Automated invoice processing with Telegram and OpenAI** 27 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/automated-invoice-processing-with-telegram-and-openai)
- [**Automate income and expense tracking in Google Sheets** 27 steps · Google Sheets, Telegram](https://millionrounds.com/workflow/automate-income-and-expense-tracking-in-google-sheets)
- [**Deliver digital products with WhatsApp and Telegram** 27 steps · Google Sheets, Telegram](https://millionrounds.com/workflow/deliver-digital-products-with-whatsapp-and-telegram)
- [**Generate service quotes with OpenAI and Telegram** 26 steps · calls a model · Gmail, Telegram](https://millionrounds.com/workflow/generate-service-quotes-with-openai-and-telegram)
- [**Send donor thank-you receipts and weekly digests** 26 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/send-donor-thank-you-receipts-and-weekly-digests)
- [**Approve invoices with Claude and Google Drive** 28 steps · Google Drive, Google Sheets](https://millionrounds.com/workflow/approve-invoices-with-claude-and-google-drive)
