Turn receipt photos and emails into a clean expense log (Gmail + AI + Google Sheets)
Snap or forward a receipt and it lands in a categorized expense sheet, with the original saved and anything doubtful flagged for you.
The problem
Receipts pile up in the truck, in your camera roll, and in your inbox (supply houses, fuel, software, Uber). Once a month, or once a year, someone types date, vendor, and total into a spreadsheet by hand. Thermal paper fades, the reason for the purchase is forgotten, and your bookkeeper gets a shoebox.
What it does
You email receipts to one address: a phone photo, a PDF, or a forwarded e-receipt. Within a minute or two the workflow saves the original to a private Google Drive folder, has AI read the vendor, date, subtotal, tax, tip, total, and card last 4, picks a category from your list, and adds a row to a Google Sheet. It checks the numbers before trusting them. If something is off (the total doesn't add up, there's no date, the AI isn't sure, or it's a big purchase), the row is marked needs_review and you get an email with the reason and a link to the receipt. The same file sent twice is only logged once.
- Import
receipt-capture-expense-log.n8n.json. - In Gmail, create a label called
receiptsand a filter that applies it, for example to anything sent toyourname+receipts@gmail.com. From your phone, share a receipt photo to Mail and send it there. Forward e-receipts to the same address. - Open Gmail: new receipt email and add a Gmail OAuth2 credential. It checks every minute for unread emails labeled
receiptsand downloads their attachments. - Open Your settings and fill in BUSINESS_NAME, OWNER_EMAIL, FROM_EMAIL (on a domain you verified in Resend), and your CATEGORIES list (one comma-separated list, ideally the one your bookkeeper uses). MIN_CONFIDENCE (0.8), REVIEW_OVER_AMOUNT (500), and MIN_IMAGE_KB (15) are safe defaults.
- On Save original to Drive, add a Google Drive credential and pick a private folder such as
Receipts. - On Read receipt with AI, add a Header Auth credential: name
Authorization, valueBearer <your OpenAI API key>. The default model, gpt-4o-mini, reads photos and PDFs, and the reply is locked to a strict JSON schema. - On Add to expense sheet, add a Google Sheets credential and pick a blank sheet. The first row it writes creates the column headers.
- On Email me: receipt to check, add a Header Auth credential for Resend (
Authorization: Bearer <key>). - Test with three emails to yourself: a photo, a PDF, and a forwarded e-receipt. Check the rows and the Drive folder, then activate.
How it decides: every photo over 15 KB and every PDF in the email counts as one receipt. Smaller images are usually logos or signatures, so they're skipped. If an email has no usable attachment, the email text itself is read, which covers Uber, Amazon, and software receipts. A row is marked auto only when the vendor, date, and total are all present, subtotal + tax + tip matches the total, the AI's confidence is at least 0.8, the category comes from your list, and the total is $500 or less. Everything else is marked needs_review with plain reasons in Review Notes. The sheet keeps Category (AI) next to Category (Final), so you can see where the AI and your corrections disagree.
Credentials: the OpenAI and Resend nodes use generic Header Auth credentials. Settings live in the Your settings node rather than environment variables, so this works on n8n Cloud and on self-hosted n8n 2.x, where env access from workflows is blocked by default. Skip repeat receipts remembers file fingerprints between runs. If a run fails after that step (for example an OpenAI outage that outlasts the 3 automatic retries), retry that execution from n8n's Executions list. Don't resend the email, because the repeat would be skipped.
Make / Zapier notes
Check what you already pay for first. QuickBooks Online, Xero, and Zoho Books all have a receipt app or forwarding address, and Dext or Hubdoc do this as a service. If your books live there and the built-in capture works for you, use it. This recipe is for when you want a Google Sheet you own and your bookkeeper can open, your own category list, a review queue instead of silent guesses, and originals stored in your own Drive.
Make and Zapier both handle the photo path well with their native Gmail, Drive, OpenAI, and Sheets modules. n8n is the easiest place to get the extra safety checks (math check, fingerprint dedupe, e-receipt fallback) in one workflow. Sending invoices rather than paying them? See Overdue invoice reminders.
Compliance notes
This is record-keeping, not messaging. The only email goes to you, so CAN-SPAM and TCPA don't apply. The IRS asks you to keep receipts that support your deductions, generally for 3 years after you file (longer in some cases; see How long should I keep records?). Electronic copies are fine if they're accurate, legible, and you can pull them up later (Rev. Proc. 97-22). That's why the original goes to Drive, not just the numbers. For meals, travel, and vehicle costs you also need the business purpose (Topic 305). Type the job or reason in the email subject when you send the receipt, and it's saved in the Email Subject column. Only the card's last 4 digits are kept. Keep the Drive folder and sheet private, and check your AI provider's data settings (OpenAI says API data isn't used for training by default). The AI category is a suggestion, not tax advice. Your bookkeeper or CPA has the final say.
Expected result
Receipts get logged the day you get them instead of in a January panic. Most rows come through as auto. You spend a few minutes a week on the needs_review ones, and at tax time you hand over one sheet with a link to every original.
Workflow file: receipt-capture-expense-log.n8n.json