Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

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

  1. New invoice email
  2. Settings
  3. Compute accounting month
  4. Find year folder
  5. Year folder exists?
  6. Year folder ID
  7. Create year folder
  8. Loop over emails
  9. Find month folder
  10. Month folder exists?
  11. Collect invoice files
  12. Create month folder
  13. Has PDF file?
  14. Label email as processed

29 steps in total.

Similar automations