Local LLM Chat Interface using Ollama - n8n Workflow

Run your private AI conversations locally. This n8n workflow connects a chat trigger to your self-hosted Ollama LLMs, providing secure and customizable local automation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

AI Developers and Enthusiasts seeking to test models locally without cloud dependencies.
Users requiring privacy and data control over their LLM interactions.
n8n power users looking for advanced local AI capabilities within their automation setup.
Teams needing robust, self-hosted n8n templates for custom AI development.

Overview

This comprehensive n8n workflow is designed for seamless interaction with local Large Language Models (LLMs) managed via Ollama. Instead of relying on external cloud APIs, this setup keeps your processing entirely private and self-hosted. When an input is received through the specialized n8n chat interface, this n8n workflow instantly routes the prompt to your local Ollama server, retrieves the response, and delivers it back to the user. This is an essential automation piece for anyone leveraging the power of local LLMs and needing a reliable chat interface built directly into their n8n environment. This powerful combination demonstrates the flexibility of the n8n node system for specialized AI tasks.

How it Works

This automation sequence starts with a specialized n8n trigger and moves through a LangChain orchestrated process to communicate with the local model:


  1. Incoming Message Trigger: The workflow activates when the When chat message received n8n trigger captures a new user input from the designated chat interface.

  2. Chain Orchestration: The incoming message is passed to the Chat LLM Chain n8n node. This chain node is responsible for structuring the input and determining how to handle the conversation history (though history management details aren't explicitly defined, the chain structure facilitates it).

  3. Model Connection: The Chat LLM Chain utilizes the Ollama Chat Model n8n node as its designated language model resource. This n8n node is pre-configured to point to the local Ollama API endpoint (typically http://localhost:11434).

  4. Local Processing: Ollama processes the prompt using the selected local LLM.

  5. Response Delivery: The generated AI response is returned by the Ollama Chat Model back to the Chat LLM Chain, which then delivers the final output back to the originating chat interface, completing the loop initiated by the n8n trigger.

Installation Guide

To deploy and utilize this advanced n8n workflow, follow these steps:


  1. Import the Workflow: Copy the provided JSON data and import it directly into your n8n instance via the Workflows section.

  2. Install Ollama: Ensure that Ollama is installed and actively running on your local machine or server hosting the models.

  3. Configure Credentials: Locate the Ollama Chat Model n8n node.

You must create or select an existing 'Ollama API' credential.
The standard endpoint is http://localhost:11434. Adjust this address if your Ollama instance runs on a different port or host.
Crucial Step for Docker Users*: If your n8n instance is running in a Docker container, you must ensure it can access the host network where Ollama resides. This often requires running the n8n container with the --net=host flag to facilitate connection to localhost.

  1. Activate the Workflow: Set the n8n workflow to 'Active' to enable the When chat message received n8n trigger and start interacting with your local LLMs.

  2. Initial Run: Execute a test run to confirm the connection between the n8n node structure and the Ollama server is functional.

Node Details

This n8n workflow utilizes core LangChain nodes specifically tailored for local AI integration:

When chat message received (n8n trigger):
Function: Acts as the starting point, the primary n8n trigger, initiating the automation when a user sends a message to the n8n chat interface.
Key Configuration: Registered with a unique Webhook ID to listen for chat inputs.

Chat LLM Chain (n8n node):
Function: Serves as the primary orchestrator, passing the user's prompt from the trigger to the specified LLM service and managing the response flow.
Key Configuration: Connects the input stream from the trigger to the chosen language model provider.

Ollama Chat Model (n8n node):
Function: This crucial n8n node interfaces directly with the self-hosted Ollama API, allowing the n8n workflow to leverage locally downloaded and managed LLMs.
* Key Configuration: Requires 'Local Ollama' API credentials configured to point to the correct local server address (e.g., http://localhost:11434).

Related n8n Workflows

Free

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

Full-stack developer with 5+ years streamlining healthcare processes. Proficient in NodeJS, VueJS, MongoDB, PostgreSQL, Kubernetes, and n8n. Ready to optimize your workflows – book a consult via my link.

Featured*