Intelligent Gmail Label Management with AI & Discord Notifications
How it works This workflow will trigger upon new mail in your gmail inbox and will automatically apply existing labels OR identify, create, then apply up to 5 new labels. This is currently set up to run using a OpenAI endpoint which I have set up connected to my local llama.cpp server running. After your email is done labeling, the workflow will send you a nice notification in your discord channel!
Set up Instructions This workflow requires a Gmail OAuth account credential with the ability to create labels and label messages [OPTIONAL] You can create a Discord Bot Account which connects with a Bot Token which will summarize the email and show you which labels were created and added in the workflow. You might want to tweak the prompts a bit based on how detailed you want your labels. I've found after running it for a bit that the labels that get created mostly encompass everything I want.
Workflow Hints The workflow works in 5 phases Phase 1:** Find existing Gmail labels as options for the LLM to choose from. Phase 2:** LLM chooses labels or defines new ones Phase 3:** Create additional Gmail labels if needed Phase 4:** Label the message with newly created and existing labels Phase 5:** Rewrite and send a message notification via Discord.
Screenshot 1:
Note: colors are my own
Screenshot of notification sent via discord
Model Tips I set this up to run completely using offline models. I had good success with Llama.cpp server with gpt-oss-20B and with a bit more tweaking could get it to work with a smaller gemma3-4b model mostly likely as well. The whole workflow runs in about 5-10 seconds on my Blackwell Nvidia GPU. Probably would be a few seconds slower on an older piece of hardware.
Related Templates
AI Email Classifier & Auto-Delete for Gmail (SPAM/OFFER Cleaner)
This workflow is designed for freelancers, solopreneurs, and business owners who receive a high volume of irrelevant mes...
Generate Food Recipes from Gmail & Form Requests with Ollama & Llama 3.2
This n8n template demonstrates how to create an intelligent food recipe assistant that accepts requests via Gmail and we...
Automatic News Summarization & Email Digest with GPT-4, NewsAPI and Gmail
📰 AI News Digest Agent: Auto News Summarizer & Email Newsletter Create an intelligent news curation system that automat...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments