Complete the Triage System

Support Inbox Commander - Challenge 6 of 6
Difficulty
5/10
Tags
Gmail TriggerText ClassifierSwitchAI AgentTool WorkflowGmailOpenAIAI AgentsAI Tools
Requirements
All previous challenges in this journey completed

The outcome: After this challenge, you'll have a complete AI-powered email triage system running autonomously. Emails arrive, get classified, routed to specialized agents, and handled automatically.

Why this matters: Email triage is one of the most common automation use cases. This final challenge connects all the pieces you've built into a cohesive, production-ready system. You'll also learn the patterns for building any multi-agent workflow.

This challenge adds the polish needed for production: fallback routes for edge cases and rate limiting.

What you'll learn:

  • System integration - connecting complex multi-agent workflows
  • Production readiness - fallbacks and rate limiting
  • End-to-end testing - verifying the complete flow works

Your Task

  1. 1Copy the exercise below
  2. 2Paste into your n8n editor (Ctrl+V)
  3. 3Solve it — use hints if you get stuck
  4. 4Check the solution when done

Complete your email triage system with production-ready features:

1. Add a Fallback Route for Unclassified Emails:

  • Add a 5th category "Other" to your Text Classifier
  • Connect it to a Gmail Create Label node that adds an "Other" or "Needs Review" label
  • This catches emails that don't fit your categories

2. Add a Wait Node for Rate Limiting:

  • Add a Wait node (1 second) between your classifier and agents
  • This prevents hitting API rate limits when processing multiple emails quickly

3. End-to-End Testing:

  • Send test emails for each category and verify correct routing
  • Send an ambiguous email to test the "Other" fallback

Hints

Adding the Fallback Route:

  • Open your Text Classifier and click "Add Category"
  • Name it "Other" with description: "Emails that don't fit other categories"
  • Add a Gmail Create Label node connected to the 5th output
  • Set it to add a label like "Other" or "Needs Review"

Adding the Wait Node:

  • Drag a Wait node between the classifier outputs and your label nodes
  • Set "Amount" to 1 and "Unit" to Seconds
  • This small pause prevents overwhelming the API

Testing:

  • Send clear emails for each category
  • Send something ambiguous like "random question about weather" to test fallback

Explanation

Why Fallback Routes Matter:

AI classification is never 100% accurate. Some emails will be ambiguous or fall outside your defined categories. Without a fallback, these emails disappear into limbo. The "Other" category ensures every email gets handled, even if it needs human review.

Why Wait Nodes Matter:

APIs have rate limits. When your workflow processes multiple emails quickly (like a burst of 10 emails), you can hit these limits and get errors. A 1-second pause between API calls is cheap insurance against rate limit failures.

System Prompts Are Everything:

The quality of your agents depends entirely on their system prompts. The example prompts in this solution are just a starting point. For production use, you'll need to iterate on:

  • Tone and personality for your brand
  • Specific instructions for your business context
  • Edge case handling
  • What information to include or exclude
  • How agents should sign off emails

Test with real emails and refine until the responses match what you'd write yourself. This iteration is where the real work happens.

The Complete Flow:

Email arrives → Gmail Trigger → Text Classifier → Wait (1s) → Gmail Label → Specialized Agent → Tool action

Tools in the Solution:

The solution uses Slack for urgent escalations, but you could use Telegram, Discord, or any messaging API. The Email Draft tool creates drafts in the original thread rather than sending directly - this lets you review responses before they go out, which is safer for production.

Next Steps:

Your triage system is complete! To enhance it further:

  • Add more categories as needs grow
  • Create additional specialized agents
  • Build more tools (CRM lookup, ticket creation)
  • Add human approval for high-stakes actions
  • Keep iterating on your system prompts

Congratulations on building an AI-powered email triage system!

Copy the Solution

Paste into n8n with Ctrl+V to compare with your approach.

Login to see the exercise

Create an account to access challenges and track your progress.

Log in to see exercise

Related Content

Continue your learning journey with these related challenges and guides: