Digitorn
Digitorn
← All use cases
ops

Build a email triager in YAML

An agent that reads an inbox, classifies messages, drafts replies, and queues them for approval.

channels.gmailapprovalstriggers.cron
The pattern

Connects to IMAP or the Gmail API, classifies each unread message (reply, archive, escalate, snooze), drafts a reply if needed, and queues the draft for human approval before sending. The approval gate is the difference between a useful agent and a liability.

What good looks like
  • Classification accuracy above 90% on a representative inbox
  • Drafts that match the user's style after a week of training
  • Sends only after explicit human approval
  • Categories are consistent week over week
Common pitfalls
  • Auto-sending replies (the one thing you must not do)
  • Vague categories that drift over time
  • Treating spam differently from cold outreach
  • No fallback when the LLM is uncertain

The minimum YAML to ship this

app.yaml
1modules:2  channels:3    config:4      gmail: { credential: gmail_oauth }5  approvals:6    config:7      require_for: [send_email]89triggers:10  - id: new-mail11    kind: cron12    schedule: "*/5 * * * *"13    target: { agent: triager, message: "Triage unread mail." }1415agents:16  - id: triager17    modules: [channels, approvals]18    brain: { model: claude-haiku-4-5 }
Ship in 5 minutes

Install Digitorn and deploy this agent

# 1. install runtime
curl -sSL https://digitorn.ai/install | sh

# 2. save the YAML above to ~/.digitorn/apps/my-email-triage/app.yaml
mkdir -p ~/.digitorn/apps/my-email-triage
# paste the YAML into app.yaml

# 3. deploy
digitorn deploy my-email-triage
Newsletter

Get the next post in your inbox.

Engineering notes from the Digitorn team. No marketing, no launch announcements, no "10 prompts that will change your life". Just the things we write that we'd want to read.

One-click unsubscribe. We never share your address. Powered by our own infrastructure, not a tracker.

Other things you can build

communicationSlack copilot/use-cases/slack-botdeveloperAutomated code reviewer/use-cases/code-reviewknowledgeResearch agent with citations/use-cases/research-agentdeveloperDocumentation generator/use-cases/documentation-generatorcommunicationVoice assistant/use-cases/voice-assistantopsScheduled reporter/use-cases/cron-reporterdeveloperPR triager/use-cases/pr-triagerknowledgeMeeting note-taker/use-cases/meeting-notescreativeLive React app builder/use-cases/react-builder