Generate written content with GPT Recursive Writing Editing ag
Who is this for? Content creators, writers, and automation enthusiasts experimenting with recursive AI workflows for content generation and refinement. Ideal...
🔌 Nodes & Integrations Used (5)
📖 Implementation & Setup Guide
Who is this for? Content creators, writers, and automation enthusiasts experimenting with recursive AI workflows for content generation and refinement. Ideal for those exploring AI agents that collaborate in cycles of writing and editing.
What problem does this solve? This template introduces a fully automated, recursive writing‑editing loop using multi‑agent collaboration. A “Writing Agent” generates content based on an input topic. An “Editing Agent” reviews it, suggests improvements, and determines whether the work is complete. The loop continues until the editor is satisfied—allowing for high‑quality, iterative AI‑assisted writing with minimal human input.
How it works This template is a foundational setup to help you build custom recursive writing workflows:
- **Trigger**: Activated by an n8n chat message containing a topic. You can customize this to work with webhooks, forms, or other input sources.
- **Edit Handler**: A code node checks for previous edits and sets a default empty string if none are found.
- **Writing Agent**: Generates a blurb based on the topic and any edits. Customize the prompt in this node by editing the user/system instructions to fit your tone, domain, or style preferences.
- **Editing Agent**: Suggests specific edits and outputs a structured JSON object:
```json { "status": "incomplete", "edits": "Replace passive voice with active voice in the second sentence. Clarify the main idea in the opening line." } ```
You can adjust the JSON format or editing criteria in the prompt field. Customize the prompt in this node by editing the user/system instructions to fit your tone, domain, or style preferences. 5. **Recursive Loop**: If the status is “incomplete,” the edits are passed back to the Writing Agent, which revises the blurb. 6. **Completion**: Once the Editing Agent outputs a status of “complete,” the workflow ends, and the final blurb is returned to the n8n chat.
Setup Steps
- **Import the Template** into your n8n workspace.
- **Configure API Credentials**: Link your OpenAI API key (or your preferred LLM like Claude or Gemini) in the credentials section.
- **Customize the Prompts** (Optional but recommended):
- - In the **Writing Agent**, you can instruct it to mimic a specific tone, format, or genre.
- - In the **Editing Agent**, specify your editing standards (e.g., concise, persuasive, technical).
- - Modify the JSON output structure in the **Structured Output Parser** node if needed.
- **Test and Iterate**: Run a test by sending a topic via the chat trigger and observe the loop behavior.
Example Output **Input Topic**: “The future of remote work” **Final Blurb**: “Remote work is here to stay. As companies embrace flexible setups, productivity and employee satisfaction are reaching new highs. The challenge now is to build culture and collaboration tools that keep up.”
This template offers a powerful starting point for recursive AI writing. Expand it with additional agents, tone shifts, formatting layers, or sentiment analysis as needed.
⚡ How to import this workflow into n8n:
- Click the Direct Download JSON button above to save
Generate_written_content_with_GPT_Recursive_Writing_Editing_ag.json. - Log in to your n8n Cloud or self-hosted n8n instance.
- In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
- Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
- Click Execute Workflow to test and switch to Active!
Related AI Agents Workflows
View All in AI Agents →5 ways to process images PDFs with Gemini AI in n8n
How it works Many users have asked in the support forum about different methods to analyze images and PDF documents with Google Gemini AI in n8n. This workfl...
7 AI Sales Assistant
Production-ready n8n automation template for 7 AI Sales Assistant built by AhiXLight. Seamlessly connects Airtop Tool, Slack, Airtop with 24 configured nodes.
AAVE portfolio professional AI agent Telegram Email GPT 4o
A next-generation AI-powered DeFi health monitor that tracks wallet positions across Aave V3 using GPT-4o and LangChain. It delivers human-readable reports v...
Access control for AI agents RBAC using Airtable and Telegram
Purpose This workflow allows granular control over the access to tools connected to AI Agents (including Multi-Agent setups) using Role Based Access Control....