What this workflow does
This workflow helps create WordPress article drafts fast from keywords.
The main problem solved is saving hours of manual work writing and organizing articles with SEO content.
The result is a full draft with title, chapters, intro, conclusion, and a featured image ready in WordPress.
Who should use this workflow
This is good for content managers, small business owners, and anyone who needs quick SEO articles.
It works well even if English is not your first language or if coding is new.
Tools and services used
- OpenAI GPT-4o Mini: Generates article structure and chapter texts.
- OpenAI DALL·E: Creates a photographic featured image.
- WordPress REST API: Posts draft articles and uploads media.
- n8n Workflow Automation: Connects and automates all steps.
Inputs, processing steps, and output
Inputs
- User gives keywords, number of chapters, and max word count through a form.
- API keys for OpenAI and WordPress must be configured.
Processing steps
- Step 1: User input is collected with Form Trigger and mapped using the Set node.
- Step 2: OpenAI generates the article title, subtitle, intro, conclusion, chapter titles, prompts, and an image prompt.
- Step 3: A check ensures all needed data fields are present. If not, user retry message shows.
- Step 4: Chapters array is split into single items.
- Step 5: Each chapter prompt is sent to OpenAI to create rich, SEO-friendly chapter text.
- Step 6: Chapter texts are merged back in order.
- Step 7: A Code node joins the whole article in HTML format with styling.
- Step 8: The post draft is created in WordPress with the generated content and title.
- Step 9: OpenAI DALL·E generates a cover image using the AI image prompt.
- Step 10: The image is uploaded to WordPress media library.
- Step 11: WordPress post updated to set the featured image from uploaded media.
- Step 12: User gets a confirmation message that draft is created.
Output
A WordPress draft post with AI-written article and a related featured image.
Beginner step-by-step: How to use this workflow in n8n
Importing the workflow
- Download the workflow file by clicking the Download button on this page.
- Open your n8n editor.
- Go to the main menu, choose “Import from File,” and select the downloaded file.
Configuring credentials
- Add or update your OpenAI API Key in the OpenAI nodes.
- Add or update your WordPress site’s API credentials in the WordPress and HTTP Request nodes.
- Make sure the WordPress URL in the Set node called Settings is your site’s base URL like
https://yourwordpresssite.com/.
Testing the workflow
- Trigger the workflow by opening the Webhook node URL from the Form Trigger node in a browser or tool.
- Fill the form with keywords, number of chapters, and max words.
- Check the workflow runs fully and posts a draft on WordPress.
Activating for production
- In n8n, change the workflow status from “Draft” to “Active.”
- Monitor executions via n8n dashboard for errors.
- Keep API keys updated and check usage limits.
Additional note
To use self-host n8n, import and activate workflow on your server for better control.
Customizations
- Change WordPress site URL in the Settings node.
- Switch OpenAI model for text generation in respective OpenAI nodes.
- Increase or reduce chapters and max words via the Form Trigger node.
- Change image style by editing the DALL·E prompt or image settings.
- To auto-publish articles, set the post status from “draft” to “publish” in the WordPress node.
Edge cases and common failures
- OpenAI returns incomplete data: Could be limit reached or prompt issue. Add checks to halt workflow on missing fields.
- WordPress authentication fails: Credentials may be wrong or access denied. Recheck API key and user rights.
- Featured image not attached: Media ID may be wrong or HTTP request badly formed. Confirm upload success and correct media ID.
Pre-Production checklist
- Ensure the webhook URL accepts inputs.
- Test OpenAI connection and responses.
- Validate WordPress API access and permissions.
- Run a sample article generation test.
- Confirm cover image displays on draft.
- Backup the workflow before changes.
Summary of results
✓ Saves several hours of content creation time
✓ Creates SEO-friendly article drafts automatically
✓ Builds full article with structured chapters and proper formatting
✓ Generates featured images matching the article theme
✓ Posts finished drafts to WordPress for easy publishing
→ Faster blog post turnaround
→ Reduced manual writing and image searching effort
→ Improved content consistency and SEO quality
=Write the title, the subtitle, the chapters details, the introduction, the conclusions, and an image prompt for a SEO-friendly article about these topics:
{{ $json.keywords }}.
Instructions:
- Place the article title in a JSON field called `title`
- Place the subtitle in a JSON field called `subtitle`
- Place the introduction in a JSON field called `introduction`
- The introduction should be ~60 words
- Place the conclusions in a JSON field called `conclusions`
- The conclusions should be ~60 words
- Use the conclusions to summarize and conclude
- Provide {{ $json.chapters.toString() }} chapters with `title` and `prompt` fields each
- Chapters should logically flow and not repeat concepts
- Use HTML formatting with bold, italic, and lists only
- Search Wikipedia to verify info
- Do not mention Wikipedia explicitly
