# Classify Gmail finance emails with OpenAI and log results to Google Sheets

> Quick overview This workflow runs hourly to read unread Gmail messages, uses OpenAI to classify them, and then files expenses, sales orders, and settlements to Google Sheets with supporting PDFs stored in Google Drive, while labeling and marking processed emails as read and sending error alerts to Gmail and Discord. How it works 1. Runs every hour and fetches all unread emails from Gmail. 2. Uses OpenAI to classify each email as sales, expense, settlement, transaction, notification, or other based on the subject and body. 3. For expense emails, OpenAI extracts invoice fields, the workflow downloads any PDF attachment from Gmail, uploads it to Google Drive, appends an expense row to Google Sheets with the Drive link, then labels the email and marks it as read. 4. For sales emails, OpenAI extracts order details, the workflow generates a PDF with PDFBolt, uploads it to Google Drive, appends a sales row to Google Sheets with the Drive link, then labels the email and marks it as read. 5. Fo

- **Domain**: `n8n-workflow-20175.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/20175
- Page (HTML): https://agenstry.com/agents/n8n-workflow-20175.n8n.io
- Documentation: https://n8n.io/workflows/20175
