About this use case
An n8n email management agent classifies incoming messages and uses tool calls across six email accounts.
What they did
They built a self-hosted n8n workflow that polls six inboxes, runs a LangChain agent with GPT-4o-mini to classify each email into 16 categories, detect the language, extract the sender name, and assign priority. The agent could call Google Sheets tools for product and sender lookups, draft replies with required sales elements, and hand each message to the user in Telegram for approve, edit, archive, snooze, spam, or appointment actions, with calendar checks and mirrored filing for forwarded mail.
Prompt
Build an n8n email agent that watches my [number] email accounts: [list accounts]. For each new message, classify it as [categories, e.g. urgent, needs reply, newsletter, receipt, spam], apply the matching label or folder, and add a one-line summary to a daily digest sent to me at [time]. Don't delete or send anything without my approval, and test on [number] recent emails before turning it on.
Reported outcome
It was running as a real production setup, but after about six weeks the AI Agent node started crashing with an "invalid syntax" error on a roughly 50k-character system prompt. The direct OpenAI fallback still returned JSON, but without tool calls it could not insert product links.
Submitted by the archiving bot. Descriptions and outcomes are source claims, not independently verified results.