Triage Gmail inbox, route emails with Jev, and draft replies with OpenAI
UnknownUnknown. This template uses community nodes we can't verify statically. Uses community nodes that can't be verified statically (unverified community packages are off by default in 3.0). Static check, last run 2026-10-19.
Community nodes
These come from third-party npm packages. In n8n 3.0 unverified community packages are off by default (N8N_UNVERIFIED_PACKAGES_ENABLED=false).
@typesafe-ai/n8n-nodes-typesafe-ai(Score email with Jev, Route email to department)
Nodes used (8)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Edit Fields (Set)
n8n-nodes-base.set - Type Safe Ai
@typesafe-ai/n8n-nodes-typesafe-ai.typeSafeAi - Gmail
n8n-nodes-base.gmail - If
n8n-nodes-base.if - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Data table
n8n-nodes-base.dataTable
What it does
Quick overview This workflow monitors unread Gmail inbox messages, uses TypeSafe AI Jev to score urgency and route each email to a department label, and, when a reply is needed, uses OpenAI to generate a Gmail draft reply and logs all decisions to an n8n Data Table. How it works 1. Triggers every minute when a new unread email arrives in your Gmail inbox. 2. Extracts key fields (sender, subject, body, thread ID) and builds a condensed email context for downstream processing. 3. Uses TypeSafe AI Jev to score the email’s urgency and estimate whether it needs a personal reply and whether the sender is upset. 4. Uses TypeSafe AI Jev to route the email to Sales, Support, Billing, Partnerships, Newsletters, Spam, or a low-confidence “To review” path. 5. Adds the corresponding Gmail label to the message and records the chosen department and routing confidence. 6. If Jev predicts the email needs a reply (and it is not Spam or Newsletters), OpenAI generates a short reply draft and saves it as a Gmail draft in the same thread. 7. Logs the email metadata, Jev scores, routing decision, and whether a draft was created to an n8n Data Table. Setup 1. Add a Gmail OAuth2 credential and ensure the Gmail trigger can read unread emails from your target mailbox. 2. Install and configure the TypeSafe AI community node (@typesafe-ai/n8n-nodes-typesafe-ai) if needed, then add a TypeSafe AI API credential for the two Jev steps. 3. Add an OpenAI API credential and select the model you want to use for drafting replies. 4. Create the required Gmail labels (Sales, Support, Billing, Partnerships, Newsletters, Spam, and To review) and map each label ID in the corresponding Gmail labeling steps. 5. Create an n8n Data Table for logging and select its ID in the logging step, then update the Configuration values (company context, thresholds, signature, and body length) before activating. Additional info !VIDEO 📥 Open full documentation on Notion Need help customizing? Contact me for consulting and support : Linkedin