Who is this workflow for? This workflow enables users of n8n versions earlier than 1.78 to utilize the OpenRouter service. By configuring the OpenAI node with a custom BaseURL, you can access various Language Learning Models (LLMs) and dynamically switch models within your automated workflows..

What does this workflow do?

  • Import the Workflow: Start by importing the provided workflow template into your n8n instance.
  • Register with OpenRouter: Ensure you have an account with OpenRouter.ai, purchase the necessary credits, and generate an API key.
  • Configure Credentials:
  • Navigate to the Credentials section in n8n.
  • Create a new credential using the OpenAI type.
  • Set the “Base URL” to https://openrouter.ai/api/v1 to route requests through OpenRouter.
  • Enter your OpenRouter API key.
  • Set Up the Workflow Nodes:
  • Webhook Node: Triggers the workflow upon receiving a specified HTTP request.
  • HTTP Request Node: Sends requests to OpenRouter using the configured credentials.
  • Respond to Webhook Node: Sends the response back to the requester.
  • Optional Nodes: Incorporate additional nodes like DebugHelper, Customer Datastore, or GitHub for extended functionality.
  • Configure Dynamic Model Selection:
  • In the Settings node, specify the model ID from the OpenRouter models list.
  • To enable dynamic selection, set the model property to be determined by external inputs, such as configuration files or specific messages.

🤖 Why Use This Automation Workflow?

  • Access Multiple LLMs: Leverage a wide range of models and providers offered by OpenRouter.
  • Dynamic Model Switching: Change models on the fly based on external configurations or specific triggers.
  • Extended Compatibility: Utilize OpenRouter without needing to upgrade to n8n version 1.78 or later.

👨‍💻 Who is This Workflow For?

This workflow is ideal for developers and automation enthusiasts who:

  • Use n8n versions prior to 1.78.
  • Require flexibility in choosing and switching between different LLMs.
  • Want to integrate OpenRouter’s diverse model offerings into their existing workflows without upgrading n8n.

🎯 Use Cases

  1. Customer Support Automation: Dynamically select different conversational models based on the complexity of customer queries.
  2. Content Generation: Switch between models optimized for various content types, such as technical writing or creative storytelling.
  3. Data Analysis: Use different models for processing and interpreting diverse datasets within the same workflow.

TL;DR

This workflow provides a seamless method to integrate OpenRouter with n8n versions below 1.78. By configuring the OpenAI node with a custom BaseURL, users can access a variety of LLMs and dynamically switch models within their automated processes, enhancing flexibility and functionality without the need to upgrade n8n.

Help us find the best n8n templates

About

A curated directory of the best n8n templates for workflow automations.