Triage Gmail and draft replies with Ollama, Telegram and Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 18 nodes and runs manually, when you click “Execute workflow”. Along the way it connects Gmail, Ollama Chat Model, Telegram and Google Sheets.
How it runs
Trigger: Manually, when you click “Execute workflow”.
- Get Unread Emails (Gmail): get many
- BuildClassifierRequest (Code): runs custom JavaScript code
- Classifier Chain (Basic LLM Chain): sends a prompt to an LLM, with model: Ollama Chat Model; output parser: Structured Output Parser
- If: checks a condition and branches into true / false
- Extractor Chain (Basic LLM Chain): sends a prompt to an LLM, with model: Ollama Chat Model; output parser: Extractor Output Parser
- Skip-NoActionNeeded (Edit Fields (Set)): sets 2 fields: status, skip_reason
- Drafter Chain (Basic LLM Chain): sends a prompt to an LLM, with model: Ollama Chat Model; output parser: Drafter Output Parser
- Telegram: send and wait for a reply
- Approved? (If): checks a condition and branches into true / false
- Create Draft Reply (Gmail): work with draft
…plus 2 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (10)
- Manual Trigger
n8n-nodes-base.manualTrigger - Gmail
n8n-nodes-base.gmail - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Edit Fields (Set)
n8n-nodes-base.set - Ollama Chat Model
@n8n/n8n-nodes-langchain.lmChatOllama - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Telegram
n8n-nodes-base.telegram - Google Sheets
n8n-nodes-base.googleSheets
From the author
Quick Overview This workflow pulls unread Gmail messages, uses a local Ollama Llama 3.1 model to classify and extract action items, drafts a reply, and sends an approval request to Telegram before creating a threaded Gmail draft and logging the decision to…