Master Your First AI Email Agent with Smart Fallback! Welcome to your hands-on guide for building a resilient, intelligent email support system in n8n! This workflow is specifically designed as an educational tool to help you understand ad…
Download this n8n workflow template and start using it instantly.
Welcome to your hands-on guide for building a resilient, intelligent email support system in n8n! This workflow is specifically designed as an educational tool to help you understand advanced AI automation concepts in a practical, easy-to-follow way.
This powerful template enables you to create an automated email support agent that:
To use this workflow, you'll need:
Embark on your journey to building intelligent, resilient automation systems today!
AI Agent (Agent): The AI agent that orchestrates the workflow — it reasons over the input and decides which tools to call.
Gmail Trigger (Gmail Trigger): Starts the workflow when a new email arrives in Gmail.
Simple Memory (Memory Buffer Window): Gives the AI short-term conversational memory of recent messages.
Append or update row in sheet in Google Sheets (Google Sheets Tool): Lets the AI agent read from or write to Google Sheets as a callable tool.
OpenAI Model (LLM Chat Open AI): Provides the OpenAI chat model (GPT) that powers the AI reasoning in this workflow.
Gemini Chat Model (LLM Chat Google Gemini): Provides Google Gemini as the chat model for the AI steps.
Reply to a message(Thread) (Gmail): Sends or reads email through Gmail.
How it works This template launches your very first AI Agent —an AI-powered chatbot that can do more than just talk— it can take action using tools. Think of an AI Agent as a smart assistant, and the tools are the apps on its phone. By connecting it to other nodes, you give your agent the ability to interact with real-world data and services, like checking the weather, fetching news, or even sending emails on your behalf. This workflow is designed to be the perfect starting point: The Chat Interface: A Chat Trigger node provides a simple, clean interface for you to talk to your agent. The Brains: The AI Agent node receives your messages, intelligently decides which tool to use (if any), and formulates a helpful response. Its personality and instructions are fully customizable in the "System Message". The Language Model: It uses Google Gemini to power its reasoning and conversation skills. The Tools: It comes pre-equipped with two tools to demonstrate its capabilities: 1. Get Weather: Fetches real-time weather forecasts. 2. Get News: Reads any RSS feed to get the latest headlines. The Memory: A Conversation Memory node allows the agent to remember the last few messages, enabling natural, follow-up conversations. Set up steps Setup time: ~2 minutes You only need one thing to get started: a free Google AI API key. 1. Get Your Google AI API Key: Visit Google AI Studio at aistudio.google.com/app/apikey. Click "Create API key in new project" and copy the key that appears. 2. Add Your Credential in n8n: On the workflow canvas, go to the Connect your model (Google Gemini) node. Click the Credential dropdown and select + Create New Credential. Paste your API key into the API Key field and click Save. 3. Start Chatting! Go to the Example Chat node. Click the "Open Chat" button in its parameter panel. Try asking it one of the example questions, like: "What's the weather in Paris?" or "Get me the latest tech news."* That's it! You now have a fully functional AI Agent. Try adding more tools (like Gmail or Google Calendar) to make it even more powerful.
Want to check out all my flows, follow me on: https://maxmitcham.substack.com/ https://www.linkedin.com/in/max-mitcham/ Email Manager - Intelligent Gmail Classification This automation flow is designed to automatically monitor incoming Gmail messages, analyze their content and context using AI, and intelligently classify them with appropriate labels for better email organization and prioritization. How It Works (Step-by-Step): 1. Gmail Monitoring (Trigger) Continuously monitors your Gmail inbox: `` Polls for new emails every minute Captures all incoming messages automatically Triggers workflow for each new email received ` 2. Email Content Extraction Retrieves complete email details: ` Full email body and headers Sender information and recipient lists Subject line and metadata Existing Gmail labels and categories Email threading information (replies/forwards) ` 3. Email History Analysis AI agent checks relationship context: ` Searches for previous emails from the same sender Checks sent folder for prior outbound correspondence Determines if this is a first-time contact (cold email) Analyzes conversation thread history ` 4. Intelligent Classification Agent Advanced AI categorization using: ` Claude Sonnet 4 for sophisticated email analysis Context-aware classification based on email history Content analysis for intent and urgency detection Header analysis for automated vs. human-sent emails ` 5. Smart Label Assignment Automatically applies appropriate Gmail labels: ` To Respond: Requires direct action/reply FYI: For awareness, no action needed Notification: Service updates, policy changes Marketing: Promotional content and sales pitches Meeting Update: Calendar-related communications Comment: Document/task feedback ` 6. Structured Processing Ensures consistent labeling: ` Uses structured output parsing for reliability Returns specific Label ID for Gmail integration Applies label automatically to the email Maintains classification accuracy ` Tools Used: ` n8n: Workflow automation platform Gmail API: Email monitoring and label management Anthropic Claude: Advanced email content analysis Gmail Tools: Email history checking and search Structured Output Parser: Consistent AI responses ` Key Features: ` Real-time email monitoring and classification Context-aware analysis using email history Intelligent cold vs. warm email detection Multiple classification categories for organization Automatic Gmail label application Header analysis for automated email detection Thread-aware conversation tracking ` Ideal Use Cases: ` Busy executives managing high email volumes Sales professionals prioritizing prospect communications Support teams organizing customer inquiries Marketing teams filtering promotional content Anyone wanting automated email organization Teams needing consistent email prioritization ``
How it works This template is a complete, hands-on tutorial that lets you build and interact with your very first AI Agent. Think of an AI Agent as a standard AI chatbot with superpowers. The agent doesn't just talk; it can use tools to perform actions and find information in real-time. This workflow is designed to show you exactly how that works. 1. The Chat Interface (Chat Trigger): This is your window to the agent. It's a fully styled, public-facing chat window where you can have a conversation. 2. The Brain (AI Agent Node): This is the core of the operation. It takes your message, understands your intent, and intelligently decides which "superpower" (or tool) it needs to use to answer your request. The agent's personality and instructions are defined in its extensive system prompt. 3. The Tools (Tool Nodes): These are the agent's superpowers. We've included a variety of useful and fun tools to showcase its capabilities: Get a random joke. Search Wikipedia for a summary of any topic. Calculate a future date. Generate a secure password. Calculate a monthly loan payment. Fetch the latest articles from the n8n blog. 4. The Memory (Memory Node): This gives the agent a short-term memory, allowing it to remember the last few messages in your conversation for better context. When you send a message, the agent's brain analyzes it, picks the right tool for the job, executes it, and then formulates a helpful response based on the tool's output. Set up steps Setup time: ~3 minutes This template is nearly ready to go out of the box. You just need to provide the AI's "brain." 1. Configure Credentials: This workflow requires an API key for an AI model. Make sure you have credentials set up in your n8n instance for either Google AI (Gemini) or OpenAI. 2. Choose Your AI Brain (LLM): By default, the workflow uses the Google Gemini node. If you have Google AI credentials, you're all set! If you prefer to use OpenAI, simply disable the Gemini node and enable the OpenAI node. You only need one active LLM node. Make sure it is connected to the Agent parent node. 3. Explore the Tools: Take a moment to look at the different tool nodes connected to the Your First AI Agent node. This is where the agent gets its abilities! You can add, remove, or modify these to create your own custom agent. 4. Activate and Test! Activate the workflow. Open the public URL for the Example Chat Window node (you can copy it from the node's panel). Start chatting! Try asking it things like: "Tell me a joke." "What is n8n?" "Generate a 16-character password for me." "What are the latest posts on the n8n blog?" "What is the monthly payment for a $300,000 loan at 5% interest over 30 years?"
Who’s it for This template is designed for anyone who wants to use Telegram as a personal AI assistant hub. If you often juggle tasks, emails, calendars, and expenses across multiple tools, this workflow consolidates everything into one seamless AI-powered agent. What it does Jarvis listens to your Telegram messages (text or audio) and processes them with OpenAI. Based on your request, it can: Manage tasks (create, complete, or delete) Handle calendar events (schedule, reschedule, or check availability) Send, draft, or fetch emails with Gmail Retrieve Google Contacts Log and track expenses All responses are returned directly to Telegram, giving you a unified command center. How to set up 1. Clone this template into your n8n workspace. 2. Connect your accounts (Telegram, Gmail, Google Calendar, Contacts, etc.). 3. Add your OpenAI API key in the Credentials section. 4. Test by sending a Telegram message like “Create a meeting tomorrow at 3pm” or “Add expense $50 for lunch.” or "Draft a reply with a project proposal to that email from Steve" Requirements n8n instance (cloud or self-hosted) Telegram Bot API credentials Gmail, Google Calendar, and Google Contacts credentials (optional, if using those features) OpenAI API key ElevenLabs API Key (optional, if you need audio note support) How to customize Swap Gmail with another email provider by replacing the Gmail MCP node. Add additional MCP integrations (e.g., Notion, Slack, CRM tools). Adjust memory length to control how much context Jarvis remembers. With this template, you can transform Telegram into your all-in-one AI assistant, simplifying workflows and saving hours every week.