# Process and validate invoices from Gmail and forms with OpenAI: n8n workflow

> Started by someone submitting a form, and works across Gmail, Google Drive, Google Sheets and Slack. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/process-and-validate-invoices-from-gmail-and-forms-with-open (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 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.

Large Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fprocess-and-validate-invoices-from-gmail-and-forms-with-open)

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

**2** Branches: places the flow splits

**0** Loops or waits

**4** Services it connects to

## The flow

Starts it 3 Model 3 Logic 7 Service 9

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

- 1 **Watch Gmail for Invoices** Gmail trigger *Starts it*
- 2 **Upload Invoices by Form** Form trigger *Starts it*
- 3 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 4 **Force Strict JSON Output** Output Parser Structured *Model*
- 5 **Every Monday at 08:00** Schedule trigger *Starts it*
- 6 **One Item per PDF** Code *Logic*
- 7 **Extract Invoice Fields with AI** Chain Llm *Model*
- 8 **Read the Invoice Tracker** Google Sheets *Service*
- 9 **Keep Only PDF Files** Filter *Logic*
- 10 **Validate the Invoice Data** Code *Logic*
- 11 **Build the Weekly Digest** Code *Logic*
- 12 **Extract Text from the PDF** Extract From File *Service*
- 13 **Look Up Invoice in Tracker** Google Sheets *Service*
- 14 **Send the Digest to Slack** Slack *Service*
- 15 **Flag Duplicates Before They Post** Code *Logic*
- 16 **Is This a Duplicate?** If *Logic*
- 17 **Tell Slack a Duplicate Was Skipped** Slack *Service*
- 18 **File the PDF in Google Drive** Google Drive *Service*
- 19 **Append Invoice to the Tracker** Google Sheets *Service*
- 20 **Does It Need a Human?** If *Logic*
- 21 **Email Finance for Review** Gmail *Service*
- 22 **Post the Invoice to Slack** Slack *Service*

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

## 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-validate-invoices-from-gmail-and-forms-with-open)
- **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 Drive](https://millionrounds.com/workflows?service=Google+Drive#library)[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)

## Workflows like it

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

- [**Extract and organize Colombian invoices with Gmail and OpenAI** 22 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/extract-and-organize-colombian-invoices-with-gmail-and-opena)
- [**Extract invoice data from Gmail PDFs** 22 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/extract-invoice-data-from-gmail-pdfs)
- [**Follow up on overdue invoices with OpenAI and Gmail** 22 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/follow-up-on-overdue-invoices-with-openai-and-gmail)
- [**Log email receipt data to Google Sheets with Gmail and OpenAI** 22 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/log-email-receipt-data-to-google-sheets-with-gmail-and-opena)
- [**Process emailed PDF invoices into QuickBooks bills with OpenAI** 22 steps · calls a model · Gmail](https://millionrounds.com/workflow/process-emailed-pdf-invoices-into-quickbooks-bills-with-open)
- [**WhatsApp AI Agent with Payments and CRM** 22 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/whatsapp-ai-agent-with-payments-and-crm)
