Exercise 1: Email Classification System

Build an intelligent email classification system that automatically processes, categorises, and routes emails using AI.

Exercise 1 Overview


45-Minute Hands-On Exercise

This exercise teaches you dynamic routing - a fundamental automation pattern where different situations get handled differently automatically. Perfect for beginners, no coding experience required.

The Problem: Professionals receive 50-150 emails daily. Manual sorting is time-consuming, important messages get buried, and urgent requests slip through. You need an intelligent system that automatically understands and routes emails based on content, not just rules.

Why Dynamic Routing Matters:

Instead of one giant AI trying to handle everything, you’ll learn to divide and conquer:

  • More reliable: Simpler logic means fewer failures
  • Faster: Each AI handles one specific task, not everything
  • Easier to debug: Know exactly which step failed
  • Easy to enhance: Add new categories without breaking existing logic

This is how professional automations work in the real world.

What You’ll Build

A complete automation workflow featuring:

  • Real-time email monitoring with Gmail API
  • AI-powered classification using natural language processing
  • Intelligent routing system based on priority and sentiment
  • Automated labelling for inbox organisation
  • Analytics logging to Google Sheets
graph LR
    A[Gmail Inbox] --> B[AI Classifier]
    B --> C[Smart Router]
    C --> D[Labels & Logging]

    style A fill:#e1f5fe
    style B fill:#fff3e0
    style C fill:#f3e5f5
    style D fill:#e8f5e9

Skills You’ll Demonstrate

By completing this exercise, you will have demonstrated:

  • AI Integration: Connecting and using language models for text classification
  • API Orchestration: Working with Gmail API, AI services, and Google Sheets
  • Workflow Design: Building multi-step automation with conditional logic
  • Data Processing: Extracting, transforming, and routing information

The Pattern You’ll Master

The Intelligent Triage & Routing pattern you’ll learn applies to:

  • Customer Support: Categorise tickets, assign priority, route to specialists
  • Error Monitoring: Analyse logs, determine severity, trigger alerts
  • Document Processing: Classify documents, route for approval, track workflow
  • Social Media: Monitor mentions, detect sentiment, escalate issues
  • Lead Qualification: Score leads, categorise inquiries, assign to sales team

Exercise Structure

⚙️ Part A: Setup

Gmail, OpenRouter, Sheets integration

Start here →

🔧 Part B: Build & Test

Trigger, classify, route, label, log

Build →

🏆 Challenges

Multi-language, auto-reply, analytics

Level up →

Quick Navigation

Section What You’ll Do Duration
Part A: Setup Create accounts, configure API keys, connect services 15 min
Part B: Build & Test Build complete classification and routing workflow 25 min
Challenges Extend with advanced features and integrations Optional


Table of contents


Back to top

Copyright © 2024 AI Automation Mastery. Built with Jekyll and Just the Docs.