What This Workflow Does
This workflow takes a few keywords, number of chapters, and max word count as inputs.
It creates a full draft post on WordPress with AI-written text and an AI-generated image.
It solves the problem of slow and manual blog writing by automating title, outline, chapter content, and image creation.
The output is a ready-to-edit draft post with a featured image in WordPress.
This saves time and makes content production faster and easier for content managers.
Who Should Use This Workflow
Content creators who want to speed up writing blog posts without hiring more writers.
Digital marketing teams needing SEO-friendly articles automatically.
Anyone managing WordPress sites wanting AI help with content and images.
Users who want to produce consistent, good-quality drafts from just keyword ideas.
Tools and Services Used
- n8n: Automates the workflow and connects all services.
- OpenAI GPT-4: Generates article outlines, chapters, and prompts.
- Wikipedia API: Checks facts and improves content accuracy.
- DALL-E (OpenAI): Creates AI-generated featured images.
- WordPress REST API: Posts article drafts and uploads images.
Beginner Step-by-Step: How to Use This Workflow in n8n
Download and Import
- Download the workflow file using the Download button on this page.
- Open your n8n editor.
- Click “Import from File” and select the downloaded workflow file.
Configure Credentials
- Enter your OpenAI API key in the OpenAI credential settings.
- Set your WordPress URL and create credentials (username and application password or OAuth).
- Update any IDs, emails, channels, folders, or tables if the workflow uses custom values.
Setup Variables
- Check the Set node to confirm the WordPress API URL and variable names.
- Adjust form field names if needed based on your usage.
Test and Activate
- Submit a test request via the form URL generated by the Webhook node.
- Watch the workflow execution in n8n to confirm it runs without errors.
- Verify the draft post and the featured image appear in WordPress.
- Activate the workflow in n8n to run for production use.
For users running self-host n8n, the import and activation steps are the same.
Inputs, Processing, and Output Overview
Inputs
- Keywords (comma-separated) from a form.
- Number of chapters for the article.
- Maximum word count allowed.
Processing Steps
- The workflow uses GPT-4 to create an article outline with title, subtitle, intro, chapters, conclusions, and image prompt.
- It checks if the outline has all needed parts.
- The workflow splits the chapters and generates full text for each chapter using GPT-4.
- Each chapter content is merged together with introduction and conclusions, formatted in HTML.
- DALL-E creates a matching featured image based on the outline’s image prompt.
- The image is uploaded to WordPress media library via API.
- The article draft is created on WordPress with the HTML content and post title.
- The uploaded image is linked as the post’s featured image.
Output
A draft post on WordPress with complete article text and a featured image.
The post is ready for review and final publishing.
Common Problems and Solutions
- Problem: GPT-4 returns incomplete article outline.
Cause: API token limit or prompt issue.
Fix: Use fewer chapters or increase max tokens in OpenAI nodes. - Problem: WordPress API upload fails with 401 Unauthorized.
Cause: Wrong credentials or permissions.
Fix: Check your WordPress application password and user rights, re-link credentials in n8n. - Problem: Featured image does not show on draft.
Cause: Wrong media ID used.
Fix: Ensure HTTP request node updates post with correct media ID matching uploaded image.
Customization Ideas
- Change max number of chapters in Webhook node form field dropdown.
- Tweak word count per chapter in OpenAI prompt or formulas within the nodes.
- Adjust WordPress URL in Set node for different sites.
- Modify image prompt style and size in DALL-E generation node for different looks.
- Improve Wikipedia data queries in GPT-4 prompts for better fact checks.
Code Sample for Assembling Article HTML
This Code node combines intro, chapters, and conclusions into HTML:
let article = "";
// Introduction
article += $('Create post title and structure').first().json.message.content.introduction;
article += "<br><br>";
for (const item of $input.all()) {
article += "<strong>" + item.json.title + "</strong>";
article += "<br><br>";
article += item.json.message.content;
article += "<br><br>";
}
// Conclusions
article += "<strong>Conclusions</strong>";
article += "<br><br>";
article += $('Create post title and structure').first().json.message.content.conclusions;
return [
{
"article": article
}
];Use this code by copying into the respective Code node inside the workflow.
Summary and Result
✓ Saves hours weekly by automating blog post writing.
✓ Produces SEO-friendly articles with logical chapter structure.
✓ Creates AI images and publishes posts as drafts ready for review.
→ Makes content creation simpler for content managers.
→ Delivers consistent, quality WordPress draft posts from keywords.
