Configurable LLM Chat via OpenRouter
detail.loadingPreview
A workflow that uses any LLM model available through OpenRouter for conversational AI.
About This Workflow
This workflow allows you to leverage a wide range of Large Language Models (LLMs) by integrating with OpenRouter. It's designed to be highly configurable, enabling you to select specific models and manage chat sessions effectively. The workflow uses Langchain nodes within n8n to facilitate this.
Key Features
- Model Flexibility: Choose from a vast array of LLM models supported by OpenRouter.
- Session Management: Maintains chat history using
memoryBufferWindowfor context-aware conversations. - OpenRouter Integration: Utilizes OpenRouter credentials for seamless access to various LLM providers.
- Configurable Settings: Easily define the LLM model and prompt input.
- Triggered by Chat Messages: Initiates the LLM interaction upon receiving a chat message.
How To Use
- Trigger: The workflow starts when a chat message is received via the
When chat message receivednode. - Settings: The
Settingsnode defines the LLM model to be used (defaulting todeepseek/deepseek-r1-distill-llama-8b) and captures the incoming prompt ($json.chatInput) and session ID ($json.sessionId). - LLM Model: The
LLM Modelnode (@n8n/n8n-nodes-langchain.lmChatOpenAi) is configured to use the specified model fromOpenRoutercredentials. - Chat Memory: The
Chat Memorynode (@n8n/n8n-nodes-langchain.memoryBufferWindow) stores and retrieves chat history based on thesessionId. - AI Agent: The
AI Agentnode (@n8n/n8n-nodes-langchain.agent) orchestrates the LLM interaction, using the prompt, the selected LLM model, and the chat memory to generate a response. - Sticky Notes: Several
Sticky Notenodes provide guidance on configuration, model examples, and general workflow explanation.
Apps Used
Workflow JSON
{
"id": "7abc6b28-24d1-4368-8917-da50d89864c9",
"name": "Configurable LLM Chat via OpenRouter",
"nodes": 27,
"category": "AI",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 7abc6b28-24d1...
About the Author
SaaS_Connector
Integration Guru
Connecting CRM, Notion, and Slack to automate your life.
Statistics
Related Workflows
Discover more workflows you might like
Build an AI Documentation Expert Chatbot with Gemini RAG
This n8n workflow automates the creation of an AI-powered expert chatbot capable of answering questions based on your documentation. It intelligently ingests, cleans, and processes your knowledge base, preparing it for a Retrieval Augmented Generation (RAG) pipeline with Google Gemini.
Generate Multilingual Image Captions and Overlay
This workflow generates captions for images using Google Gemini and overlays them onto the image, with support for multilingual output.
LangChain Workflow Retriever Example
Demonstrates using LangChain's Retriever QA Chain to query data retrieved from another workflow.