Multi-LLM Customer Support Chatbot for Webhook Integration - n8n Workflow

Deploy a dynamic multi-LLM customer support chatbot using this versatile n8n workflow. Integrate with WordPress or any live chat via webhook to automate service and lead generation. Find powerful n8n templates here.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Digital Agencies and Developers: Who need a flexible, self-hosted solution for integrating AI customer support into client websites (e.g., WordPress).
Customer Service Teams: Looking to automate initial query handling and lead qualification using advanced LLMs within an n8n workflow.
n8n Automation Specialists: Seeking advanced n8n templates demonstrating the integration of Langchain agents, memory, and complex conditional routing.
Businesses using WordPress Live Chat: Specifically targeting integrations where the chat platform can send and receive data via a standard webhook.

Overview

This powerful n8n workflow provides the backend intelligence for a customer support and lead generation chatbot. Designed for integration with platforms like WordPress live chat via a simple webhook, it leverages multiple Large Language Models (LLMs) and Langchain features, all orchestrated within n8n. The value lies in creating a highly customized, context-aware AI agent that maintains conversation history (stateful chat) and adheres to strict business rules defined in the system prompt of the n8n node. Unlike simple Q&A bots, this architecture supports complex interactions, lead capture, and controlled conversation ending, making this one of the most versatile n8n templates available for production environments. Setting up this n8n workflow reduces manual support load and provides 24/7 client interaction.

How it Works

The process begins with the Website Chat Messages n8n trigger, a Webhook node configured to listen for incoming POST requests from the live chat platform. The user's input is immediately extracted and standardized by the Convert Chat Text n8n node.


  1. Context Maintenance: The standardized input is passed to the Forerunner™ AI Agent. Before processing, the Agent accesses the Simple Memory n8n node, which uses the request's IP address (x-real-ip) as a session key to retrieve the previous 20 conversation turns, ensuring the chat remains contextual.

  2. AI Processing: The Forerunner™ AI Agent processes the input, adhering to a very detailed system message defining its persona, allowed topics, compliance rules, and lead capture methodology. Although multiple LLMs (OpenAI, Anthropic, Gemini) are available, the Agent uses the connected LLM (e.g., OpenRouter) to formulate its response. It also has access to a Think n8n node for general context (like the current time).

  3. Conditional Logic: Once the AI generates an output, the workflow routes it to the End Conversation? If n8n node. This crucial n8n node checks if the output contains the specific flag [ENDOFCONVERSATION], which the Agent is instructed to add when the conversation concludes.

  4. Response Handling: If the flag is present (Yes - End), the [ENDOFCONVERSATION] text is removed, and a flag indicating the chat end is set. If the flag is absent (No - Continue), the conversation data is passed through unchanged.

  5. Final Action: The final, cleaned, and processed reply is sent back to the client using the Send Chat to Client n8n node (Respond to Webhook), completing the highly automated conversational loop of this n8n workflow.

Installation Guide

To deploy this expert n8n workflow using one of our robust n8n templates, follow these steps:


  1. Import the JSON: Copy the provided n8n workflow JSON and paste it into your n8n instance using the 'New' menu -> 'Import from JSON'.

  2. Set Webhook Trigger: Navigate to the Website Chat Messages n8n trigger node. Note the unique URL generated for the webhook. You must configure your live chat software (e.g., WordPress plugin) to send user chat messages via a POST request to this n8n webhook URL, ensuring the user message is present in the body under the key chatinput.

  3. Configure AI Credentials: This n8n workflow utilizes Langchain nodes. You must establish credentials for your preferred LLM (e.g., OpenAI, Anthropic, OpenRouter) and connect them to the relevant Language Model n8n node. Ensure the desired LLM n8n node is connected to the Forerunner™ AI Agent.

  4. Customize AI Agent: Review the extensive system prompt within the Forerunner™ AI Agent n8n node. Update , services, contact details, and brand voice to match your business requirements.

  5. Activate: Save and activate the n8n workflow. Test the connection by sending a message through your integrated live chat interface.

Node Details

This n8n workflow relies on specialized Langchain components for its complexity:

Website Chat Messages (Webhook n8n trigger): The entry point for the automation. It is configured for POST requests to the /demo-workflow path and uses the 'Respond to Webhook' mode to ensure synchronous replies to the chat platform.
Convert Chat Text (Set n8n node): Essential for data normalization. It extracts chatinput from the raw webhook body, making the data accessible to downstream n8n nodes.
OpenAI Chat Model / Anthropic Chat Model / Google Gemini Chat Model (Langchain LLM n8n node): Multiple large language model n8n nodes are included for flexibility, allowing the user to switch between GPT-4, Claude, or Gemini based on preference. In the current configuration, one of these must be connected to the Agent.
Simple Memory (Langchain Memory n8n node): Maintains conversation state. Uses a Buffer Window of 20 messages, identified by the user's IP (x-real-ip) for session tracking.
Forerunner™ AI Agent (Langchain Agent n8n node): The core intelligence. It executes the multi-page system prompt, handles routing, and determines if a tool or the LLM should be used to formulate the reply. This complex n8n node ensures the response adheres to strict business logic.
End Conversation? (If n8n node): The flow control mechanism. It checks if the AI output contains the string [ENDOFCONVERSATION]. This condition dictates whether the chat session is flagged as complete.
Yes - End / No - Continue (Set n8n nodes): Prepare the final response payload, either cleaning the [ENDOFCONVERSATION] tag or just passing the output, ensuring the data is correctly structured before leaving this n8n workflow.
Send Chat to Client (Respond to Webhook n8n node): Sends the final generated reply back to the source system, completing the operation initiated by the n8n trigger.

Related n8n Workflows

Free

Nodes: 13 Nodes
Updated: December 26 2025
View all
Created by

AI & Automation consultant based in the UK, running my own digital marketing agency since 2016.

Featured*