Unlock the Power of Any LLM with OpenRouter Integration
detail.loadingPreview
Seamlessly integrate with any Large Language Model (LLM) through the flexibility of OpenRouter. This n8n workflow empowers you to leverage a vast array of AI models for your chat applications and automated tasks without vendor lock-in.
About This Workflow
This n8n workflow template provides a powerful and flexible way to interact with a multitude of Large Language Models (LLMs) via the OpenRouter API. Instead of being tied to a single provider, you can dynamically select and utilize different AI models, from popular ones like OpenAI and Google Gemini to specialized open-source options. The workflow is triggered by incoming chat messages, processes them through a configurable LLM agent, and maintains chat history for context-aware conversations. This enables sophisticated AI-powered applications, custom chatbots, content generation, and more, all within your n8n automation environment.
Key Features
- Universal LLM Access: Connect to virtually any LLM available through OpenRouter, offering unparalleled model choice.
- Dynamic Model Selection: Easily switch between different LLM providers and models by updating a single setting.
- Contextual Chat Memory: Maintains conversation history for more natural and coherent interactions.
- Flexible Prompting: Define prompts dynamically based on incoming chat input.
- Event-Driven Automation: Integrates seamlessly with n8n's event-driven architecture.
How To Use
- Set Up OpenRouter Credentials: In your n8n instance, navigate to Credentials and add your OpenRouter API key.
- Configure the 'Settings' Node: Update the
modelparameter in the 'Settings' node to your desired LLM (e.g.,deepseek/deepseek-r1-distill-llama-8b). Thepromptwill be dynamically set by the incoming chat message, andsessionIdmanages chat history. - Define Your Prompt (Optional but Recommended): The 'Settings' node takes the incoming chat message and assigns it to the
promptvariable. You can further refine this logic if needed. - Connect the 'AI Agent' Node: Ensure the 'AI Agent' node is configured to use the
promptfrom the 'Settings' node and theLLM ModelandChat Memorynodes. - Configure 'LLM Model' Node: Select your OpenRouter credentials. The
modelparameter will be dynamically pulled from the 'Settings' node. - Configure 'Chat Memory' Node: Set the
sessionKeyto={{ $json.sessionId }}to enable session management. - Activate the Workflow: Enable the workflow to start receiving chat messages and processing them with your chosen LLM.
Apps Used
Workflow JSON
{
"id": "7334a063-bbc2-43ab-8629-d3eb19c0e2f6",
"name": "Unlock the Power of Any LLM with OpenRouter Integration",
"nodes": 14,
"category": "Marketing",
"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: 7334a063-bbc2...
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
AI-Powered Instagram Comment Automation
This n8n workflow intelligently automates responses to Instagram comments, leveraging advanced AI to engage with your audience. It filters out irrelevant content and personalizes replies, saving you time while boosting your social media presence.
WhatsApp AI Assistant: LLaMA 4 & Google Search for Real-Time Insights
Instantly deploy a smart AI assistant on WhatsApp, powered by Groq's lightning-fast LLaMA 4 model. This workflow enables real-time conversations, remembers context, and provides up-to-date answers by integrating live Google Search results.
AI-Powered On-Page SEO Audit & Report Automation
Instantly generate comprehensive on-page SEO technical and content audits for any website URL. This AI-powered workflow automates the entire process, from scraping the page to delivering a detailed report directly to your inbox, empowering you to optimize for better search rankings and user engagement.