Outlook · n8n · AI classifier · Slack alerts · approval workflow
Overview
This project organizes incoming Outlook email for an internal business workflow. It detects message type from sender, subject, body, keywords, and AI classification, then routes each email to the right folder, department, or responsible person.
The system also forwards selected messages with attachment handling, posts Slack notifications, prepares approval-based reply drafts, sends morning calendar reminders, and reports daily category totals.
The private workflow keeps real email addresses, mailbox folders, credentials, Slack channels, and company-specific identifiers inside n8n. The public material will document only sanitized architecture and helper patterns.
The challenge
A shared mailbox can receive marketing, accounting, offers, meeting notes, customer-service topics, project topics, company-specific messages, spam, and normal replies in the same stream.
The challenge was to reduce manual sorting while still keeping responsibility clear. Emails needed to be moved, forwarded, summarized, or reviewed based on context instead of staying unread in one inbox.
My role
I built the n8n workflow architecture for Outlook email classification, folder routing, forwarding with attachments, Slack notifications, scheduled summaries, and approval-based reply handling.
I also separated the public explanation from the private workflow so the project can be reviewed without exposing mailbox content, real people, credentials, or internal addresses.
Workflow structure
Core modules
Master email trigger
The workflow starts from unread Outlook messages. It extracts the sender, subject, body, attachments, and metadata needed for downstream classification and routing.
Central email classifier
A classifier evaluates the cleaned email content and routes it into operational categories such as marketing, accounting, offers, meeting notes, internal handoff, company-specific senders, spam, and unclassified items.
Department and person routing
Depending on the category, an email can be moved to a dedicated Outlook folder, forwarded to a responsible person, or escalated through Slack. Attachment branches handle text-only and attachment-based messages separately.
Approval-based reply draft
For selected incoming messages, the workflow can generate a professional draft reply, save it in Outlook, show a Slack approval request, and send only after manual approval.
Daily summary and cleanup
Scheduled branches count category folders, calculate daily totals, post summaries to Slack, and clean spam folders on a separate schedule.
Technical decisions
Routing is category-based
The workflow does not treat all incoming email the same way. Each category has its own action path, which makes the automation easier to explain and audit.
Forwarding keeps attachments in scope
Forwarding branches handle attachment and text-only cases separately. This avoids losing important context when an email is sent to the responsible person.
Slack is used for visibility
Slack notifications make routed emails visible without requiring the team to manually monitor every Outlook folder.
Generated replies need approval
AI can draft a response, but sending is blocked until a human approves the preview. This keeps the workflow useful without making outbound communication unsafe.
Tech stack
Proof / Evidence
This case study is based on a private Outlook automation workflow. The public proof focuses on architecture, design decisions, and sanitized snippets. Original workflow exports, real email addresses, credential names, Slack channel IDs, mailbox data, and company-specific routing identifiers are not published.
Public proof shown on this page
A sanitized architecture diagram showing Outlook email intake, field extraction, AI classification, folder routing, forwarding, approval-based reply drafting, Slack alerts, and daily summaries.
Live system
Public code & documentation
Sanitized architecture notes and JavaScript helper snippets from an internal Outlook email routing automation built with n8n, Microsoft Outlook, Slack, Azure OpenAI, forwarding rules, and approval-based reply handling.
Code excerpt: routing decision helper
The public snippets should show sanitized decision patterns only. The real workflow categories, addresses, folders, and private routing identifiers stay outside the public repository.
const CATEGORY_TO_ACTION = {
accounting: "forward_to_accounting",
offers: "move_to_offers",
meeting_notes: "move_to_notes",
marketing: "move_to_marketing",
spam: "quarantine",
unclassified: "notify_for_review",
};
function decideEmailRoute(classification) {
const category = String(classification.category || "").toLowerCase();
const confidence = Number(classification.confidence || 0);
if (!CATEGORY_TO_ACTION[category] || confidence < 0.65) {
return {
action: "notify_for_review",
reason: "Low confidence or unknown category",
};
}
return {
action: CATEGORY_TO_ACTION[category],
reason: "Matched " + category + " with confidence " + confidence,
};
}Publication note
The public repository should be a documentation and snippet reference only. It must not include original workflow JSON, mailbox content, credential references, real email addresses, Slack workspace identifiers, internal folder names, or company-specific routing data.