Block 1 - When chat message received
- Type / Role
- @n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
- Config choices
- Version 1.1
This workflow is provided as-is. Please review and test before using in production.
Summary Engage multiple, uniquely configured AI agents (using different models via OpenRouter) in a single conversation. Trigger specific agents with @mentions or let them all respond. Easily scala...
@n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.splitinbatches, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.memorybufferwindow, n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.stickynote
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jon Doran.
Original n8n.io sourceEngage multiple, uniquely configured AI agents (using different models via OpenRouter) in a single conversation. Trigger specific agents with @mentions or let them all respond. Easily scalable by editing simple JSON settings.
This workflow is for users who want to experiment with or utilize multiple AI agents with distinct personalities, instructions, and underlying models within a single chat interface, without complex setup. It solves the problem of managing and interacting with diverse AI assistants simultaneously for tasks like brainstorming, comparative analysis, or role-playing scenarios.
It enables dynamic conversations with multiple AI assistants simultaneously within a single chat interface. You can:
@AgentName mentions.It's designed for flexibility and scalability, allowing you to easily add or modify agents without complex workflow restructuring.
@AgentName.Define Global Settings Code node: Edit the JSON to set user details (name, location, notes) and add any system message instructions that all agents should follow.Define Agent Settings Code node: Edit the JSON to define your agents. Add or remove agent objects as needed. For each agent, specify:"name": The unique name for the agent (used for @mentions)."model": The OpenRouter model identifier (e.g., "openai/gpt-4o", "anthropic/claude-3.7-sonnet")."systemMessage": Specific instructions or persona for this agent.AI Agent node.OpenRouter Chat Model node connected below it via the Language Model input.@AgentName in your message. Agents will respond sequentially in the order they are mentioned."@Gemma @Claude, please continue the count: 1" will trigger Gemma first, followed by Claude.@mentions, all agents defined in Define Agent Settings will respond in a randomized order."What are your thoughts on the future of AI?" will trigger Chad, Claude, and Gemma (based on your default settings) in a random sequence.Define Global Settings and Define Agent Settings load your configurations.Extract mentions Code node parses the user's input (chatInput) from the When chat message received trigger. It looks for @AgentName patterns matching the names defined in Define Agent Settings.Loop Over Items node iterates through the selected agent list.If node (First loop?) checks if it's the first agent responding. If yes (true path -> Set user message as input), it passes the original user message to the Agent. If no (false path -> Set last Assistant message as input), it passes the previous agent's formatted output (lastAssistantMessage) to the next agent, creating a sequential chain.AI Agent node receives the input message. Its System Message and the Model in the connected OpenRouter Chat Model node are dynamically populated using expressions referencing the current agent's data from the loop ({{ $('Loop Over Items').item.json.* }}).Simple Memory node provides conversation history to the AI Agent.**AgentName**:\n\nResponse) in the Set lastAssistantMessage node.Combine and format responses Code node gathers all the lastAssistantMessage outputs and joins them into a single text block, separated by horizontal rules (---), ready to be sent back to the user.Define Agent Settings node, making setup and maintenance significantly easier, especially for those managing multiple assistants.This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
| Workflow | Scalable multi-agent chat using @mentions |
|---|---|
| Complexity | advanced |
| Nodes | 18 |
| Categories | Engineering, AI Chatbot |
| Author | Jon Doran |
| Published | 08 Apr 2025 |
Use the JSON export at /data/workflows/3473/3473.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
Summary Engage multiple, uniquely configured AI agents (using different models via OpenRouter) in a single conversation. Trigger specific agents with @mentions or let them all respond. Easily scala...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, AI Chatbot use case.