Process invoices from Gmail and Drive using Google Gemini, Slack, and Sheets
Quick overview This workflow monitors Gmail and a Google Drive folder for new invoice/receipt files, uses Google Gemini to extract structured invoice data and classify expense categories, logs results to Google Sheets, and routes higher-value invoices to Slack for approve/reject decisions with automatic ledger updates.
How it works Triggers every minute for unread Gmail messages with invoice/receipt attachments and for new files created in a specified Google Drive folder. Filters incoming files to PDFs or images, marking unsupported Gmail messages as read and notifying a Slack channel when a file type is skipped. Sends each supported document to Google Gemini to extract invoice fields as JSON, then parses and validates the output and posts to Slack when extraction is incomplete or totals don’t reconcile. Checks Google Sheets for an existing row with the same invoice number and, if found, skips logging and notifies Slack about the duplicate. Uses Google Gemini to assign an expense category, then determines whether the invoice requires approval based on a total amount threshold. Appends the invoice to a Google Sheets ledger as Approved for under-threshold totals, or as Pending Review and sends a Slack message with Approve/Reject buttons for over-threshold totals. Waits up to three days for the Slack decision and then updates the matching Google Sheets row to Approved, Rejected, or No Response, while posting a Slack alert if the workflow errors.
Setup Add credentials for Gmail, Google Drive, Google Sheets, Google Gemini (PaLM API), and Slack. Create/select a Google Sheets document with an invoices sheet and columns matching the fields this workflow writes (for example: vendor_name, invoice_number, invoice_date, due_date, subtotal, tax, total, currency, category, source, needsApproval, status) and set the document in all Google Sheets nodes. Choose the Google Drive folder to watch and set the target Slack channel in each Slack node. For Slack approvals, configure a Slack app with interactivity enabled, set the Request URL to your n8n waiting webhook endpoint, and provide the bot token and signing secret in the Slack credential. In n8n workflow settings, set this workflow as the error workflow (or ensure the Error Trigger is enabled) so failures post to Slack, then activate the workflow.
Related Templates
Automated Work Attendance with Location Triggers
his workflow automates time tracking using location-based triggers. How it works Trigger: It starts when you enter or e...
Automated SEO Performance Collection from Google Search Console to NocoDB
Problem Monitoring SEO performance from Google Search Console (GSC) manually is repetitive and prone to human error. Fo...
Summarize SERPBear data with AI (via Openrouter) and save it to Baserow
Who's this for? If you own a website and need to analyze your keyword rankings If you need to create a keyword report on...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments