Classify and route email attachments with easybits, Gmail and Google Drive
What This Workflow Does Receive any business document via email. The attachment is automatically classified (Invoice, Contract, or Purchase Order) using easybits Extractor, then routed down the correct path where a se...
Template notes
What This Workflow Does Receive any business document via email. The attachment is automatically classified (Invoice, Contract, or Purchase Order) using easybits Extractor, then routed down the correct path where a second Extractor pulls out document-specific data. Each route stores the file in Google Drive and triggers the appropriate action – Invoices go to a finance spreadsheet, Contracts and Purchase Orders trigger Slack notifications.
How It Works 1. Receive – Gmail polls for new emails with attachments every minute 2. Classify – easybits Extractor identifies the document type and returns a class label 3. Route – A Switch node sends the item down the matching path (Invoice / Contract / PO) 4. Merge Binary – The original file is merged back into the routed item (classification strips the binary) 5. Extract – A second easybits Extractor pulls fields specific to that document type 6. Merge Data + File – Extracted JSON and original binary are combined for upload 7. Store & Notify – The file is uploaded to Google Drive; Invoices update a spreadsheet, Contracts and POs trigger Slack alerts
---
Setup Guide
1. Create Your easybits Classification Pipeline 1. Go to extractor.easybits.tech and create a new pipeline 2. Add one field called documentclass 3. In the field prompt, describe your classification categories and how to identify each one (see the "easybits: Classify Document" node for a reference prompt) 4. The prompt should instruct the model to return exactly one category label – no explanations, no extra text 5. Adjust the categories and identification criteria to match your specific document types 6. Copy your Pipeline ID and connect the credential in the classification node
> 💡 Tip: The classification prompt is the heart of this workflow. The more specific your category descriptions and decision rules are, the more accurate your results will be.
2. Create Three Extraction Pipelines Create one pipeline per document type on extractor.easybits.tech: - Invoice pipeline – fields: invoicenumber, totalamount, currency, duedate, vendorname - Contract pipeline – fields: clientname, contracttype, contractvalue, currency, startdate, noticeperiod - Purchase Order pipeline – fields: suppliername, ponumber, orderdate, expecteddeliverydate, totalamount, currency
Connect each pipeline's credentials to the matching Extractor node.