🎬 Rewrite web content with exact character counts using GPT-4.1 and Google Sheets

⚡ 27 views · 🎬 Content Creation & Video

💡 Pro Tip — For competitive intelligence, ScraperNode can automate the data collection — Yelp reviews, Glassdoor company data, and Crunchbase profiles all return structured JSON you can feed straight into this workflow.

View All Scrapers

Description

Description

An AI-powered content rewriter that maintains exact character counts line-by-line while rewriting web pages for SEO. Fetches reference URL content, preserves layout-critical formatting, and logs detailed comparisons to Google Sheets—perfect for agencies rewriting competitor content while maintaining design consistency.


What this workflow does

This workflow solves a unique SEO challenge: rewriting web content while preserving exact character counts on every single line. When you need to rewrite a competitor’s page or update your own content without breaking the layout, this automation fetches the reference URL, converts it to Markdown, and uses GPT-4.1 to rewrite marketing text, headings, and CTAs while maintaining the exact same character count as the original—down to the letter. The AI intelligently decides what to keep unchanged (form labels), what to skip entirely (URLs, footers), and what to rewrite (marketing content). A second AI agent then compares the original and rewritten versions line-by-line, verifying character counts and logging everything to Google Sheets for quality control.

Perfect for SEO agencies, content teams, and web developers who need to rewrite content without disturbing page layouts, CSS styling, or design templates that depend on specific text lengths.


Key features

Exact character count preservation: Every rewritten line matches the original’s character count precisely—no approximations, no +/- 1 character deviations. If the original has 47 characters, the rewrite will have exactly 47 characters.

Smart content classification: The AI automatically categorizes each line into three actions: KEEP (form labels like Name, Email, Phone remain unchanged), SKIP (URLs and footers excluded entirely from output), or REWRITE (marketing content, headings, CTAs rewritten with exact length).

Line-by-line comparison analysis: A second AI agent compares original vs. rewritten content, creates structured JSON showing each change, verifies character and word counts match, and flags any discrepancies.

Google Sheets quality tracking: All comparisons logged to Google Sheets with columns for Old Text, AI Suggested Text, Old Text Length, and AI Suggested Text Length—enabling manual review and quality control.

Layout-safe rewriting: Preserves Markdown structure, maintains spacing, keeps technical elements intact—ensures the rewritten content fits perfectly into existing page designs and CSS frameworks.

Form-based workflow: Simple form interface with Client ID, Service Page Keyword, Instructions, and Reference URL—no coding needed to submit rewrite requests.

Dual GPT-4.1 agents: Uses two independent AI agents (rewriter and comparator) with GPT-4.1 for maximum accuracy and quality verification at every step.


How it works

1. Submit rewriting request via form

User fills a simple form with:

2. Fetch reference webpage content

The workflow sends an HTTP POST request to the provided URL and retrieves the complete HTML source code of the page.

3. Convert HTML to Markdown

The HTML is converted to clean Markdown format, removing unnecessary tags while preserving structure, headings, lists, and text content. This makes it easier for the AI to process line-by-line.

4. AI rewrites content with exact character matching

The first AI Agent (powered by GPT-4.1) receives the Markdown content and processes it with ULTRA-STRICT rules:

Character counting rules:

Decision logic for each line:

Character-matching techniques:

Verification checklist:

If even 1 line has mismatched characters, the AI retries until it’s perfect.

5. Compare original vs. rewritten content

A second AI Agent (also GPT-4.1) compares the original Markdown input with the rewritten output:

6. Parse comparison to structured format

The Structured Output Parser ensures the comparison JSON is valid and properly formatted:

{
  "comparisons": [
    {
      "old_text": "exact sentence from original",
      "ai_suggested_text": "corresponding sentence from rewritten version",
      "Old_text_count": "47",
      "ai_suggested_text_Count": "47"
    }
  ]
}

7. Split comparison into individual rows

The Split Out node takes the comparisons array and creates a separate item for each comparison, preparing it for Google Sheets insertion.

8. Log comparison to Google Sheets

Each comparison is written to Google Sheets as a new row with columns:

This creates a complete audit trail for manual review and quality verification.


Setup requirements

Tools you’ll need:

Estimated setup time: 20–25 minutes


Configuration steps

1. Connect Google Sheets

2. Add OpenAI API credentials

3. Copy form URL

4. Customize AI rewriting rules (optional)

Open “Rewrite Content with Exact Character Count” node and edit the system message to:

5. Test the workflow

6. Review and refine


Use cases

SEO agencies rewriting competitor content: Analyze top-ranking competitor pages and rewrite them for your clients while preserving the exact layout that works. Character-count matching ensures the rewritten content fits perfectly into the same design templates.

Web designers updating legacy sites: Modernize old website copy without breaking existing CSS layouts that depend on specific text lengths. Maintain pixel-perfect designs while refreshing the message.

Content teams A/B testing variations: Create multiple versions of the same page with different wording but identical character counts. Test messaging changes without layout shifts affecting results.

Translation agencies adapting content: When translating from one language to another requires matching specific character limits (billboards, app interfaces, fixed-width layouts), this workflow helps maintain constraints.

E-commerce product descriptions: Rewrite product copy for different brands or markets while keeping descriptions at exact character counts required by platform templates or PIM systems.

Landing page optimization: Test different headlines, CTAs, and value propositions while ensuring each variation maintains the original’s character count—preventing layout breaks on mobile or desktop.


Customization options

Adjust character count strictness

If your use case allows minor variations (+/- 2-3 characters), edit the rewriting agent’s system message:

Add more content types to KEEP

In the rewriting agent system message, expand the “KEEP AS-IS” list:

Change output format

Instead of Google Sheets, route comparison data to:

Add batch processing

Modify the form to accept multiple URLs at once:

Implement approval workflow

Add human review before finalizing rewrites:


Troubleshooting

Character counts don’t match

URLs or footers appearing in rewritten output

Comparison agent fails to parse output

Google Sheets not updating

Rewriting takes too long

Form labels being rewritten incorrectly


Resources


Support

Need help or custom development?

📧 Email: info@isawow.com
🌐 Website: https://isawow.com/

🔗 Nodes Used

Google Sheets, HTTP Request, Markdown, AI Agent, OpenAI Chat Model, Structured Output Parser

đŸ“„ Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup