🧠 n8n Blog Automation Workflow — GPT-5 Optimized
This is a ready-to-use, single workflow — you can copy and paste it directly into n8n and start working.
It handles end-to-end SEO blog automation with triggers, orchestration, AI-powered writing, metadata, tags, excerpts, WordPress publishing, and Google Sheets updates.
📌 Overview
The system accepts blog parameters either from a form submission or from a Google Sheet row (via scheduled trigger), 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, excerpt, and featured-image prompt generation
- Automated category, tag creation/update, and excerpt update
- Draft publishing to WordPress
- Updates the corresponding Google Sheet row with
created = yes
🔁 Triggers
1. Form Trigger
Collects:
- Keywords
- Word count
- Number of sections
- Writing style
- Website URL
- About Website (used for context)
- Featured image toggle
2. Google Sheets + Schedule Trigger
Automatically pulls rows on schedule from a Google Sheet with the following columns:
Keywords
wordCount
Number of sections
Generate a featured image
Writing Style
Website
About Website
created
→ initially set to no, automatically updated to yes once the blog post is created and uploaded to WordPress.
🧠 Orchestration Agent (GPT-5)
Central Director agent optimized for GPT-5 that coordinates the pipeline:
- GetOnlineInfo — Current Q&A and search-driven insights
- OutlinePlanner — SEO-structured Table of Contents
- createSections — ToC → detailed section definitions
- SectionsWriter — Expert, citation-rich content
- Editor — Full HTML assembly, SEO and legal compliance
- MetaInfo — Title, slug, excerpt, meta description, category selection
- Tags Agent — Creates or updates SEO-friendly WordPress tags
- ImagePrompt — Realistic cover image prompt + alt text (if enabled)
✍️ Writing Flow
- Input parsing (from Form or Google Sheets row)
- Real-time data retrieval
- SEO-optimized outline creation
- Section breakdown with clear descriptions
- Detailed section drafting with verified sources
- Editorial polishing into publish-ready HTML
- Metadata and excerpt generation (title, slug, description, category)
- Tag creation and update in WordPress
- Optional image prompt creation and upload
- Automatic WordPress draft publishing with excerpt and tags updated
- Google Sheet row update — set
created = yes
✅ Output Format
{
"toc": "Table of Contents",
"post_html": "<final HTML content>",
"meta_data": {
"title": "...",
"slug": "...",
"excerpt": "...",
"category_id": 0
},
"image_data": {
"image_prompt": "...",
"alt_text": "..."
},
"tags": [
{"name": "...", "description": "..."}
],
"ready": true
}
🌐 WordPress Integration
- Authenticated API calls to
/wp-json/wp/v2/posts
, /wp-json/wp/v2/media
, and /wp-json/wp/v2/tags
- Draft mode publishing with category & author assignment
- Featured image creation, resizing, and metadata linking (if enabled)
- Automatic creation and update of tags
- Automatic creation and update of excerpts
🧩 Setup Instructions
1. Required Credentials
- WordPress API credentials
- OpenAI API key
- OpenRouter API key (optional)
- Google Sheets API credentials (if using scheduled trigger)
2. Sub-Workflows Required
- OutlinePlanner
- createSections
- SectionsWriter
- Editor
- MetaInfo
- Tags Agent
- ImagePrompt (if enabled)
3. Dynamic Inputs
- Categories fetched via WP REST API and shown in the form
- Tags generated and updated dynamically by Tags Agent
- Excerpt automatically created and updated in WordPress
- Image creation can be toggled (
true
/ false
)
📸 Optional Image Pipeline
If enabled:
- Generate image prompt and alt text
- Create realistic cover image (1024x1024)
- Resize and upload image to WordPress
- Set image metadata and assign featured image
💡 Notes
- Workflow is production-ready — just copy-paste into n8n as a single workflow.
- GPT-5 prompts embedded in each agent ensure high-quality, context-aware output
- All HTML, JSON, excerpts, and tags are validated before publication
- Modular sub-workflows allow isolated testing and debugging
- Workflow supports legal accuracy, SEO performance, and dynamic web data responsiveness