Library / Files & Cloud Storage
Files & Cloud Storage
Save, extract, and log email invoices with Gmail, Drive, Sheets, Claude, and PDF.co
When a new email arrives, it manages files with Claude using Gmail, Google Drive, Google Sheets, PDFco Api.
What it does
## Save email invoices to Google Drive, sorted by month, with a monthly invoice sheet Watches Gmail for invoice emails, files every invoice in Google Drive under Invoices folder → YYYY → YYYY-MM, and logs it in a monthly Google Sheet. Missing folders and sheets are created automatically. ### How it works 1. New invoice email checks Gmail every 15 minutes for invoice emails not yet labelled invoices-processed. 2. Compute accounting month works out the year and month folder names from the date the email arrived, and finds the invoice link in the email if there is one. 3. Each email is handled one at a time: the year and month folders are found, or created if missing. 4. PDF attachments are used as they are. Invoices sent as a link (Paddle, Stripe, ...) are downloaded, or rendered to a print-style PDF with PDF.co. 5. Claude reads each invoice: supplier name, supplier VAT code, issue date, amount and currency. 6. The PDF is saved as YYYY-MM-DD - name.pdf and a row is added to Invoices YYYY-MM in the month folder. 7. The email gets the invoices-processed label so it is never filed twice. ### Setup (about 10 minutes) 1. Connect Gmail, Google Drive, Google Sheets and Anthropic credentials. 2. In Gmail, create a label called invoices-processed, then pick it in Label email as processed. 3. In Settings, paste the ID of your invoices folder (the part after /folders/ in its Drive URL). Set filePreviousMonth to true if invoices received early in a month belong to the previous month. 4. Adjust the Gmail search in New invoice email to match your suppliers. 5. Optional: connect PDF.co for invoices that only arrive as a web link, and list allowed sites in renderLinkDomains. 6. Test with an invoice email, then activate the workflow.
The steps
- New invoice email
- Settings
- Compute accounting month
- Find year folder
- Year folder exists?
- Year folder ID
- Create year folder
- Loop over emails
- Find month folder
- Month folder exists?
- Collect invoice files
- Create month folder
- Has PDF file?
- Label email as processed
29 steps in total.
Similar automations
Email AutomationSend personalized campaign PDFs from Google Sheets with PDF.co and Gmail5 stepsFiles & Cloud StorageSave LINE Files to Google Drive and Log URLs in Sheets23 stepsFiles & Cloud StorageSave LINE Files to Google Drive and Log Links58 stepsFiles & Cloud StorageLine Save File to Google Drive and Log File's URL23 steps