appscript.dev
Blog Gmail

How I built an AI assistant that triages my inbox overnight

Sorting and drafting Northwind replies while I sleep — I wake up to a queue, not a heap.

By Awadesh Madhogaria · Published Sep 30, 2025

The Northwind support inbox used to be the first thing that drained me each morning. Forty or fifty overnight messages, all mixed together — sales enquiries next to billing questions next to genuine fires. Sorting them was a job before the actual job.

The inbox itself was not really the problem; the problem was the cold start. Every message needed reading just to work out what kind of message it was, sales leads sat unseen behind billing questions for an hour, and I wrote the same three or four replies, slightly reworded, every single day. By the time I had triaged everything, half my focus for the day was already spent. I wanted to arrive at a sorted, half-drafted queue — not a heap. So I built something that does the sorting, and a first pass at the replies, while I sleep.

How it works

At 3am London time, a time-based trigger fires and the script works through the unread support mail on its own:

  1. Pull all unread support mail.
  2. Classify each by intent (sales / support / billing / other).
  3. Label accordingly.
  4. For each, generate a draft reply (Claude Sonnet).
  5. Tag the thread with support/drafted so it is never reprocessed.

By the time I sit down, every message is sorted and every message has a starting draft waiting in it. The script does the heavy lifting; I do the judgement. I give the intent labels a quick scan to see the shape of the day at a glance, then read each draft and approve, edit, or delete it before hitting send. What used to be triage plus writing is now mostly reviewing — 30 to 45 minutes saved per morning. The two halves of this, intent routing and pre-staged drafts, are each worth a closer look: I cover them in Predict email intent and route it and Pre-stage overnight draft replies for review.

The failure mode I planned around

The honest weakness of this system is hallucination. Occasionally a draft states a fact — a price, a date, a policy — that is plausible and wrong. So I built one hard rule into the workflow: drafts ALWAYS get human review, and are never auto-sent. The AI prepares the reply; it never speaks for Northwind on its own. The support/drafted tag matters here too, because it guarantees the script never processes a thread twice, so I never get a stack of duplicate drafts.

That single safeguard is what makes the rest of the payoff safe to enjoy. I get 30 to 45 minutes back every morning, at the point of day when focus is scarcest. Sales leads are visible immediately, not buried behind billing questions. Replies are consistent, because the common ones start from the same draft. And nothing risky ever leaves the building, because every send is still a human decision.

The takeaway

The win was not letting AI answer my email. It was letting AI do the sorting and the first draft, and keeping the judgement and the send button for myself. Triage overnight, decide in the morning.