Back to Templates

End-to-End Blog Generation for WordPress with LLM Agents&Image - GPT-5 Optimized

Last update

Last update a day ago

Share


🧠 n8n Blog Automation Workflow — GPT-5 Optimized

End-to-end automation of SEO-optimized WordPress blog creation powered by upgraded GPT-5-based LLM agents, real-time data gathering, intelligent content structuring, and optional AI-driven image generation.
This workflow uses enhanced, role-specific prompts tailored for GPT-5 to maximize factual accuracy, SEO impact, and stylistic consistency.


📌 Overview

The system accepts blog parameters from a form, dynamically fetches WordPress categories, and produces a complete, publication-ready post through an orchestrated sequence of GPT-5 agents.
Each agent executes once in a strict order with clearly defined responsibilities.

Core Capabilities

  • Real-time search and fact retrieval (OpenRouter / Perplexity Sonar)
  • SEO-focused outline planning
  • Structured section creation
  • Expert-level section writing with inline HTML citations
  • Editorial refinement into cohesive, polished HTML
  • Metadata and featured-image prompt generation
  • Automated category assignment and draft publishing to WordPress

🔁 Trigger

Form Trigger collects:

  • Keywords
  • Word count
  • Number of sections
  • Writing style
  • Website URL
  • Featured image toggle

🧠 Orchestration Agent (GPT-5)

Central Director agent optimized for GPT-5 that coordinates the pipeline:

  1. GetOnlineInfo — Current Q&A and search-driven insights
  2. OutlinePlanner — SEO-structured Table of Contents
  3. createSections — ToC → detailed section definitions
  4. SectionsWriter — Expert, citation-rich content
  5. Editor — Full HTML assembly, SEO and legal compliance
  6. MetaInfo — Title, slug, meta description, category selection
  7. ImagePrompt — Realistic cover image prompt + alt text (if enabled)

✍️ Writing Flow

  1. Real-time data retrieval
  2. SEO-optimized outline creation
  3. Section breakdown with clear descriptions
  4. Detailed section drafting with verified sources
  5. Editorial polishing into publish-ready HTML
  6. Metadata generation (title, slug, description, category)
  7. Optional image prompt creation and upload
  8. Automatic WordPress draft publishing

✅ Output Format

{
  "toc": "Table of Contents",
  "post_html": "<final HTML content>",
  "meta_data": {
    "title": "...",
    "slug": "...",
    "description": "..."
  },
  "image_data": {
    "image_prompt": "...",
    "alt_text": "..."
  },
  "ready": true
}

🌐 WordPress Integration

  • Authenticated API calls to /wp-json/wp/v2/posts and /wp-json/wp/v2/media
  • Draft mode publishing with category & author assignment
  • Featured image creation, resizing, and metadata linking (if enabled)

🧩 Setup Instructions

1. Required Credentials

  • WordPress API credentials
  • OpenAI API key
  • OpenRouter API key (optional)

2. Sub-Workflows Required

  • OutlinePlanner
  • createSections
  • SectionsWriter
  • Editor
  • MetaInfo
  • ImagePrompt (if enabled)

Each must support input via:

{"query": "<text>"}

3. Dynamic Inputs

  • Categories fetched via WP REST API and shown in the form
  • Image creation can be toggled (true / false)

📸 Optional Image Pipeline

If enabled:

  1. Generate image prompt and alt text
  2. Create realistic cover image (1024x1024)
  3. Resize and upload image to WordPress
  4. Set image metadata and assign featured image

💡 Notes

  • GPT-5 prompts embedded in each agent ensure high-quality, context-aware output
  • All HTML and JSON outputs are validated before publication
  • Modular sub-workflows allow isolated testing and debugging
  • Workflow supports legal accuracy, SEO performance, and dynamic web data responsiveness