outlook.message.receivedclassifier.route()forward.with.attachmentsslack.summary.post
← Back to projects
Case study

Outlook · n8n · AI classifier · Slack alerts · approval workflow

13
Tracked categories
Outlook
Email operations
Slack
Alerts and summaries
Approval
Before AI replies
n8nMicrosoft OutlookAzure OpenAISlackJavaScript
Jump to proof of work

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.

01 / Problem

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.

02 / Role

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.

03 / Architecture

Workflow structure

01Unread Outlook email is received
02Email fields are extracted and normalized
03Sender and content checks run before classification
04AI classifier assigns an operational category
05Rule branches route the email to a folder or responsible person
06Attachments are handled before forwarding when needed
07Slack posts a routing or security notification
08Selected replies are drafted and sent only after approval
09Daily category counts are calculated
10Summary is posted to Slack for operational visibility
04 / Modules

Core modules

01

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.

02

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.

03

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.

04

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.

05

Daily summary and cleanup

Scheduled branches count category folders, calculate daily totals, post summaries to Slack, and clean spam folders on a separate schedule.

05 / Decisions

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.

06 / Stack

Tech stack

n8nWorkflow orchestration, routing branches, Code nodes, schedules, waits, and merges
Microsoft OutlookIncoming email trigger, folder moves, forwarding, draft creation, sending, and calendar lookup
Azure OpenAIAI-assisted classification and reply drafting for selected workflows
SlackOperational alerts, approval previews, daily summaries, and visibility for routed email
JavaScriptEmail cleanup, category counting, summary calculation, and routing helper logic
07 / Proof

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

Outlook Email TriggerExtract Email FieldsAI ClassifierFolder RoutingForwarding BranchApproval DraftSlack AlertsDaily Summary

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

The actual n8n workflow canvas for the Outlook email routing automation — the same flow the architecture diagram above abstracts.

Public code & documentation

Valentino-Veljanovski / outlook-email-routing-automation-snippetsPublic

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.

n8noutlookmicrosoft-365email-routingslackazure-openaiworkflow-automationhuman-approvaljavascriptpublic-snippets
View on GitHub

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.

routing-decision-helper.jsjavascript
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.

← Back to all projects