Generate Lookio RAG-backed Gmail drafts from incoming emails with GPT-4.1
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.
What this workflow does
This AI workflow has 7 nodes and runs on Gmail events. Along the way it connects OpenAI Chat Model and Gmail.
How it runs
Trigger: On Gmail events.
- Formulate question for knowledge base (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI Chat Model
- Lookio API call (HTTP Request): calls an HTTP API (POST)
- Write email draft (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI Chat Model; output parser: Structured Output Parser
- Create email draft (Gmail): work with draft
Services it uses
Other OpenAI + Gmail templates (1,623)
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.
- Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (New email incoming).
Nodes used (6)
- HTTP Request
n8n-nodes-base.httpRequest - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Gmail Trigger
n8n-nodes-base.gmailTrigger - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Gmail
n8n-nodes-base.gmail
From the author
This n8n template automatically generates knowledge-backed draft email replies when a new message arrives in a connected Gmail account. The workflow extracts a clean question from the incoming email using an LLM, queries a Lookio assistant (your RAG knowledge…