OpenAI to WordPress, drafts with featured images
Writing “just one more blog post” sounds simple until you’re staring at a blank doc, hunting for a usable featured image, and realizing you still need a clean draft inside WordPress.
This OpenAI WordPress drafts automation hits content marketers first. But site owners and agency leads feel it too, especially when you’re trying to publish consistently without burning hours on busywork. You get review-ready drafts with a featured image, built from a small keyword list.
Below is what the workflow actually does, what it replaces, and how to make it fit your publishing process without getting stuck in the weeds.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: OpenAI to WordPress, drafts with featured images
flowchart LR
subgraph sg0["Form Submission Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/form.svg' width='40' height='40' /></div><br/>Form Submission Trigger"]
n1@{ icon: "mdi:swap-vertical", form: "rounded", label: "Configure Inputs", pos: "b", h: 48 }
n2@{ icon: "mdi:robot", form: "rounded", label: "Generate Outline and Title", pos: "b", h: 48 }
n3@{ icon: "mdi:wrench", form: "rounded", label: "Wiki Research Tool", pos: "b", h: 48 }
n4@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Validate Generated Data", pos: "b", h: 48 }
n5@{ icon: "mdi:swap-vertical", form: "rounded", label: "Expand Chapter Items", pos: "b", h: 48 }
n6@{ icon: "mdi:robot", form: "rounded", label: "Compose Chapter Text", pos: "b", h: 48 }
n7["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>Combine Chapter Content"]
n8["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Assemble Article Body"]
n9["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/wordpress.svg' width='40' height='40' /></div><br/>Create WordPress Draft"]
n10@{ icon: "mdi:robot", form: "rounded", label: "Create Cover Image", pos: "b", h: 48 }
n11["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Upload Image Asset"]
n12["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Attach Featured Image"]
n13["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/form.svg' width='40' height='40' /></div><br/>Success Response Form"]
n14["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/form.svg' width='40' height='40' /></div><br/>Error Response Form"]
n6 --> n7
n1 --> n2
n5 --> n6
n5 --> n7
n3 -.-> n2
n11 --> n12
n9 --> n10
n8 --> n9
n0 --> n1
n4 --> n5
n4 --> n14
n10 --> n11
n12 --> n13
n7 --> n8
n2 --> n4
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n2,n6,n10 ai
class n3 ai
class n4 decision
class n11,n12 api
class n8 code
classDef customIcon fill:none,stroke:none
class n0,n7,n8,n9,n11,n12,n13,n14 customIcon
The Problem: Content Production Breaks at the Draft Stage
You can have the best keyword list in the world and still fail to publish, because the work that kills momentum is all the “in-between” stuff. Outline, intro, sections, conclusion. Then moving it into WordPress. Then formatting so it doesn’t look like a wall of text. Then the featured image rabbit hole: find something, resize it, upload it, set it, hope it’s not awkwardly cropped. And if you’re trying to scale, these tiny steps become the whole job. Honestly, it’s exhausting.
It adds up fast. Here’s where it breaks down in real life.
- Drafts get stuck in Google Docs because moving them into WordPress is tedious and easy to postpone.
- Featured images become a bottleneck, so posts ship late or look inconsistent across the site.
- When multiple people write, structure varies wildly, which means more editing and slower approvals.
- Long-form content feels “expensive” because each extra section adds more manual formatting and QA.
The Solution: OpenAI → WordPress Drafts (With Images)
This workflow turns a handful of keywords into a structured WordPress draft, then generates and attaches a featured image so you’re not juggling tools. It starts with a simple web form inside n8n where you enter keywords and a few settings (like how many chapters you want). OpenAI writes the title, introduction, chapter plan, and conclusion, then generates each chapter independently so the article can be longer without collapsing into a messy blob. The workflow validates the AI output before it continues, assembles everything into a clean HTML body, creates a draft post in WordPress, generates a cover image with DALL·E, uploads it, and sets it as the featured image. Finally, it replies in the form with a success or error message, so you know what happened without digging through logs.
The workflow begins when you submit the n8n form. From there, OpenAI handles structure and chapter writing (with optional Wikipedia research), then n8n compiles the finished draft and pushes it into WordPress. Last, it creates and attaches the featured image and confirms the draft is ready for review.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you publish 3 posts a week. Manually, a typical draft cycle might be about 2 hours writing, about 30 minutes formatting and moving it into WordPress, plus another 20 minutes finding and setting a featured image, so roughly 3 hours per post. With this workflow, you can submit the form in 5 minutes, then wait a few minutes while chapters and the image generate, and you end up with a WordPress draft ready to edit. That’s roughly 8–10 hours back each week, without skipping the human review step.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- OpenAI for generating text and images
- WordPress to create drafts and upload media
- OpenAI API key (get it from the OpenAI dashboard)
Skill level: Intermediate. You’ll connect credentials, set your WordPress URL, and adjust prompts if you want a specific style.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
Form submission triggers the run. You open the n8n form URL, enter your keywords, choose how many chapters you want, and submit.
Outline and research get created first. OpenAI generates a title, introduction, conclusion, and a chapter plan, then the workflow can pull supporting context from Wikipedia so the draft isn’t just “fluffy words.”
Chapters are generated one at a time. n8n splits the outline into chapter items, asks OpenAI to expand each chapter, and merges them back together so longer posts stay coherent.
WordPress receives a real draft plus an image. The workflow assembles the HTML body, creates the draft post, generates a cover image with DALL·E, uploads it via WordPress endpoints, then attaches it as the featured image.
You can easily modify the prompts and formatting to match your site’s editorial style based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Form Trigger
This workflow starts from a public form that collects the article requirements.
- Add and open Form Submission Trigger.
- Set Path to
create-wordpress-post(under Options). - Set Form Title to
Create a WordPress post with AIand Form Description toFill this form with the required information to create a draft post on WordPress. - Configure fields: Keywords (comma-separated) (required), Number of chapters (dropdown with options
1–10, required), and Max words count (number, required). - Set Response Mode to
lastNodeto return the final form response.
Step 2: Connect the Input Mapping
Map form inputs to standardized variables used across the workflow.
- Add Configure Inputs after Form Submission Trigger.
- Set wordpress_url to
https://[YOUR_ID]/. - Set keywords to
{{ $json['Keywords (comma-separated)'] }}. - Set chapters to
{{ $json['Number of chapters'] }}. - Set words to
{{ $json['Max words count'] }}.
[YOUR_ID] in wordpress_url and downstream URL fields with your actual WordPress domain.Step 3: Set Up AI Outline Generation
Generate the article outline, chapters, and image prompt using AI.
- Add Generate Outline and Title after Configure Inputs.
- Credential Required: Connect your openAiApi credentials.
- Confirm JSON Output is enabled and Model is
gpt-4o-mini. - Keep the prompt content as configured, including references to
{{ $json.keywords }}and{{ $json.chapters.toString() }}so output includestitle,subtitle,chapters,introduction,conclusions, andimagePrompt. - Ensure Wiki Research Tool is connected as an AI tool to Generate Outline and Title; credentials must be added to Generate Outline and Title, not the tool node itself.
Step 4: Validate and Expand Chapters (Parallel Execution)
Validate AI output, then fan out chapters for processing.
- Add Validate Generated Data after Generate Outline and Title.
- Keep the validation checks for required fields using expressions like
{{ $json.message.content.title }}and{{ $json.message.content.chapters }}. - Connect the true output to Expand Chapter Items and the false output to Error Response Form.
- In Expand Chapter Items, set Field To Split Out to
message.content.chapters.
Expand Chapter Items outputs to both Compose Chapter Text and Combine Chapter Content in parallel.
Step 5: Generate and Assemble Chapter Content
Create each chapter’s text, merge items, and assemble the final HTML article body.
- Open Compose Chapter Text and confirm the dynamic prompt references, including
{{ $('Generate Outline and Title').item.json.message.content.title }},{{ $json.title }}, and the per-chapter word count calculation{{ Math.round(($('Configure Inputs').item.json.words - 120)/ $('Configure Inputs').item.json.chapters) }}. - Credential Required: Connect your openAiApi credentials to Compose Chapter Text.
- In Combine Chapter Content, set Mode to
combineand Combine By tocombineByPosition. - In Assemble Article Body, keep the JavaScript that composes
introduction, chapter titles, chapter content, andconclusionsinto a singlearticlefield.
Step 6: Create the WordPress Draft
Send the compiled article to WordPress as a draft post.
- Add Create WordPress Draft after Assemble Article Body.
- Credential Required: Connect your wordpressApi credentials.
- Set Title to
{{ $('Generate Outline and Title').first().json.message.content.title }}. - Set Status to
draftand Content to{{ $json.article }}.
Step 7: Generate and Attach the Cover Image
Create an AI image, upload it to WordPress, and attach it as the featured image.
- Open Create Cover Image after Create WordPress Draft and keep Resource set to
image. - Credential Required: Connect your openAiApi credentials.
- Set Prompt to
Generate a photographic image to be used as the cover image for the article titled: {{ $('Generate Outline and Title').first().json.message.content.title }}. This is the prompt for the image: {{ $('Generate Outline and Title').first().json.message.content.imagePrompt }}, photography, realistic, sigma 85mm f/1.4. - In Upload Image Asset, set URL to
https://[YOUR_ID]/wp-json/wp/v2/mediaand Method toPOST, with Content Type set tobinaryDataand Input Data Field Name todata. - Credential Required: Connect your wordpressApi credentials for Upload Image Asset.
- In Attach Featured Image, set URL to
https://[YOUR_ID]/wp-json/wp/v2/posts/{{ $('Create WordPress Draft').first().json.id }}and add featured_media query parameter with value{{ $json.id }}. - Finish the success path by sending the user to Success Response Form with Completion Message set to
The article {{ $json.title.rendered }} was correctly created as a draft on WordPress!.
[YOUR_ID] in the URL; update both to your domain or the requests will fail.Step 8: Add Error Handling
Provide a clear fallback when AI output fails validation.
- Open Error Response Form and keep Respond With set to
showText. - Set Response Text to
There was a problem creating the article, please refresh the form and try again!. - Ensure the false branch of Validate Generated Data connects to Error Response Form.
Step 9: Test and Activate Your Workflow
Run a full test to confirm AI output, WordPress draft creation, and image attachment.
- Use Form Submission Trigger to open the form and submit test values for keywords, chapters, and word count.
- Verify a successful execution ends at Success Response Form and that the response message includes the created draft title.
- In WordPress, confirm a new draft post exists with the generated content and a featured image attached.
- Once verified, toggle the workflow to Active for production use.
Common Gotchas
- WordPress credentials can expire or need specific permissions. If things break, check your WordPress Application Password and the user role capabilities first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- OpenAI prompts ship generic by default. Add your brand voice early in the “Generate Outline and Title” and “Compose Chapter Text” prompts or you will be editing every draft the same way.
Frequently Asked Questions
About 30 minutes if your OpenAI and WordPress credentials are ready.
No. You’ll mostly connect accounts and edit a few fields like your WordPress URL and the AI prompts.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API costs for ChatGPT and DALL·E usage.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and you should. Update the prompts in “Generate Outline and Title” and “Compose Chapter Text” to include your tone, reading level, and formatting rules. Common tweaks include adding a standard intro formula, forcing H2/H3 naming patterns, and inserting a CTA paragraph before the conclusion.
Usually it’s an Application Password issue, not your normal login password. Regenerate the WordPress Application Password, then update the credential in n8n and rerun a test submission. Also check that the WordPress user can upload media, because the featured image upload uses WordPress endpoints and can fail even when post creation works. If you’re behind a security plugin, it may block XML-RPC or REST requests, so whitelist your n8n server IP.
A lot, but it depends on where you run n8n and how patient you are with generation time, because chapters are created independently.
For AI-heavy WordPress drafting, n8n is usually the better fit because you can branch, validate the AI output, and merge chapter items without paying extra for every small step. Self-hosting also matters: you can run higher volumes without worrying about task pricing. Zapier or Make can still be fine for simple “one prompt, one draft” flows, but they get clunky once you add multi-chapter generation and media upload logic. If you want, Talk to an automation expert and we’ll sanity-check the best approach for your volume and workflow.
Once this is set up, content creation stops being “start from scratch” every time. You get consistent WordPress drafts with images waiting for review, and your team can spend their energy on quality instead of copying, pasting, and uploading.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.