π¬ Track and log receipt expenses in Google Sheets with Gmail, Drive, and Claude
β‘ 21 views Β· π¬ Document Extraction & Analysis
Description
Quick Overview
This workflow monitors Gmail and a Google Drive folder for receipts, uses Anthropic Claude to extract expense details from email bodies, PDFs, and images, archives attachments to Google Drive, and appends validated expenses to a Google Sheets log with a link to the original receipt.
How it works
- Triggers every minute when new Gmail messages matching the query
label:receiptsarrive and downloads any attachments. - Normalizes the email content, and if an attachment exists, uploads it to Google Drive to generate a permanent Drive link.
- Triggers every minute when a new file is created in a specified Google Drive folder, downloads the file, and normalizes it as a receipt input.
- Routes each item as PDF, image, or email-body text, extracting PDF text when needed.
- Uses Anthropic Claude (text or vision) to extract structured receipt fields (vendor, date, total, currency, category, and payment method) and flags whether the content is a real receipt.
- Filters out non-receipts and appends the remaining expenses to Google Sheets, including the receipt link and a timestamp.
Setup
- Connect credentials for Gmail, Google Drive, and Google Sheets, and select the target Google Sheets document and sheet for logging.
- Add an Anthropic credential and select the Claude model for both the text and vision extraction steps.
- In Gmail, create and apply a βreceiptsβ label (or update the Gmail query) so receipt emails are captured.
- In Google Drive, choose a folder to watch for uploaded receipt photos/PDFs and a folder to store archived email attachments.
- Create the Google Sheet columns used by the workflow (Date, Vendor, Total, Currency, Category, Payment Method, Source, Receipt Link, Logged At).
π Nodes Used
Google Sheets, Google Drive, Google Drive Trigger, Gmail Trigger, Basic LLM Chain, Anthropic Chat Model
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File