Library / Documents, PDF & OCR
Documents, PDF & OCR
Extract Turkish invoice data from Gmail PDFs into Google Sheets with Gemini
Runs on new Gmail messages, splits invoice PDF attachments, extracts their text via Google Drive, reads invoice and line-item data with Gemini, and writes the results to Google Sheets.
What it does
## AI Invoice Processing ### How it works This workflow monitors Gmail for incoming messages with invoice attachments, separates each attachment, and processes them one at a time. It temporarily uploads and downloads each file through Google Drive, extracts the file text, uses Gemini-powered AI steps to classify and read invoice data, then writes invoice and line-item details into Google Sheets. Non-invoice or rejected files are routed to a cleanup path that deletes the temporary Drive file, while completed sheet writes merge back into the loop for the next attachment. ### Setup steps - Connect and authorize Gmail credentials for the Gmail Trigger, and configure the trigger filters to match the mailbox or labels where invoice emails arrive. - Connect Google Drive credentials and set the upload/download/delete nodes to use the intended temporary folder or file handling settings. - Connect Google Gemini credentials for both AI nodes, and verify the structured output schemas match the fields expected downstream. - Connect Google Sheets credentials and configure both append-row nodes with the target spreadsheet, sheets, and column mappings. - Test with sample invoice and non-invoice attachments to confirm classification, extraction, deletion, and looping behavior. ### Customization You can customize the Gmail search criteria, the Drive temporary storage location, the Gemini prompts and structured schemas, and the Google Sheets column mappings for different invoice formats or additional extracted fields.
The steps
- When Email Received
- Set Email Fields
- Split Attachments
- Merge Email Data
- Upload to Google Drive
- Download from Google Drive
- Extract Invoice Data
- Parse Structured Output
- Loop Over Attachments
- Parse Structured Details
- If Status Is Valid
- Delete from Google Drive
- AI Invoice Agent
- Append to Invoice Sheet
21 steps in total.
Similar automations
Documents, PDF & OCRExtract invoice and PO data from Gmail PDFs into XML, CSV and JSON17 stepsDocuments, PDF & OCRExtract text from PDFs and images into CSV with Gemini and Google Drive12 stepsDocuments, PDF & OCRExtract Drive Invoice Data to Sheets with Dumpling AI7 stepsDocuments, PDF & OCRExtract and validate invoice data from PDFs with DeepSeek and webhooks11 steps