AgentHub

Log email receipts to Google Sheets with Gmail and OpenAI

Quick Overview

Live
Open / InstallLast updated July 27, 2026

Description

Quick Overview This workflow logs Gmail receipt attachments to Google Sheets by extracting structured fields with OpenAI (including category selection from your list), prevents duplicates by checking the ledger, and sends a monthly spending summary email via Gmail based on last month’s rows. How it works Triggers when a Gmail message matching has:attachment subject:receipt arrives or when a schedule runs on the 1st of the month at 8am. For receipt emails, looks up the Gmail message ID in Google Sheets and stops if the receipt is already logged. If the receipt is new, extracts text from PDF attachments or transcribes image receipts using OpenAI vision. Sends the receipt text to OpenAI to extract receipt_date, merchant, amount, currency, and a category chosen only from your predefined category list. Appends one cleaned expense row to Google Sheets with the extracted fields plus a processed timestamp, Gmail message ID, and the original email subject. For the monthly run, reads the full Google Sheets ledger, totals last month’s expenses by category, and emails the summary to you via Gmail. Setup Connect Gmail credentials for the Gmail Trigger and for sending the monthly summary email. Connect Google Sheets credentials and select the target spreadsheet and sheet in the lookup, append, and read operations. Add an OpenAI API key for the OpenAI vision transcription and the structured extraction steps, and confirm the chosen model (for example, gpt-4o-mini). Create a Google Sheet with headers processed_at, gmail_message_id, receipt_date, merchant, amount, currency, category, source_subject so the lookup and append operations map correctly. Update the settings values for your recipient email address, default currency, category list, and (optionally) the Gmail search query to match your labeling or subject conventions. An n8n automation workflow template by 43 Sunsets.

Author

43 Sunsets

Platform

web

Pricing model

free

Categories

Automation
AI

Tags

n8n
workflow
google-sheets
gmail
code
basic-llm-chain
openai-chat-model
structured-output-parser
openai

Capabilities

  • 7 nodes
  • 1 views