This n8n template shows you how to automate customer support email triage with a sovereign AI. By combining Gmail for inbox monitoring and the IONOS AI Model Hub, every customer email is classified and replied to by AI.
A Gmail Trigger polls your inbox every minute for new unread messages. A Filter node immediately discards anything not addressed to your support@ or info@ address, so irrelevant mail never reaches the AI.
The Prepare Email Data code node strips HTML, removes quoted reply chains, and extracts the clean fields — sender, subject, date, recipient, and body — with no prompt logic mixed in.
The Basic LLM Chain node then takes over: it sends the cleaned email to the IONOS AI Model Hub (Mistral Small 24B) with a structured prompt that instructs the model to return a single JSON object containing the category, priority, sentiment, detected language, a one-sentence summary, and a full draft reply written in the same language as the customer's email.
A Parse AI Response code node extracts and validates the JSON, with a graceful fallback if the model output is malformed. A Switch node routes Spam emails to a silent mark-as-read action, while all other categories trigger the Gmail Create Draft node — which saves the AI-written reply directly into your Drafts folder, threaded to the original conversation. Your agent reviews it and clicks Send.
Filtering: The Filter node uses a partial match on support@ and info@. For a stricter match, update the values to your full addresses (e.g. [email protected]).
Model selection: The IONOS AI Model Hub offers several LLMs including Mistral Small 24B, and Nemo. For email triage and reply drafting, Mistral Small 24B the best balance of reasoning quality and response speed.
Language support: The prompt instructs the model to detect the email language and reply in kind — no additional configuration needed for multilingual inboxes.