π¬ Score and critique content drafts with OpenRouter and LangChain
β‘ 39 views Β· π¬ Content Creation & Video
Description
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.
π Nodes Used
Execute Workflow Trigger, AI Agent, OpenRouter Chat Model
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File