Use this advanced n8n workflow to simulate debates between multiple AI agents using the Mistral Cloud node, refining and optimizing input text across multiple rounds. Ideal for content iteration and complex scenario testing.
Download this n8n workflow template and start using it instantly.
• Content Strategists needing high-quality, iterated output.
• Technical writers or marketers requiring automated text refinement.
• Users interested in complex AI-Agent behavior modeling within an n8n workflow environment.
• Developers looking for advanced examples of LangChain Agent and LLM integration using n8n templates.
Generating truly refined and balanced content often requires multiple perspectives and iterative feedback. This specialized n8n workflow solves the problem of static AI output by creating an 'AI Arena' where multiple agents, each assigned a specific persona, role, and set of biases, debate and refine an input text over a defined number of rounds.
By leveraging the Mistral Cloud model within an n8n template structure, the workflow allows users to simulate complex scenarios—such as meeting simulations or content critiques—leading to a final, optimized result that incorporates diverse viewpoints. The architecture uses several core n8n node types, focusing heavily on flow control and structured LLM communication to guarantee consistent, high-quality iterations.
This powerful n8n workflow begins with a Schedule or Manual Trigger.
Configure Workflow Args node defines the debate parameters (initial input, scenario context, number of rounds, agent profiles, and environment rules). The Prepare Input node initializes state variables like the current round number.Round Loop and Guarantee Input n8n node. The Split Out AI Agents node separates the configuration for each AI persona. For every agent, the Debate Actor Abstraction node executes, utilizing the Mistral Cloud Chat Model and a heavily customized system prompt (defining their role, nature, and goals) to generate a response in structured JSON format. This response is validated by a JSON Output Parser n8n node.Aggregate node collects all individual agent actions. The Debate Environment node, acting as the moderator, uses the second Mistral Cloud Chat Model to analyze all agent replies against the environment's goals. It outputs the roundsummary, roundresult, and the critical rewritteninput—the consensus text for the next round.If No More Rounds n8n node checks if the round limit has been reached. If not, the Update Input node increments the round counter and updates the main input text with the rewritteninput from the environment, sending the flow back to the start of the round execution for further optimization. If the debate is over, the workflow proceeds to End of Debate, providing the final optimized text.To deploy this comprehensive n8n workflow template, follow these steps:
n8n-nodes-globals node for configuration. Ensure this module is installed in your n8n environment.Mistral Cloud Chat Model n8n node (both primary and secondary instances) using your Mistral API key.Configure Workflow Args node if necessary, although the node primarily uses its parameters for defining variables.Configure Workflow Args n8n node. Update the JSON variables (input, scenario, rounds, ai_agents) to define your specific debate parameters and agent personas.When clicking ‘Execute workflow’ n8n trigger to run the simulation manually, or configure the Schedule trigger for automated runs. Schedule / Manual Trigger: The starting n8n trigger points. They initiate the execution of the entire optimization process.
Configure Workflow Args (Global Constants): Stores critical input parameters, including agent profiles and debate settings, making this n8n template highly customizable. Key configurations include input, rounds, and the complex JSON arrays for aiagents and aienvironment.
Prepare Input / Guarantee Input (Set): These Set n8n node instances initialize and maintain the state of the debate, ensuring data consistency across loop iterations.
Split Out AI Agents (Split Out): Takes the array of agent definitions and splits them into individual items, allowing each agent to act independently during the debate phase.
Debate Actor Abstraction (LangChain Agent): The central cognitive n8n node for each agent. It is configured with highly specific system messages to enforce the agent's pre-defined role, will, and writingstyle using the Mistral LLM.
Mistral Cloud Chat Model / Mistral Cloud Chat Model 2 (Language Model): The underlying LLM powering the agents and the environment. Uses mistral-small-latest for debate execution.
JSON Output Parser / JSON Output Parser 2 (Output Parser): Essential n8n node used to enforce strict schema validation on LLM outputs, guaranteeing that replies and environment results are returned in a predictable JSON format required for flow control.
Aggregate: Collects the individual parsed replies from all agents before sending them to the environment for evaluation.
Debate Environment (LangChain Agent): Acts as the moderator, receiving all agent inputs and generating the final optimized or rewritteninput text for the next round based on the collective debate results.
Debate Loop / Round Loop (Split In Batches): These n8n node instances manage the iterative process, controlling the number of rounds and ensuring all agents participate in each turn before the results are calculated.
rounds has been completed, signaling the end of the optimization process.Automate medical report interpretation using a powerful n8n workflow connected to local Ollama AI. This n8n node setup extracts PDFs, simplifies medical jargon, and securely emails results.

Automate Stripe payment link creation instantly using an n8n workflow. Input product details via a simple form and generate a redirect link for instant payments. Explore this n8n template now.

Use this essential n8n workflow template to manage execution errors. It uses the n8n Error Trigger to format detailed alerts and send instant notifications via Gmail and Slack.

Deploy security awareness simulations using this n8n workflow. Pull targets from Google Sheets, simulate credential traps, and log results automatically for SOC testing.

Use this powerful n8n workflow to automatically discover, extract, clean, and save all accessible website page URLs from sitemaps directly into Google Sheets, streamlining SEO audits.

Company dedicated to delivering tailored software solutions and data-driven experiences through effective technology. We develop workflows leveraging AI agents to maximize the productive benefits of artificial intelligence.







































