Templates / Build custom AI agent with LangChain & Gemini (self-hosted)

Build custom AI agent with LangChain & Gemini (self-hosted)

Needs changes

by shepard · 6,183 views · created 2025-03-26 · Miscellaneous, AI Chatbot

Needs 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.

  1. Construct & Execute LLM Prompt (LangChain Code): uses LangChain Code, with model: Google Gemini Chat Model; memory: Store conversation history

Services it uses

Google Gemini Chat Model

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.0Replace with
LangChain Code (legacy)
Construct & Execute LLM Prompt
No direct replacement

Nodes used (4)

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…

Excerpt from shepard's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.