Sort email attachments by document type
They built an n8n workflow that sends inbox attachments to Gemini, then files each one by type and handles purchase orders separately.
- What they did
- They set up a roughly 50-step n8n flow for a busy mailbox. The workflow grabs attachments from incoming mail, asks Gemini to label each file as invoice, quote, statement, PO, or other, and then sends most of them to the matching Google Drive folder. When the system spots a PO, it looks up the related estimate in QuickBooks Online, adds the PO number, uploads the file, and creates the linked invoice. They also built in retries, a separate error folder, and spreadsheet checkpoints so they can trace where each document ended up.
- How it went
- The workflow had not gone live yet, so there were no production numbers to share. The builder said they were still uneasy about switching it on in the live environment. The main protection they mentioned was tracking each document’s route or failure point.
- Tips
- This kind of setup needs solid error handling from the start, especially for timed-out API calls. It also helps to keep a separate log and failure folder so you can review anything that does not classify cleanly.
Try it yourself with n8n
Set up a workflow for [email account or mailbox] that checks for new attachments, downloads each file, and uses Gemini to sort it into invoice, quote, statement, purchase order, or other. Record the sender, filename, and label in [Google Sheet or tracking file], then route the file to the right [folder or drive path]. If the file is a PO, pause and show me the matched estimate and proposed invoice update in QuickBooks Online before you create, upload, or save anything, and wait for my approval first. Run this on [number] test emails and report any failures, retries, or files sent to an error folder.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Orchestrate coding agents across your business tasks
A founder used a controller tool to spin up agents that wrote content and handled bug fixes from feedback.
Set up daily appointment reminders in n8n
Have n8n read today’s calendar entries, make reminder calls with Retell AI, and send a follow-up text through Twilio.
Set up a Gmail summarizing flow with a custom Gem
They built a Workspace Studio flow that summarizes incoming Gmail and writes reply drafts for review.
Automate hiring handoff and slot watching with n8n
They used n8n to move a hiring request through approval into IT setup, and to monitor medical calendars until a bookable slot appeared.
Let the agent choose models for each step
A user let Perplexity Computer handle several tasks on its own, and it switched models as needed, including for code writing.
Save newsletter summaries to Notion from email
They used n8n to pull in unread newsletters, summarize the ones that passed filters, and write the results to Notion.