Skip to content
FlowHubFluxonLab
C
AI Automationfree

Extract & Classify Invoices & Receipts with Gmail, OpenAI and Google Drive

by Tomadapted from n8n official workflow galleryUpdated Aug 2026
RequiresCCodeGmailGmailGoogle DriveGoogle DriveOpenAI
Share Post Share
OpenAISeConfigureCoIterate over email attachmentsIterate over em…NONot a PDFIfIs text within token limit?Is text within …MeMergeIfIs matchedUpload file to folderUpload file to …WeWebhookRTRespond to WebhookRespond to Webh…Create folderCoAggregate attachmentsAggregate attac…IfSend email with invoices?Send email with…Send to my accountantSend to my acco…Get emails with attachmentsGet emails with…RPRead PDF email attachmentsRead PDF email …IfIs attachment a PDF?Is attachment a…FiOptional filter for emailsOptional filter…123456789101112131415161718
1/5
STEPS · 18
Starts on an incoming request

Who is it for? Anyone who wants to automatically aggregate their invoices or receipts. Main beneficiaries: small business owners and freelancers. How it works Creates a folder in Google Drive for uploading invoices and receipts. Responds (Webhook response) with URL to the created folder. Gets all emails with attachments from a Gmail mailbox. (Optional) Filters emails, e.g. exclude emails sent to specific address. Filters only PDF attachments. Classifies all PDF attachment contents with an AI model (is it a receipt or an invoice?). Uploads receipts and invoices to the created Google Drive folder and optionally sends an email with the attachments to, e.g., your accountant. Pre-conditions/Requirements Gmail and Google Drive accounts A Google Cloud OAuth 2.0 Client ID or a service account with Google Drive and Gmail APIs enabled OpenAI API account and API key Set up steps Provide credentials for the nodes: Gmail, Google Drive, OpenAI. Configure parameters in the "Configure" node. Most importantly: "sendInvoicesTo" for the email address where invoices/receipts should be sent. It uses a Webhook node trigger.

Tags

n8nreference-onlygmailgoogle-driveopen-ai
Connects
CCodegmailGmailgoogledriveGoogle DriveOpenAI
CategoryAI Automation
Triggermanual
Complexitycomplex
Nodes18
AddedApr 26, 2025

Related workflows

See all AI Automation
ACDgmail
free

AI: Summarize podcast episode and enhance using Wikipedia

The workflow automates the process of creating a summarized and enriched podcast digest, which is then sent via email. Note that to use this template, you need to be on n8n version 1.19.4 or later.

by n8n Team
ACgmailW
free

Send weekly blended ad performance reports with Meta, Google Ads, GA4 and OpenAI

Quick overview This workflow runs every Monday at 8am to pull the last 7 days of performance from Meta Ads, Google Ads, and GA4, calculate blended KPIs, generate an OpenAI-powered narrative summary, email an HTML report via Gmail, and post an internal update (and errors) to Slack. How it works Runs every Monday at 8am on a scheduled trigger. Fetches the last 7 days of spend and engagement metrics from the Meta Ads Insights API, campaign cost and conversion metrics from the Google Ads API, and conversions and revenue by channel from the GA4 Reporting API. Combines the three datasets and calculates blended KPIs including total spend, total conversions, total revenue, and ROAS. Sends the computed metrics to an OpenAI chat model to generate a 3–4 sentence client-friendly performance summary with one risk and one recommendation. Builds a simple HTML report containing the KPIs and AI summary. Emails the HTML report to the client via Gmail and posts a brief confirmation with spend and ROAS to a Slack channel. If the workflow fails, posts an error alert message to an ops Slack channel. Setup Configure authentication for the HTTP requests to Meta Ads (access token), Google Ads (OAuth/access

by Redowan Ahmed Farhan
binaryinputloaderembeddingsopenaigoogledriveopenaichatmodel
free

Ask questions about a PDF using AI

The workflow first populates a Pinecone index with vectors from a Bitcoin whitepaper. Then, it waits for a manual chat message. When received, the chat message is turned into a vector and compared to the vectors in Pinecone. The most similar vectors are retrieved and passed to OpenAI for generating a chat response. Note that to use this template, you need to be on n8n version 1.19.4 or later.

by David Roberts