Overview
This pipeline automates the full lifecycle of SEO content production for e-commerce categories. It's a multi-agent system where separate n8n sub-workflows act as specialised agents — one generates, one critiques, one refines — orchestrated by a master workflow.
How It Works
Agent 1 — Generator Given a product category name and a short brief, the generator agent calls Claude via a custom API integration to produce a structured category description: headline, body copy, and keyword-rich meta description.
Agent 2 — Reviewer The reviewer agent receives the draft and evaluates it against a rubric: keyword density, tone consistency, character limits, and factual accuracy flags. It returns a structured JSON critique rather than free text, so the next agent can act on it programmatically.
Agent 3 — Refiner The refiner ingests the original draft plus the structured critique and produces a revised version. If the reviewer score is above a threshold, the content is accepted and passed downstream. If not, the loop repeats up to a configurable number of iterations.
Output Delivery Accepted content is pushed directly to the client's CMS via REST API, tagged with generation metadata (model, timestamp, iteration count) for auditability.
Architecture Highlights
- Claude API with custom system prompts tuned separately for each agent role — same model, very different behaviour
- Structured output enforcement via prompt constraints + JSON schema validation in n8n
- Configurable retry loop — max iterations controlled by a workflow variable, not hardcoded
- Webhook trigger so the client's product team can fire a generation job from their own tools
Outcome
The client went from manually writing 30–45 minutes per category description to running the full generate-review-refine cycle in under 90 seconds per category across their entire catalogue.