Turn invoice emails into a bookkeeping spreadsheet
Each weekday morning, scan your inbox for new invoices and receipts, read them with OCR, and log a clean row for every one in Google Sheets.
Every weekday at 8am, scan my Gmail for new invoice and receipt emails from the last day, read each attachment with OCR, and log a clean row for every confirmed invoice in my Google Sheets bookkeeping ledger.
Trigger: cron, every weekday at 8am in my local timezone.
On each run, do this:
1. Use Gmail's List Messages with a query like "has:attachment newer_than:1d (invoice OR receipt OR statement)" to find candidate emails.
2. For each match, call Gmail's Get a Message to fetch the full payload, then use Get Attachment to pull each PDF or image attachment.
3. Hand each attachment to JigsawStack's Extract Data with Vision OCR to get structured text out of the file.
4. Reason over the OCR output. Decide whether this really is an invoice or receipt, and pull out vendor, invoice number, issue date, currency, subtotal, tax, total, and a short category guess (software, travel, hardware, meals, subscriptions, etc).
5. Before writing, use Google Sheets Get Values to read the existing Bookkeeping tab and skip any row where the same vendor and invoice number already exist. This keeps the workflow safe to re-run.
6. For confirmed invoices, use Google Sheets Append Values to add a row to the Bookkeeping tab with: date, vendor, invoice number, currency, subtotal, tax, total, category, and a link back to the original Gmail message.
7. For anything ambiguous (low OCR confidence, missing total, the attachment doesn't look like an invoice, or it would be a duplicate), Append Values to a separate Needs review tab instead of dropping it, with a short reason in a notes column so I can clean it up by hand.
At the end of the run, output a brief summary: how many rows were added to Bookkeeping, how many went to Needs review, and how many duplicates were skipped.
Integrations: jigsawstack, gmail, google-sheets.
Additional information
What does this prompt do?
- Runs every weekday at 8am and scans your Gmail for fresh invoices, receipts, and statements from the last day.
- Reads the PDF or image attached to each email and pulls out vendor, total, date, tax, and a category guess like software, travel, or meals.
- Appends a tidy row to your Bookkeeping tab in Google Sheets, with a link back to the original email so you can always find the source.
- Sends anything fuzzy, low confidence, or that doesn't actually look like an invoice to a separate Needs review tab so nothing gets silently dropped.
- Skips duplicates by matching vendor and invoice number against rows you already have, so it's safe to run as often as you want.
What do I need to use this?
- A Gmail inbox where your invoices, receipts, and statements arrive.
- A Google Sheets spreadsheet with a Bookkeeping tab and a Needs review tab.
- A JigsawStack account, which powers the vision OCR step that reads the attachments.
How can I customize it?
- Change the schedule. Every weekday at 8am is the default, but daily, weekly, or end of month work just as well.
- Adjust the email filter so it matches your actual senders, labels, or keywords like subscription or hosting.
- Edit the category list the agent uses to tag each expense so it matches how your books are organized.
Frequently asked questions
Does this delete or move the original emails in my inbox?
Will it create duplicate rows if I run it more than once?
What happens if the OCR isn't confident or the file isn't really an invoice?
Can I use this for personal receipts instead of business invoices?
Do I need a special Google Sheets template?
Stop hand-typing receipts into your bookkeeping sheet.
Connect Gmail, Google Sheets, and JigsawStack once, and Geni logs every invoice for you each weekday morning.