n8n

How to Orchestrate OpenRouter Agent Collaboration?

Run one chat and hear from several AI specialists in a single, organized reply. Mention the agents you want or reach all of them at once. Great for marketing teams that need fast ideas, messaging checks, and clear next steps without long back and forth.

A chat event starts the flow. Global and agent settings define your profile, shared rules, agent names, and model choices. The system reads @mentions from your message, then loops through each agent in order. For every loop, the model and system message load dynamically, so you do not need separate nodes for each agent. A memory buffer keeps the conversation alive across turns. After all agents respond, their answers are combined and labeled.

Setup is simple. Add your OpenRouter credential and adjust the JSON settings for your agents and tone. Expect faster brainstorming, consistent voice, and a single response that is easy to share. Use it for content outlines, campaign ideas, and product messaging support.

What are the key features?

  • Chat trigger starts on each new message and passes it into the flow
  • Settings nodes define user details, shared guidance, agent names, and models
  • Code step extracts @mentions and decides which agents should respond
  • Loop runs agents one by one so each reply is processed cleanly
  • Dynamic system messages and model selection per agent through OpenRouter
  • Memory buffer keeps recent conversation history tied to the session
  • Conditional logic sets the correct input on the first and later loops
  • Final code merges and formats all agent responses with clear labels

What are the benefits?

  • Reduce manual routing of questions from minutes to seconds with @mentions
  • Streamline marketing brainstorming by gathering multiple expert views in one reply
  • Keep message context across rounds for more accurate follow ups
  • Scale to many agents without building extra nodes or complex paths
  • Improve clarity with labeled, combined answers that are easy to review

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. In your OpenRouter account, create an API key on the API settings page and copy it.
  4. In n8n, open the OpenRouter Chat Model node. In the Credential to connect with field, click Create new credential and enter your OpenRouter API key. Save the credential.
  5. Open the Define Global Settings code node. Edit the JSON to set your name, company details, and any shared rules you want all agents to follow. Save your changes.
  6. Open the Define Agent Settings code node. Add or edit agent objects with a name, model ID from OpenRouter, and agent specific system message. Save your changes.
  7. Open the AI Agent node and confirm the system message field uses variables from the settings nodes. No manual text is needed if the variables are in place.
  8. Save and activate the workflow. Open the n8n chat interface linked to the chat trigger and send a message with @AgentName to target a specific agent.
  9. Test another message without any mentions. All configured agents should reply in random order and the final output should show labeled responses.
  10. If you see no replies, check the Extract mentions and Loop Over Items nodes for errors. Confirm your OpenRouter credential works and the model names are valid.
  11. If the conversation does not remember previous turns, confirm the Simple Memory node uses the same session key from the chat trigger.

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.