Multi-Agent Iterative Content Refinement System - n8n Workflow

Build a sophisticated multi-agent feedback loop in n8n using OpenAI. This n8n workflow automatically generates, criticizes, and refines creative content like branding assets using powerful n8n templates.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Marketing teams needing automated high-quality branding assets (names, taglines).
n8n automation specialists looking to implement advanced AI logic using LangChain nodes.
Users seeking robust n8n templates for self-correcting generative AI processes.
Agencies that want to leverage multi-agent systems for creative iteration and improved output quality.

Overview

Generating high-quality creative concepts often requires multiple rounds of review, criticism, and refinement. This sophisticated n8n workflow automates this entire feedback cycle using a series of specialized AI agents: a creator, a critic, a refiner, and an evaluator.

The automation starts with an initial concept generation. The results are then passed into a self-contained loop controlled by an If n8n node. Inside the loop, the Critic Agent identifies weaknesses, the Refiner Agent incorporates that criticism to improve the output, and the Evaluation agent assesses the quality and determines if further iteration is necessary. This powerful n8n template ensures that the final output is highly polished, eliminating manual intervention and maximizing the efficiency of your generative AI tasks. This process showcases the true potential of the n8n node ecosystem for advanced AI orchestration.

How it Works

This complex n8n workflow is initiated by the When clicking ‘Execute workflow’ n8n trigger.


  1. Initial Generation: The first AI Agent (Branding Agent) receives the product description input and generates 3 initial name and tagline ideas.

  2. State Initialization: The ideas are passed to the Loop Over Items n8n node, and the subsequent Edit Fields n8n node initializes the state, setting variables like ideas, turn (set to 1), and done (set to "No").

  3. Loop Control: The If n8n node acts as the gatekeeper, checking if the iteration limit (turn = 5) has been reached or if the Evaluation agent previously set the done status to "Yes".

  4. Criticism & Refinement: If the loop continues, the Critic Agent analyzes the current ideas, providing flaws and suggestions. The Refiner Agent then uses this feedback, along with the original ideas, to create 3 improved concepts.

  5. Evaluation: The Evaluation agent ranks the refined output and uses the Structured Output Parser n8n node to return a structured JSON object containing the new ideas and the determined done status.

  6. Loop Iteration: The Code n8n node increments the turn counter, preparing the state for the next cycle. Edit Fields1 maps the data back into the required structure, feeding it into the Loop Over Items n8n node to begin the next iteration of the n8n workflow.

  7. Exit: The loop continues until the condition in the If n8n node is met, at which point the final, high-quality concepts are ready for downstream use.

Installation Guide

To deploy this powerful multi-agent n8n workflow, follow these steps:


  1. Import the n8n Workflow Template: Copy the provided JSON and import it into your n8n instance via the workflow creation menu.

  2. Configure OpenAI Credentials: You must establish a credential for your OpenAI API account. Ensure this credential is correctly linked to all four LangChain Agent n8n node instances (AI Agent, Critic Agent, Refiner Agent, Evaluation agent).

  3. Set Initial Input: The starting AI Agent is configured to read productDescription from the incoming data: =Product: {{$json["productDescription"]}}. You must either modify the manual n8n trigger to inject this data or update this expression to pull content from a different n8n node source.

  4. Verify Loop Settings: If required, you can adjust the hardcoded iteration limit (currently turn equals 5) within the If n8n node to control how long the refinement loop runs.

Node Details

This n8n workflow utilizes core LangChain integration nodes for its logic:

When clicking ‘Execute workflow’ (n8n trigger): The manual starting point for the automation.
AI Agent (Branding Agent): Initial concept generator. Function: Creates the first set of 3 branding ideas, providing the initial data structure for the loop.
Loop Over Items (n8n node): Controls the continuous flow of data items through the iterative refinement process.
Edit Fields / Edit Fields1 (n8n node): Crucial for state management within the loop. Function: Initializes the turn, ideas, and done variables, and ensures the data is correctly structured for loop feedback.
If (n8n node): Flow control node. Function: Determines if the loop should continue (based on turn < 5 AND done == "No").
Critic Agent (n8n node): Provides constructive feedback on the generated content, driving the quality improvement.
Refiner Agent (n8n node): Takes the criticism and generates a new, improved set of ideas, serving as the content refinement engine in this n8n workflow.
Evaluation agent (n8n node): Assesses the quality of the refined output and determines if the goals have been met, controlling the done status.
Structured Output Parser (n8n node): Attached to the Evaluation agent, this guarantees the output is a perfectly valid JSON object required for the next n8n node in the flow, maintaining data integrity during iteration.
Code (n8n node): Simple scripting to increment the turn counter for loop tracking.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by
Sebastian/OptiLever
Sebastian/OptiLever

Featured*