Get startedGet started for free

CRO agent chain with feedback loop

1. CRO agent chain with feedback loop

Welcome back!

2. Parallel vs. sequential architectures

In the previous chapter, you built a multi-agent marketing system where specialists worked in parallel. Now we're going to build something different—a workflow that thinks, evaluates, and improves itself. In this workflow, we're switching to sequential chaining. Agents will run one after another, each building on the previous output. And here's the twist: if the final output isn't good enough, the workflow loops back and tries again with feedback.

3. The conversion rate optimization scenario

Here's the scenario. You have a landing page, and you want to improve its conversion rate: getting more visitors to sign up, buy, or request a demo. Normally, you'd hire a Conversion Rate Optimization specialist to analyze the page and suggest improvements. But what if an AI could do that automatically, and even critique its own suggestions to make them better?

4. The 3-agent chain

The workflow uses three AI agents in sequence. First, the Idea Generator analyzes the landing page and produces 10 optimization ideas. Then, the Parameter Setter defines 5 criteria to evaluate those ideas: things like clarity, feasibility, and impact. Finally, the Judge agent scores the ideas against those criteria and provides a critique. Each agent builds on the previous one's output.

5. The feedback loop

Here's where it gets interesting. After the Judge scores the ideas, the workflow checks: is the average score above 7? If it is, the output is accepted. If not, the system retries, but this time, it feeds the Judge's comments back to the Idea Generator. The generator uses that feedback to improve its suggestions. This loop can run up to 3 times, getting better with each iteration.

6. Patterns you'll learn

By the end of this chapter, you'll know how to build sequential agent chains where each step depends on the last. You'll implement feedback loops using Loop Merge nodes and retry logic. And you'll use quality thresholds to decide when output is good enough. These patterns are powerful for any workflow where you need iterative improvement.

7. What you'll build in the exercises

Let me walk you through what you'll build in the first few exercises. You'll start by creating an intake form using a Form Trigger: this replaces the Manual Trigger plus Set node pattern from Chapter 1. The form collects a landing page URL, a conversion goal, and an audience description. Next, you'll build a content pipeline: an HTTP Request node scrapes the landing page, a Code node cleans the raw HTML, and a Markdown node converts it to readable text. This gives the AI agents clean content to work with. Then you'll set up the loop foundation: a Set node to initialize two variables, retry count and feedback context, and a Merge node that will later receive data from the retry path. This is how n8n handles loops: instead of a traditional while loop, you use a Merge node to combine the starting point with data that loops back. Once that's in place, you'll be ready to build the 3-agent chain and wire up the feedback loop. As always, all the prompts, code, and configurations are in the exercise instructions, ready to copy and paste.

8. Let's practice!

Let's get started!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.