AI Blog Headline & Keyword Optimizer

This AI-powered workflow finds the best SEO keywords for your blog article and automatically rewrites headlines to target those keywords, improving your content’s search engine performance. Ideal for content marketers and SEO specialists looking to boost organic reach and relevance with minimal manual effort.

How the AI Flow works - AI Blog Headline & Keyword Optimizer

How the AI Flow works

Receive Article URL and Target Keyword

Collects the article URL and the primary keyword from the user.

Extract Headlines from the Article

Retrieves only the headlines (H1, H2, H3) from the given article URL using an AI-powered agent and URL retriever.

Discover SEO Keyword Clusters

Finds related and high-performing keywords for the target keyword using Google keyword data.

Rewrite Headlines for SEO

Uses AI to rewrite the article's headlines to better target the identified keywords, keeping the original article content unchanged.

Output Optimized Headlines

Displays the updated headlines and the changes made for the user to review and use.

Prompts used in this flow

Below is a complete list of all prompts used in this flow to achieve its functionality. Prompts are the instructions given to the AI model to generate responses or perform actions. They guide the AI in understanding user intent and generating relevant outputs.

Article Headline Repurposing Prompt

Prompt template instructing the LLM to repurpose article headlines to focus on a new keyword, while keeping paragraphs unchanged.

                You are given an article Headline Structure, and a keyword. try to repurpose the article to focus on the given keyword. generate Title, and change the headlines as needed to focus on keywords in the same cluster. KEEP THE PARAGRAPHS OF THE ARTICLE AS THE SAME AS IT WAS. ONLY CHANGE THE HEADLINES (H1, H2, H3) AND TITLE

Also mention the previous headline and the new headline that you changed.

--- Keywords to repurpose the article---
{input}
---

---ARTICLE---
{context}
---
            

Components used in this flow

Below is a complete list of all components used in this flow to achieve its functionality. Components are the building blocks of every AI Flow. They allow you to create complex interactions and automate tasks by connecting various functionalities. Each component serves a specific purpose, such as handling user input, processing data, or integrating with external services.

Flow description

Purpose and benefits

Workflow Overview: Keyword Repurposing for Articles

This workflow automates the process of optimizing article headlines to target new, high-potential keywords. It leverages AI and SEO tools to find the best keywords based on user input, extracts headlines from existing articles, and then rewrites those headlines to improve SEO targeting without altering the article content.

Step-by-Step Process

1. User Input and Onboarding

  • Welcome Message: When a user opens the chat or interface, they are greeted with a clear instruction:
    “Just put in your URL and the keyword which you want to repurpose the blog for and I’ll optimize the headlines to target that keyword.”
  • Input Collection: The user provides:
    • The URL of the article to repurpose.
    • The primary keyword to focus on.

2. Structured Data Extraction

  • The workflow parses the user input, extracting the article URL and the new focusing keyword into a structured format for downstream processing.

3. Keyword Research

  • Primary Keyword Extraction: The primary focusing keyword is isolated from the structured user input.
  • Related Keywords Lookup: Using a Google Keywords API, the workflow fetches a cluster of related keywords, as well as data like search volume, CPC, and competition.
  • Formatting for AI Input: The list of related keywords is formatted into plain text for clear presentation to the AI model.

4. Article Headline Extraction

  • URL Scraping: An AI agent (configured as a “Headline Extractor”) uses a URL retriever tool to fetch the article’s content.
  • Headline Parsing: The agent extracts only the headlines (H1, H2, H3) from the article, preserving their structure.

5. AI-Powered Headline Rewriting

  • Prompt Engineering: The workflow constructs a detailed AI prompt that includes:

    • The primary and related keywords.
    • The extracted article headlines.
    • Clear instructions:
      • Only change the headlines (H1, H2, H3, and Title) as needed to target the new keywords.
      • Do not modify the article’s paragraphs.
      • List the previous and new headlines for transparency.
  • Expert Copywriter Agent: An AI agent, acting as a professional copywriter, processes the prompt and generates optimized headlines.

6. Sequential Task Execution

  • The workflow organizes these operations as a sequential task:
    • The headline rewriting task is described and assigned to the AI agent.
    • Execution and output are managed step-by-step to ensure logical processing and error handling.

7. Output and Presentation

  • Results Display:
    • The new, keyword-optimized headlines (along with their previous versions) are presented to the user.
    • The extracted headlines can also be shown separately for user reference.
    • All outputs are displayed in an interactive chat interface.

Workflow Structure Summary

StepPurposeTool/Agent Used
User InputCollect URL and new keywordChat Interface
Data StructuringParse and structure inputStructured Output Generator
Keyword ResearchFind keyword cluster and metricsGoogle Keywords API
Headline ExtractionExtract old headlines from articleHeadline Extractor AI Agent
Prompt CreationBuild AI prompt with keywords & headlinesPrompt Templates
Headline RewritingRewrite headlines for SEO targetingExpert Copywriter AI Agent
Output DisplayShow optimized headlines to userChat Output

Benefits and Use Cases

  • Scalability: Automates the tedious process of keyword research and headline rewriting, enabling batch optimization across many articles.
  • SEO Optimization: Ensures that articles are aligned with the latest, high-traffic keywords, improving organic search performance.
  • Content Repurposing: Allows marketers and writers to quickly pivot existing content to capture new keyword opportunities.
  • Transparency: Clearly displays old vs. new headlines for editorial review and approval.

Ideal For

  • Content marketers, SEO specialists, and publishers looking to scale up content optimization.
  • Agencies managing multiple client blogs or websites.
  • Anyone aiming to automate and streamline the keyword repurposing workflow for existing articles.

By chaining together AI copywriting, SEO research, and automated extraction, this workflow delivers a robust, repeatable solution for headline optimization that can save hours of manual work and drive better search rankings.

Let us build your own AI Team

We help companies like yours to develop smart chatbots, MCP Servers, AI tools or other types of AI automation to replace human in repetitive tasks in your organization.

Learn more