See llms.txt for all machine-readable content.

Back to Templates

Log Gmail invoice attachments to Google Sheets with easybits and Telegram

Quick overview

This workflow polls Gmail for unread emails with attachments, extracts invoice fields using easybits Extractor, deduplicates by invoice number, logs new invoices to Google Sheets, and sends a Telegram alert with key totals.

How it works

  1. Triggers every minute by polling Gmail for unread emails and downloading their attachments.
  2. Filters out small inline/junk files (under 10 KB) and splits each remaining attachment into its own item for processing.
  3. Iterates through attachments, marks the source email as read in Gmail, and keeps only supported file types (PDF, JPEG, PNG, WebP).
  4. Sends each supported attachment to easybits Extractor to classify the document and extract invoice fields like vendor, invoice number, and totals.
  5. Continues only when the extracted document is classified as an invoice and looks up the invoice number in Google Sheets.
  6. Appends a new row to Google Sheets for invoices not already present and sends a formatted Telegram message with the vendor and amounts.

Setup

  1. Connect a Gmail OAuth2 credential and ensure the workflow has access to the mailbox you want to monitor.
  2. Add an easybits Extractor credential and configure your extractor pipeline to return document_class, invoice_number, vendor_name, service_name, service_period, total_net, vat_amount, and total_gross.
  3. Connect a Google Sheets credential, replace YOUR_GOOGLE_SHEET_ID, and ensure the target sheet tab contains matching column headers (for example, invoice_number, vendor_name, total_gross).
  4. Connect a Telegram bot credential and replace YOUR_TELEGRAM_CHAT_ID with your chat or channel ID.