Write and refine drafts with Anthropic writer and critic agents and log results
Ready for 3.0What this workflow does
This AI workflow has 20 nodes and runs when a chat message arrives (plus 1 other trigger). Along the way it connects Anthropic Chat Model and Google Sheets.
How it runs
Trigger: When a chat message arrives (plus 1 other trigger).
- Initialize Loop State (Code): runs custom JavaScript code
- Set Workflow Parameters (Edit Fields (Set)): sets 6 fields: houseRules, rubric, approvalScore…
- Prepare Round Data (Code): runs custom JavaScript code
- Writer Agent (AI Agent): runs an AI agent, with model: Writer Claude Model; output parser: Writer Output Schema
- Capture Draft Output (Code): runs custom JavaScript code
- Critic Agent (AI Agent): runs an AI agent, with model: Critic Claude Model; output parser: Critic Output Schema
- Capture Critique Output (Code): runs custom JavaScript code
- Decision Maker (Code): runs custom JavaScript code
- Check Loop Continuation (If): checks a condition and branches into true / false
- Build Next Round Data (Code): runs custom JavaScript code
…plus 4 more steps. See the full node list below.
Services it uses
Other Anthropic + Google Sheets templates (261)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (10)
- Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Manual Trigger
n8n-nodes-base.manualTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - AI Agent
@n8n/n8n-nodes-langchain.agent - Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - If
n8n-nodes-base.if - Google Sheets
n8n-nodes-base.googleSheets - HTTP Request
n8n-nodes-base.httpRequest
From the author
Quick overview This workflow generates a draft with an Anthropic chat model, critiques it against your house rules and rubric, and iterates revisions until it meets an approval threshold or hits stop conditions, then logs the run to Google Sheets and…