# Classify and file email PDF documents with Gmail, pdfRest, Drive and Claude

> Quick overview This workflow monitors Gmail for emails with PDF attachments, OCRs scanned documents with pdfRest when needed, converts PDFs to Markdown, uses Anthropic Claude via n8n's Information Extractor to classify and extract key fields, then files each PDF to Google Drive, logs it in Google Sheets, and notifies Slack. How it works 1. Triggers every minute from Gmail for emails matching has:attachment filename:pdf and downloads all attachments. 2. Splits each email into one item per attachment and normalizes the binary file field so every PDF is processed individually. 3. Uses pdfRest to read PDF metadata (page count and whether it is image-only) and runs pdfRest OCR to make scans searchable when needed. 4. Converts the PDF to Markdown with pdfRest and uses Anthropic Claude (via the Information Extractor) to classify the document type and extract counterparty and document date. 5. Routes the document to an invoice, contract, correspondence, or other path and uploads the PDF to the

- **Domain**: `n8n-workflow-19694.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/19694
- Page (HTML): https://agenstry.com/agents/n8n-workflow-19694.n8n.io
- Documentation: https://n8n.io/workflows/19694
