AutomationMart
Home/Browse/Build custom AI agent with LangChain & Gemini (self-hosted)
n8n

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

n8nn8n4 modulesv1.0
Gemini

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 functionality (compared to n8n's built-in Conversation Agent). Setup Instructions 1. Configure Gemini Credentials: Set up your Google Gemini API key (Get API key here if needed). Alternatively, you may use other AI provider nodes. 2. Interact

At a glance

Build custom AI agent with LangChain & Gemini (self-hosted) is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Gemini. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
Gemini
Modules
4
Price
Free
Version
v1.0
Build custom AI agent with LangChain & Gemini (self-hosted) workflow diagram

About this workflow

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 functionality (compared to n8n's built-in Conversation Agent). Setup Instructions 1. Configure Gemini Credentials: Set up your Google Gemini API key (Get API key here if needed). Alternatively, you may use other AI provider nodes. 2. Interaction Methods: - Test directly in the workflow editor using the "Chat" button - Activate the workflow and access the chat interface via the URL provided by the When Chat Message Received node Customization Options 1. Interface Settings: Configure chat UI elements (e.g., title) in the When Chat Message Received node 2. Prompt Engineering: - Define agent personality and conversation structure in the Construct & Execute LLM Prompt node's template variable - ⚠️ Template must preserve {chathistory} and {input} placeholders for proper LangChain operation 3. Model Selection: Swap language models through the language model input field in Construct & Execute LLM Prompt 4. Memory Control: Adjust conversation history length in the Store Conversation History node Requirements: ⚠️ This workflow uses the LangChain Code node, which only works on self-hosted n8n. (Refer to LangChain Code node docs)

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Generate a legal website accessibility statement with AI and WAVE

Who is this for? This template is for any website owner, digital agency, or compliance officer operating within the European Union. It's designed for users who need to comply with the upcoming European Accessibility Act (EAA) but may not have deep technical or legal expertise. Disclaimer This workflow uses an npm package called "cheerio" to work with the specified URLs HTML code. Installing packages is only possible in self hosting. What problem is this workflow solving? / Use Case Starting June

Free

Retrieve and answer Gmail email queries with Llama 3.2, mxbai-embed, and Qdrant

Self-Hosted This workflow provides a complete end-to-end system for automatically managing your inbox by reading incoming questions, matching them to approved guidelines, and sending consistent, 24/7 replies. By combining local AI processing with an automated retrieval-augmented generation (RAG) pipeline, it ensures fast resolution times without compromising data privacy or incurring ongoing AI API costs. Who is this for? This is designed for University Admissions, Student Support Teams, Custome

Free

WhatsApp RAG chatbot with Supabase, Gemini 2.5 Flash, and OpenAI embeddings

WhatsApp RAG Chatbot with Supabase, Gemini 2.5 Flash, and OpenAI Embeddings This n8n template demonstrates how to build a WhatsApp-based AI chatbot that answers user questions using document retrieval (RAG) powered by Supabase for storage, OpenAI embeddings for semantic search, and Gemini 2.5 Flash LLM for generating high-quality responses. Use cases are many: Turn your WhatsApp into a knowledge assistant for FAQs, customer support, or internal company documents — al

Free

AI video generator for eCommerce product catalogs with Veo 3.1

AI Video Generator for eCommerce Product Catalogs Transform static product images from any online store into engaging animated videos using Google's Veo 3.1 AI. Simply submit a catalog page URL and automatically generate professional product showcase videos where models pose and move to display clothing and fashion items from multiple angles - perfect for elevating product pages with dynamic content that increases conversion rates. How it works Submit any eCommerce catalog page URL

Free

Search Google, Bing, Yandex & extract structured results with Bright Data MCP & Google Gemini

Notice Community nodes can only be installed on self-hosted instances of n8n. Who this is for? The Search Engine Intelligence Extractor is a powerful n8n automation that leverages Bright Data’s MCP based AI Agents to simulate human-like searches across Google, Bing, and Yandex, and then distills clean, structured insights using Google Gemini. This workflow is tailored for: - SEO analysts researching competitors or market trends - Market researchers needing real-time search visibility - Journalis

Free

Ai-powered social media content generator & publisher

AI-Powered Social Media Content Generator & Publisher 🚀 This AI-driven n8n workflow automates social media content creation and publishing across LinkedIn, Instagram, Facebook, and Twitter (X). It generates engaging, platform-optimized posts using Google Gemini AI, based on user inputs such as a post title, keywords, and an uploaded image. The workflow ensures seamless content generation and publishing, making it a perfect tool for marketers, business owners, i

Free

Scrape & analyse Meta Ad Library image ads with Apify and OpenAI

Meta Image Ads Analyzer This n8n template builds an automated system to scrape, analyze, and extract insights from Meta advertising content. The workflow uses AI to perform deep analysis of image ads and organize the results in a structured format. How it works The workflow connects to Facebook's Ad Library to scrape image ads based on a specified page ID. Images are filtered by reach and days running, then processed through OpenAI's GPT-4o to analyze their content. Each image ad is systemati

Free

Extract & analyze brand content with Bright Data and Google Gemini

Who this is for? The Brand Content Extract, Summarization & Sentiment Analysis workflow is designed for professionals and teams who need to monitor, understand, and act on public brand perception at scale. It is ideal for: 1. Brand Managers - Looking to track how their brand is portrayed online. 2. Marketing Analysts - Seeking insights from competitor and industry content. 3. PR & Communications Teams - Evaluating media tone and potential reputation risks. 4. Data Scientists & AI Developers - A

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free