Quick Overview
This subworkflow is called by a parent n8n pipeline to review a content draft against a provided brief using an OpenRouter chat model, returning structured scores, issues, and revision notes the parent can use to decide whether to iterate or accept the draft.
How it works
- Receives the full pipeline state from a parent workflow execution, including the brief and current draft text.
- Sends the brief and draft to a LangChain Agent configured as an editorial “LLM-as-a-Judge” using an OpenRouter chat model.
- Produces a JSON review containing 1–10 scores for accuracy, tone, completeness, and clarity, plus an averaged overall score, issues list, and actionable revision notes.
- Parses the model output, falls back to a zero-score error review if parsing fails, and merges the review back into the original input object.
- Returns the enriched payload (original fields plus a review object) to the parent workflow for threshold-based decision-making.
Setup
- Add an OpenRouter API credential and select the model you want to use in the OpenRouter chat model node.
- Ensure the parent workflow passes the expected fields (at minimum brief and currentDraft) when calling this subworkflow.
- Save this workflow and reference it from the parent pipeline’s Execute Workflow step so it can be invoked after each writer iteration.