🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

OpenAI to WordPress, drafts with featured images

Lisa Granqvist Partner Workflow Automation Expert

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

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

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.

  1. Add and open Form Submission Trigger.
  2. Set Path to create-wordpress-post (under Options).
  3. Set Form Title to Create a WordPress post with AI and Form Description to Fill this form with the required information to create a draft post on WordPress.
  4. Configure fields: Keywords (comma-separated) (required), Number of chapters (dropdown with options 110, required), and Max words count (number, required).
  5. Set Response Mode to lastNode to return the final form response.

Step 2: Connect the Input Mapping

Map form inputs to standardized variables used across the workflow.

  1. Add Configure Inputs after Form Submission Trigger.
  2. Set wordpress_url to https://[YOUR_ID]/.
  3. Set keywords to {{ $json['Keywords (comma-separated)'] }}.
  4. Set chapters to {{ $json['Number of chapters'] }}.
  5. Set words to {{ $json['Max words count'] }}.

⚠️ Common Pitfall: Replace [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.

  1. Add Generate Outline and Title after Configure Inputs.
  2. Credential Required: Connect your openAiApi credentials.
  3. Confirm JSON Output is enabled and Model is gpt-4o-mini.
  4. Keep the prompt content as configured, including references to {{ $json.keywords }} and {{ $json.chapters.toString() }} so output includes title, subtitle, chapters, introduction, conclusions, and imagePrompt.
  5. 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.

Tip: If the outline is malformed, re-run with a smaller chapter count to reduce the model’s output complexity.

Step 4: Validate and Expand Chapters (Parallel Execution)

Validate AI output, then fan out chapters for processing.

  1. Add Validate Generated Data after Generate Outline and Title.
  2. Keep the validation checks for required fields using expressions like {{ $json.message.content.title }} and {{ $json.message.content.chapters }}.
  3. Connect the true output to Expand Chapter Items and the false output to Error Response Form.
  4. 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.

  1. 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) }}.
  2. Credential Required: Connect your openAiApi credentials to Compose Chapter Text.
  3. In Combine Chapter Content, set Mode to combine and Combine By to combineByPosition.
  4. In Assemble Article Body, keep the JavaScript that composes introduction, chapter titles, chapter content, and conclusions into a single article field.

Tip: If the article format renders incorrectly, check that the AI returns HTML (not Markdown) as specified in the prompts.

Step 6: Create the WordPress Draft

Send the compiled article to WordPress as a draft post.

  1. Add Create WordPress Draft after Assemble Article Body.
  2. Credential Required: Connect your wordpressApi credentials.
  3. Set Title to {{ $('Generate Outline and Title').first().json.message.content.title }}.
  4. Set Status to draft and 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.

  1. Open Create Cover Image after Create WordPress Draft and keep Resource set to image.
  2. Credential Required: Connect your openAiApi credentials.
  3. 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.
  4. In Upload Image Asset, set URL to https://[YOUR_ID]/wp-json/wp/v2/media and Method to POST, with Content Type set to binaryData and Input Data Field Name to data.
  5. Credential Required: Connect your wordpressApi credentials for Upload Image Asset.
  6. 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 }}.
  7. 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!.

⚠️ Common Pitfall: The media upload and featured image attach use [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.

  1. Open Error Response Form and keep Respond With set to showText.
  2. Set Response Text to There was a problem creating the article, please refresh the form and try again!.
  3. 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.

  1. Use Form Submission Trigger to open the form and submit test values for keywords, chapters, and word count.
  2. Verify a successful execution ends at Success Response Form and that the response message includes the created draft title.
  3. In WordPress, confirm a new draft post exists with the generated content and a featured image attached.
  4. Once verified, toggle the workflow to Active for production use.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

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

How long does it take to set up this OpenAI WordPress drafts automation?

About 30 minutes if your OpenAI and WordPress credentials are ready.

Do I need coding skills to automate OpenAI WordPress drafts?

No. You’ll mostly connect accounts and edit a few fields like your WordPress URL and the AI prompts.

Is n8n free to use for this OpenAI WordPress drafts workflow?

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.

Where can I host n8n to run this automation?

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.

Can I customize this OpenAI WordPress drafts workflow for a specific brand voice and section layout?

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.

Why is my WordPress connection failing in this workflow?

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.

How many drafts can this OpenAI WordPress drafts automation handle?

A lot, but it depends on where you run n8n and how patient you are with generation time, because chapters are created independently.

Is this OpenAI WordPress drafts automation better than using Zapier or Make?

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.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal