AutomationMart
Home/Browse/Scalable multi-agent chat using @mentions
n8n

Scalable multi-agent chat using @mentions

n8nn8n13 modulesv1.0
OpenAI

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 scalable by editing simple JSON settings. Overview 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 int

At a glance

Scalable multi-agent chat using @mentions is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects OpenAI. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
OpenAI
Modules
13
Price
Free
Version
v1.0
Scalable multi-agent chat using @mentions workflow diagram

About this workflow

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 scalable by editing simple JSON settings. Overview 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: Define multiple unique AI agents. Configure each agent with its own name, system instructions, and LLM model (via OpenRouter). Interact with specific agents using @AgentName mentions. Have all agents respond (in random order) if no specific agents are mentioned. Maintain conversation history across multiple turns. It's designed for flexibility and scalability, allowing you to easily add or modify agents without complex workflow restructuring. Key Features Multi-Agent Interaction: Chat with several distinct AI personalities at once. Individual Agent Configuration: Customize name, system prompt, and LLM for each agent. OpenRouter Integration: Access a wide variety of LLMs compatible with OpenRouter. Mention-Based Triggering: Direct messages to specific agents using @AgentName. All-Agent Fallback: Engages all defined agents randomly if no mentions are used. Scalable Setup: Agent configuration is centralized in a single Code node (as JSON). Conversation Memory: Remembers previous interactions within the session. How to Set Up 1. Configure Settings (Code Nodes): Open the 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. Open the 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. 2. Add OpenRouter Credentials: Locate the AI Agent node. Click the OpenRouter Chat Model node connected below it via the Language Model input. In the 'Credential for OpenRouter API' field, select or create your OpenRouter API credentials. How to Use 1. Start a conversation using the Chat Trigger input. 2. To address specific agents, include @AgentName in your message. Agents will respond sequentially in the order they are mentioned. Example: "@Gemma @Claude, please continue the count: 1" will trigger Gemma first, followed by Claude. 3. If your message contains no @mentions, all agents defined in Define Agent Settings will respond in a randomized order. Example: "What are your thoughts on the future of AI?" will trigger Chad, Claude, and Gemma (based on your default settings) in a random sequence. 4. The workflow will collect responses from all triggered agents and return them as a single, formatted message. How It Works (Technical Details) 1. Settings Nodes: Define Global Settings and Define Agent Settings load your configurations. 2. Mention Extraction: The 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. 3. Agent Selection: If mentions are found, it creates a list of the corresponding agent configurations in the order they were mentioned. If no mentions are found, it creates a list of all defined agent configurations and shuffles them randomly. 4. Looping: The Loop Over Items node iterates through the selected agent list. 5. Dynamic Agent Execution: Inside the loop: An 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. The 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. }}). The Simple Memory node provides conversation history to the AI Agent. The agent's response is formatted (e.g., AgentName:\n\nResponse) in the Set lastAssistantMessage node. 6. Response Aggregation: After the loop finishes, the 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. Benefits Scalability & Flexibility: Instead of complex branching logic, adding, removing, or modifying agents only requires editing simple JSON in the Define Agent Settings node, making setup and maintenance significantly easier, especially for those managing multiple assistants. Model Choice: Use the best model for each agent's specific task or persona via OpenRouter. Centralized Configuration: Keeps agent setup tidy and manageable. Limitations Sequential Responses: Agents respond one after another based on mention order (or randomly), not in parallel. No Direct Agent-to-Agent Interaction (within a turn): Agents cannot directly call or reply to each other during the processing of a single user message. Agent B sees Agent A's response only because the workflow passes it as input in the next loop iteration. Delayed Output: The user receives the combined response only after all triggered agents have completed their generation.

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Generate article-based posts for LinkedIn, Twitter (X), and Reddit with OpenAI

Overview AI-powered workflow that transforms any article URL into platform-optimized social media posts for LinkedIn, Twitter (X), and Reddit. Uses Mozilla Readability for content extraction, multi-agent AI with RAG from viral LinkedIn post database, and interactive review forms for content refinement before auto-publishing. Key Capabilities: - Extracts article content: title, author, text, images, metadata - Generates LinkedIn posts using 3-agent system with viral pattern matching - Creates Twi

Free

Automated resume review system using OpenAI + Google Sheets

Who is this for? This workflow is ideal for: - HR teams and recruiters seeking to streamline resume screening. - Hiring managers who want quick, summarized candidate insights. - Recruitment agencies handling large volumes of applicant data. - Startups and small businesses looking to automate hiring without complex systems. - AI and automation professionals who want to build smart HR workflows using n8n and OpenAI. What problem is this workflow solving? / Use Case - Manually reviewing resumes is

Free

Filter and add new rows in Google Sheets using ChatGPT completions

Periodically filter Google Sheets rows, generate ChatGPT completions, and add new rows in the same or different sheet. Streamline data processing and enhance spreadsheet functionality.

Free

Document-based chatbot with memory using OpenAI, Pinecone and Google Drive

Who is This For? This is for normal people or people just starting off and wanting to have a AI chatbot that can process data to use when talking to the user. How to Use You will need to have your own OpenRouter (Free) and OpenAI APIs as well as Google Drive, Pinecone, and Airtable. What Do You Want? If you want to have your AI Agent remember the user's preferences even after the session is over then you can keep the Airtable node in, if not you can delete it.

Free

Generate high-converting descriptions for Shopify products using OpenAI

Boost your Shopify store's sales with AI-powered high-converting product descriptions, crafted to attract more customers and improve online visibility, while saving time.

Free

Automate restaurant customer service with WhatsApp and Llama AI chatbot

An intelligent WhatsApp-based chatbot designed for restaurants to automate customer interactions related to table bookings, menu inquiries, opening hours, services, and offers. Built using the n8n automation platform and powered by an AI language model, this solution streamlines communication, boosts efficiency, and improves customer satisfaction. Objectives Automate replies to common customer queries on WhatsApp Handle table booking requests with confirmation Provide menu item detail

Free

Automate Birthday Wishes from Google Contacts with Multi-Platform Messaging

Who Is This For? This workflow is designed for individuals, families, and teams who want to automate birthday greetings for their contacts. It's particularly useful for those who maintain their contacts in Google and want to send personalized birthday wishes through multiple communication platforms without manual intervention. What This Workflow Does This workflow functions as an automated birthday reminder and greeting system that: 1. Checks contacts daily to identify whose

Free

Create a data analyst chatbot for real-time Google Sheets analysis with GPT-5

Who is this for? This workflow is ideal for: Business analysts and data professionals who need to quickly analyze spreadsheet data through natural conversation Small to medium businesses seeking AI-powered insights from their Google Sheets without complex dashboard setups Sales teams and marketing professionals who want instant access to customer, product, and order analytics --- What problem is this workflow solving? Traditional data analysis requires technical skills and time-consuming manu

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free