What this automation does
The shared mailbox stops being one person’s daily sorting job. Every message is labeled and in front of its owner within a minute or two.
- Watch the mailbox. The workflow polls the shared Gmail account or the Microsoft 365 shared mailbox for new messages every minute or two.
- Skip what does not need a decision. Replies in already-labeled threads, auto-replies, bounces and messages from your own domain are filtered out by code before any model call.
- Classify. A model reads sender, subject and the newest message text and returns a bucket (new sales inquiry, existing customer request, billing or vendor, job applicant, partner or press, solicitation, personal or misdirected), a short reason and any extracted details such as company name and phone number.
- Act per bucket. Sales inquiries create a contact and deal in HubSpot and notify the owner in Slack. Customer requests go to the account manager. Vendor bills are forwarded to the AP address. Applicants are forwarded to hiring. Solicitations are labeled and archived.
- Report. A daily digest lists anything still unlabeled or unanswered for more than one business day.
When it is worth building
This earns its keep when the shared inbox gets a few dozen real messages a day and someone senior is the one sorting it. The cost is not only their time. Leads sit for hours because the person who sorts mail was in meetings all morning.
If the inbox is mostly customer support, a better answer is moving it into a helpdesk and using ticket triage and routing there. If what you really want is for emails to become to-dos, see turning emails into tasks. And if the inbox gets ten messages a day, Gmail filters plus a sensible person are fine.
Architecture
| Layer | What we use | Why |
|---|---|---|
| Mailbox | Gmail (Google Workspace) or an Outlook shared mailbox in Microsoft 365 | Works where the mail already lands, no migration |
| Orchestration | n8n | Built-in Gmail and Outlook nodes for reading, labeling and sending, plus HubSpot, Slack and Asana; forwarding is sent as a new message or through the mail API with HTTP Request |
| Pre-filter | Code step checking headers, sender domain and thread ID | Removes auto-replies, bounces and existing threads cheaply before the model sees them |
| Classifier | Claude Haiku 5.5 or Claude Sonnet 5.5 with structured output | Short prompts, fast responses, and reliable JSON for the routing step |
| Routing table | Google Sheet mapping bucket to owner, label and action | The office manager can change who owns what without editing the workflow |
| Destinations | HubSpot, Asana, Slack, forwarding addresses | Each bucket lands in the tool its owner already checks |
How to build it
- Pull two to four weeks of the inbox and sort a sample of 200 messages by hand into buckets. If you cannot agree on a bucket for a message, the model will not either, so tighten the definitions.
- Create labels in Gmail or categories in Outlook that match the buckets, plus
ai-triagedandai-unsure. - Set up mailbox access. In Google Workspace, use OAuth on the shared account or a service account with domain-wide delegation. For Microsoft 365, grant the app access to the shared mailbox through Microsoft Graph and scope it to that mailbox only.
- Write the pre-filter. Drop messages with
Auto-Submittedor out-of-office headers, delivery failures, your own domain, and any thread already carrying a triage label. - Write the classifier prompt with your buckets, one-line definitions, and examples of the hard cases (a customer who is also a vendor, a recruiter who looks like a lead).
- Build the actions per bucket from the routing sheet. For leads, search HubSpot by email before creating a contact so you do not make duplicates.
- Run label-only for a week. Apply labels but do not forward or create records. Check the labels each day.
- Turn on actions bucket by bucket, starting with the ones that were right every time.
The downloadable starter template below covers Gmail polling, the pre-filter, classification and labeling, with a HubSpot step for sales inquiries.
What breaks in production
- Microsoft Graph permissions on shared mailboxes. Access often fails silently because the app was granted access to a user mailbox but not the shared one. Test reads, label changes and sends separately during setup.
- Two people acting on the same email. A human sorts a message while the workflow also routes it. Check for an existing label immediately before acting, and give the team a week’s notice that sorting is now automatic.
- Phishing that looks like a vendor invoice. Forwarding a spoofed invoice to AP gives it legitimacy. Check SPF and DKIM results in the headers and send failed-authentication messages to
ai-unsure, never to AP. - Newsletters and notifications flooding the classifier. Marketing mail is high volume and never needs a decision. Filter on
List-Unsubscribeheaders before the model call to cut cost. - Long signature blocks and quoted history. Strip them before classifying, or a short new question gets lost under three pages of thread.
- Owner out of office. A lead routed to someone on vacation waits a week. Read a simple out-of-office column in the routing sheet and fall back to a backup owner.
Timeline and cost
One mailbox with six to eight buckets and three or four destination systems typically takes one to two weeks. Lumeor sets up shared inbox triage in the range of $3,000 to $8,500. The low end is labeling plus Slack notifications. The high end adds CRM record creation with duplicate checks, several mailboxes, and the daily unanswered digest. Model usage for a few thousand messages a month is usually a small line item, especially after the pre-filter removes newsletters and auto-replies.
How to measure success
- Time from arrival to owner notified, which should drop from hours to minutes
- Time to first reply on sales inquiries, the number that most directly affects revenue
- Messages relabeled by a person, counted weekly and reviewed by bucket
- Messages unanswered after one business day, from the daily digest
- Hours per week the former sorter spends in the inbox, asked directly after the first month