Templates / Monitor AI chat interactions with Gemini 2.5 and Langfuse tracing

Monitor AI chat interactions with Gemini 2.5 and Langfuse tracing

Needs changes

by Eduardo Hales · 1,523 views · created 2025-06-16 · Engineering, 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 to replace before upgrading

Removed in 3.0Replace with
LangChain Code (legacy)
Langfuse LLM
No direct replacement

Nodes used (5)

Google Gemini Chat ModelSimple MemoryLangChain CodeAI Agent

What it does

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. How it works This workflow is a simple AI Agent that connects to Langfuse so send tracing data to help monitor LLM interactions. The main idea is to create a custom LLM model that allows the configuration of callbacks, which are used by langchain to connect applications such Langfuse. This is achieves by using the "langchain code" node: - Connects a LLM model sub-node to obtain the model variables (model name, temp and provider) - Creates a generic langchain initChatModel with the model parameters. - Return the LLM to be used by the AI Agent node. 📋 Prerequisites - Langfuse instance (cloud or self-hosted) with API credentials - LLM API key (Gemini, OpenAI, Anthropic, etc.) - n8n >= 1.98.0 (required for LangChain code node support in AI Agent) ⚙️ Setup 1. Add these to your n8n instance: bash Langfuse configuration LANGFUSESECRETKEY=yoursecretkey LANGFUSEPUBLICKEY=yourpublickey LANGFUSEBASEURL=https://cloud.langfuse.com or your self-hosted URL LLM API key (example for Gemini) GOOGLEAPIKEY=yourapikey Alternative: Configure these directly in the LangChain code node if you prefer not to use environment variables 2. Import the workflow JSON 3. Connect your preferred LLM model node 4. Send a test message to verify tracing appears in Langfuse

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.