Draft and revise technical articles with OpenRouter in a content pipeline

Go to Workflow
0 views
Built by Elvis Sarvia Elvis Sarvia
Created on May 26, 2026

Description

Quick Overview
This subworkflow is triggered by a parent content pipeline, uses OpenRouter (via an AI Writer Agent) to draft or revise a technical article from a brief, research notes, and optional reviewer feedback, and returns the updated pipeline state with the current draft and word count.

How it works
Receives input from a parent workflow containing the brief, research notes, and optionally a previous draft plus reviewer feedback.
Sends the brief, research JSON, and any revision context to an AI Writer Agent backed by OpenRouter to generate a fresh draft or revise the prior draft.
Parses the agent’s JSON response, extracts the draft text and word count (or calculates it if missing), and flags whether the output is a revision.
Merges the extracted fields back into the original input and returns the updated state (including currentDraft) to the parent workflow.

Setup
Add an OpenRouter API credential and select it for the OpenRouter chat model used by the Writer Agent.
Ensure the parent workflow passes the expected fields (for example brief, research, and optionally previousDraft and feedbackNotes) when calling this subworkflow.
Update the Writer Agent system prompt if you need a different word-count target, brand voice, or formatting requirements.

This workflow was created by Elvis Sarvia and shared publicly on the n8n community template library. n8nFind indexes it for discovery — the workflow remains the property of its original creator.

Nodes Used (3)

AI Agent
@n8n/n8n-nodes-langchain.agent
Code
n8n-nodes-base.code
OpenRouter Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenRouter