Automate LLM Interactions with OpenRouter and n8n
detail.loadingPreview
Seamlessly integrate any LLM model via OpenRouter into your n8n workflows. This template uses the AI Agent node to process chat messages and leverage chat memory for context.
🚀Ready to Deploy This Workflow?
About This Workflow
Overview
This n8n workflow demonstrates how to connect to and utilize a wide array of Large Language Models (LLMs) through OpenRouter. OpenRouter acts as a unified API gateway to numerous LLM providers, allowing you to switch between models effortlessly. The workflow begins with a When chat message received trigger, which passes the input to a Settings node to define the LLM model and prompt. The core logic resides in the AI Agent node, which processes the user's prompt, utilizes Chat Memory for conversational context, and interacts with the chosen LLM via the LLM Model node (configured for OpenRouter). This setup enables powerful, flexible LLM integrations within your automation processes.
Key Features
- Dynamically select and use any LLM available through OpenRouter.
- Leverages n8n's Chat Trigger for real-time message processing.
- Integrates
Chat Memoryto maintain conversational context. - Configurable
Settingsnode for easy model and prompt management.
How To Use
- Set up your OpenRouter API credentials in n8n.
- Configure the
Settingsnode with your desired LLM model name and prompt. - Connect the
When chat message receivedtrigger to initiate the workflow. - Adjust the
Chat Memorysettings if longer conversation history is needed. - Test the workflow by sending chat messages to the trigger endpoint.
Apps Used
Workflow JSON
{
"id": "f8d50b06-3c6b-407e-b35d-499c3dbfbf0a",
"name": "Automate LLM Interactions with OpenRouter and n8n",
"nodes": 0,
"category": "OpenAI and LLMs",
"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: f8d50b06-3c6b...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Verification Info
Related Workflows
Discover more workflows you might like
AI-Powered Automation with OpenAI and LLM Templates
Explore n8n workflows that leverage OpenAI and LLM nodes for advanced automation. Includes examples for email categorization, RAG with PDFs, and AI assistants that use predefined API endpoints.
Chat with Local LLMs using n8n and Ollama
Integrate local Large Language Models into your n8n workflows using Ollama and Langchain nodes. This enables conversational AI powered by your self-hosted models, triggered by chat messages.
ReAct AI Agent with Custom HTTP Request
This n8n workflow demonstrates a ReAct AI Agent that interacts with external web pages using a custom HTTP Request node. It solves the problem of dynamically fetching and processing web content based on AI-driven instructions.