Build custom AI agent with LangChain & Gemini (self-hosted)
Needs changesNeeds changes. This template uses 1 thing(s) that n8n 3.0 removes: LangChain Code (legacy). 1 breaking item(s) found. Static check, last run 2026-10-19.
What this workflow does
This AI workflow has 4 nodes and runs when a chat message arrives. Along the way it connects Google Gemini Chat Model.
How it runs
Trigger: When a chat message arrives.
- Construct & Execute LLM Prompt (LangChain Code): uses LangChain Code, with model: Google Gemini Chat Model; memory: Store conversation history
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- LangChain Code (legacy) in Construct & Execute LLM Prompt: no direct replacement.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| LangChain Code (legacy) Construct & Execute LLM Prompt | No direct replacement |
Nodes used (4)
- Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - LangChain Code
@n8n/n8n-nodes-langchain.code
From the author
Overview This workflow leverages the LangChain code node to implement a fully customizable conversational agent. Ideal for users who need granular control over their agent's prompts while reducing unnecessary token consumption from reserved tool-calling…