Library / Finance, Invoices & Accounting
Finance, Invoices & Accounting
Extract and validate Gmail invoice PDFs into Google Sheets with OpenAI
Runs on each new Gmail message with PDF invoices, uses OpenAI to extract and validate fields, and appends the results as rows in Google Sheets.
What it does
## Extract invoice data from Gmail PDFs into Google Sheets with GPT ### Who's it for Small teams and finance admins who receive supplier invoices as PDF attachments and currently retype them into their accounts by hand. It earns its place above roughly thirty invoices a month. Below that, a spreadsheet and ten minutes a week is genuinely cheaper, and I would tell you not to build it. Check whether your accounting software already ships invoice capture before you build anything, because paying to rebuild a feature you already own is the most avoidable spend in this category. ### How it works 1. Gmail Trigger watches one label, not your whole inbox. An automation with read access to everything becomes a data protection question somebody has to answer later. 2. Filter keeps only PDF attachments, so a signature image or a stray screenshot cannot reach the extractor. 3. Extract From File turns the PDF into text. 4. Information Extractor with an OpenAI model reads that text into a structured record: supplier, invoice number, both dates, net, VAT, gross, currency and line items. The prompt tells the model to return null instead of guessing, and it handles the two documents that quietly cost money: credit notes, where the sign is inverted, and multi-page invoices where the real total sits on the last page rather than page one. 5. Code node validates before anything is booked. Do the line items sum to the net. Does net plus VAT equal gross. Is that a real VAT rate. Is it secretly a credit note. 6. IF routes the result. Invoices that reconcile land in your Invoices sheet. Anything that fails lands in an Exceptions sheet with the reason attached, so a person sees it rather than your accounts quietly absorbing a wrong number. ### How to set up 1. Connect your Gmail, OpenAI and Google Sheets credentials. 2. Set the Gmail label your suppliers' invoices arrive under. 3. Point both Google Sheets nodes at one spreadsheet containing an Invoices tab and an Exceptions tab. 4. Run it against a handful of real invoices before activating, and read what lands in Exceptions. That queue is the honest measure of whether it is working. ### Requirements A Gmail account, an OpenAI API key, and Google Sheets. ### How to customize - Swap the Google Sheets nodes for your accounting system's API. - Adjust the accepted VAT rates in the validation node for your country. It currently checks UK
The steps
- New Invoice Email
- Only PDF Attachments
- PDF To Text
- Read The Invoice
- Extraction Model
- Validate Before Booking
- Did It Reconcile?
- Append To Books
- Send To Exceptions Queue
Similar automations
Documents, PDF & OCRExtract Turkish invoice data from Gmail PDFs into Google Sheets with Gemini21 stepsFinance, Invoices & AccountingExtract invoice data from Gmail PDFs into Google Sheets with OpenAI22 stepsFinance, Invoices & AccountingCreate and Email Invoice Ninja Invoices from Sheets4 stepsFinance, Invoices & AccountingExtract invoices from Gmail PDFs into Google Sheets with OpenRouter AI11 steps