Quick overview
This workflow polls Gmail for unread invoice or receipt emails, extracts text from PDF/CSV/Excel attachments (or uses the email body), parses key billing fields, and logs new entries to a Google Sheets “Invoices” tab, creating a Gmail draft for anything that needs manual review.
How it works
- Runs every hour and searches Gmail for unread messages matching the invoice/receipt query, downloading any attachments.
- Splits each email into one item per attachment, or falls back to using the email body text when there are no attachments.
- Extracts content from PDF, CSV, and Excel attachments into text or rows so it can be parsed.
- Parses the content to identify vendor, invoice/receipt number, invoice date, currency, subtotal, tax, and total, and assigns a confidence/status.
- If the item is ready to log, looks up the invoice_number in Google Sheets to prevent duplicates.
- Appends a new row to the Google Sheets “Invoices” tab when it is not already logged, otherwise skips it.
- Creates a Gmail draft addressed to you for low-confidence or unreadable items so you can review and enter them manually.
Setup
- Connect Gmail OAuth2 credentials for both the Gmail Trigger and the Gmail draft creation step.
- Connect Google Sheets OAuth2 credentials and create a spreadsheet with a sheet/tab named “Invoices” and the expected columns (including invoice_number).
- Paste your Google Sheets URL, set the sheet name, owner email, and default currency in the workflow’s configuration values.
- Review and adjust the Gmail search query to match your labeling and filtering preferences before activating the workflow.