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.