Skip to content
FlowHubFluxonLab
C
Gmailfree

Extract and validate invoice PDFs with OpenAI, Google Sheets, and Gmail

by isaWOWadapted from n8n official workflow galleryUpdated Aug 2026
RequiresCCodeGmailGmailGoogle SheetsGoogle SheetsHTTP RequestHTTP Request
Share Post Share
Fo1. Form — Upload Invoice PDF1. Form — Uploa…EF2. Extract From File — PDF to Text2. Extract From…HR3. HTTP — AI Extract Invoice Fields3. HTTP — AI Ex…Co4. Code — Parse Invoice JSON Safely4. Code — Parse…5a. Sheets — Log Invoice Header5a. Sheets — Lo…SO5b. Split Out — Line Items5b. Split Out —…Co6. Code — Add Unique Key and Line Metadata6. Code — Add U…7. Sheets — Log Each Line Item7. Sheets — Log…Ag8. Aggregate — Collect All Line Items8. Aggregate — …Co9. Code — Verify Totals and Build Report9. Code — Verif…10. Gmail — Send Extraction Report10. Gmail — Sen…12345678910
1/5
STEPS · 10
Starts on an incoming request

Quick overview This workflow collects an invoice PDF via an n8n Form, extracts text from the PDF, uses OpenAI to convert it into structured invoice JSON, logs invoice headers and line items to Google Sheets, validates totals, and emails a formatted extraction report via Gmail. How it works Receives an invoice submission through an n8n Form that includes the uploader’s name, email address, currency, notes, and a PDF file. Extracts text content from the uploaded PDF. Sends the extracted text to OpenAI (Chat Completions) to return invoice fields and all line items as a strict JSON object. Parses and validates the returned JSON, enriching it with the form metadata and stopping the run if key fields (like invoice number or line items) are missing. Appends a single invoice “header” row to the Invoices tab in Google Sheets. Splits the extracted line items, adds per-line metadata and a unique key, and appends each line item as a row to the Line Items tab in Google Sheets. Aggregates all line items, verifies that their summed totals match the invoice total within a tolerance, builds an HTML report, and emails it to the submitter via Gmail.

Tags

n8nreference-onlygmailgoogle-sheets
Connects
CCodegmailGmailsheetsGoogle SheetsWHTTP Request
CategoryGmail
Triggermanual
Complexitycomplex
Nodes11
AddedJun 26, 2026

Related workflows

See all Gmail
gmailsheetsW
free

Move data between JSON and spreadsheets

This workflow illustrates how to convert data from JSON to binary format and import JSON data or files into Google Sheets or local spreadsheets.

by Lorena
Cgmailsheets
free

📦 Electronic data interchange (EDI) message parsing with Gmail and Google Sheet

Tags: Supply Chain Management, Logistics, Transportation, Data Transmission Context Hey! I'm Samir , a Supply Chain Engineer and Data Scientist from Paris founder of LogiGreen Consulting We help small and medium businesses improve their logistics processes using AI, Data Analytics and Automation. > Sustainable and Efficient supply chains with N8N! 📬 For business inquiries, you can add me on Here What is an EDI Message? Electronic Data Interchange (EDI) is a standardized method of automatically transferring data between computer systems. They ensure the smooth flow of essential transactional data, such as purchase orders, invoices, shipping notices, and more. For instance, a manufacturing company can receive purchase orders from a retailer via EDI. However, they need complex integration for the transmission and processing of the messages. Who is this template for? This workflow template is designed for small companies that cannot connect to their customers and need to manually process the EDI messages received. How does it work? This workflow uses a Gmail Trigger that analyzes all the incoming emails. 📧 Gmail Trigger → Detects emails with "EDI" in the subject. 📜 Parses EDI Mes

by Samir Saci
gmailsheetsWtelegram
free

Monitor SSL Certificate Expiry with Google Sheets and Multi-Channel Alert

SSL Expiry Alert System Who is this for? This workflow is ideal for administrators or IT professionals responsible for monitoring SSL certificates of multiple websites to ensure they do not expire unexpectedly. Problem SSL certificates play a crucial role in ensuring secure communication over the internet. However, if not monitored closely, they can expire, leading to potential security risks and service disruption. This workflow helps in proactively monitoring SSL certificate expiry dates. Functionality Pulls URLs to monitor from a Google Sheet. Checks SSL certificates using SSL-Checker.io. Updates Google Sheet with SSL details such as expiry date and certificate status. Sends email alerts for SSL certificates nearing expiry (<30 days) or invalid certificates. Setup Clone the provided Google Sheet and update the Google Sheet URL in the "URLs to Monitor" node. Set up Google Sheets and Gmail credentials in n8n. Configure the Discourse Trigger for weekly monitoring. Customize email/telegram/ntfy alert settings as needed. Customization Modify the frequency of monitoring by adjusting the trigger interval in the "Weekly Trigger" node. Customize email content and recipients in the "Se

by Jesse Davids