Skip to main content

Generate and refine technical drafts with OpenRouter writer and critic agents

Workflow preview

Workflow preview
100%
Generate and refine technical drafts with OpenRouter writer and critic agents preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow receives a topic and brief via webhook, uses OpenRouter LLMs to draft content and critique it, and iterates through writer/critic revisions until a minimum score is rea...

Best for

  • Content Creation automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenrouter, n8n-nodes-base.if, n8n-nodes-base.respondtowebhook, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Elvis Sarvia.

Original n8n.io source

1.1 Workflow description

Title
Generate and refine technical drafts with OpenRouter writer and critic agents
Workflow name
Generate and refine technical drafts with OpenRouter writer and critic agents

Quick Overview

This workflow receives a topic and brief via webhook, uses OpenRouter LLMs to draft content and critique it, and iterates through writer/critic revisions until a minimum score is reached or the maximum iterations is hit, then returns the final draft and scoring details as JSON.

How it works

  1. Receives a POST webhook request containing a topic, brief, and optional quality thresholds (minScore and maxIterations).
  2. Normalizes the incoming payload, initializes loop state (requestId, iterationCount, thresholds), and prepares the prompt context.
  3. Uses an OpenRouter chat model as a Writer to generate a draft (or revise the previous draft using the critic’s feedback) and extracts the draft text and word count from the model’s JSON output.
  4. Uses an OpenRouter chat model as a Critic to score the draft across accuracy, clarity, relevance, and conciseness and returns a JSON critique with subscores, issues, and revision guidance.
  5. Checks whether the overall score meets the minimum score or the workflow has reached the maximum number of iterations, otherwise stages the critique feedback and repeats the writer/critic loop.
  6. Finalizes a response envelope with the final draft, score breakdown, issues, iteration metadata, and whether it should route downstream or to human review, then responds to the webhook request with this JSON.

Setup

  1. Add an OpenRouter API credential and select the desired chat models for both the Writer and Critic steps.
  2. Activate the workflow and copy the production webhook URL, then configure your calling app to POST JSON with at least topic and brief (optionally minScore and maxIterations).
  3. Decide your quality/cost settings by setting minScore (default 7.5) and maxIterations (default 3) in the webhook payload you send.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Webhook - Brief In

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 2 - Normalize Request

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 3 - Writer Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 4 - OpenRouter - Writer

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 5 - Parse Writer Output

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Critic Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 7 - OpenRouter - Critic

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 8 - Parse Critic Output

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Passed or Max Iterations?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 10 - Finalize Response

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Respond to Client

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

Block 12 - Increment + Stage Feedback

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Generate and refine technical drafts with OpenRouter writer and critic agents
Complexity intermediate
Nodes 13
Categories Content Creation, AI Summarization
Author Elvis Sarvia
Published 27 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15989/15989.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate and refine technical drafts with OpenRouter writer and critic agents do?

Quick Overview This workflow receives a topic and brief via webhook, uses OpenRouter LLMs to draft content and critique it, and iterates through writer/critic revisions until a minimum score is rea...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, AI Summarization use case.