n8n

How to Launch OpenRouter Customer Support Chat?

Give your site or app a smart chat reply without heavy setup. Incoming messages are answered by an AI model you choose through OpenRouter, and short chat history is remembered per user. It fits customer support, pre sales questions, and internal help.

A chat event starts the flow the moment a message arrives. A Settings step stores a default model id, and you can pass a model value to override it at runtime. The LLM Model node connects to OpenRouter with your API key, while Chat Memory keeps a small window of context using a sessionId so the bot remembers the last turns. The AI Agent sends the prompt text to the selected model and returns a clear reply. You can swap models quickly to compare quality, tone, and cost without changing the flow.

You will need an OpenRouter account and API key, then add the credential in n8n and set your default model string. Expect faster first responses and the ability to handle more chats without adding staff. Use it for website FAQs, campaign hotlines, or an internal concierge that answers routine questions.

What are the key features?

  • Chat event trigger listens for new messages and starts the flow instantly.
  • Settings step defines a default model id and lets you override it per message.
  • LLM Model uses an OpenRouter credential to call the selected model.
  • Chat Memory keeps a short window of recent messages using a sessionId.
  • AI Agent sends the prompt text and returns the structured reply.
  • Model choice is fully configurable, so you can test multiple providers.
  • Credentials are stored in n8n to keep API keys safe and separate.

What are the benefits?

  • Cut first reply time from minutes to seconds
  • Handle more simultaneous chats without extra staff
  • Switch models in minutes to balance quality and cost
  • Keep context across a session to avoid repeated questions
  • Connect many model vendors through one OpenRouter setup

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with OpenRouter. See the Tools Required section above for links to create accounts with these services.
  3. Create your OpenRouter API key in your OpenRouter dashboard on the API page.
  4. In n8n, open the LLM Model node, then in the Credential to connect with field click Create new credential. Choose the OpenAI API style credential type, enter your OpenRouter API key, and follow the on screen steps.
  5. Open the Settings node and set the model field to your default model id. You can use options like openai o3 mini or google gemini as listed in the template notes.
  6. Confirm the Chat Memory node uses a sessionId. Make sure your chat client passes a sessionId for each user.
  7. Enable the workflow. Use the n8n chat interface to send a test message with a prompt and a sessionId. You should get a reply that reflects the last message.
  8. Send a follow up message that refers to your first message. Check that the reply uses recent context, proving memory works.
  9. To change models on the fly, include a model field in the incoming message. If none is provided, the Settings default will be used.
  10. Troubleshoot common issues: If you see unauthorized or 401, check the API key. If replies are empty, verify the model id exists in OpenRouter. If context is not remembered, confirm the sessionId is present and consistent.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

OpenRouter

Sign up

Free models: $0 via API, 20 requests/min; 50/day or 1000/day with ≥10 credits

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.