Content · n8n

Auto-Generate Blog Drafts with OpenAI and Publish to Ghost in One Click

Enter a blog topic and let OpenAI write a full draft, then automatically save it as a Ghost CMS draft ready for your review. No coding needed — just fill in a topic and get a publish-ready post in seconds.

difficulty Beginnersetup 30 minresult A complete AI-written blog post draft appears in your Ghost CMS every time you trigger the workflow with a topic.
  1. 1

    Set your blog topic with a Manual Trigger

    Add a Manual Trigger node as the starting point. In the node settings add a field called topic using the Add Field option, then type your desired blog topic (e.g. '10 tips for remote productivity'). This lets you kick off the workflow on demand and pass a custom topic each time.

  2. 2

    Generate the blog post title using OpenAI

    Add an OpenAI node connected to the trigger. Set Resource to Text and Operation to Message a Model. In the Model field choose gpt-4o-mini. In the Messages section set the user message to: Write a catchy SEO blog post title about: {{ $json.topic }}. This call returns a clean title for your post.

  3. 3

    Generate the full blog body using OpenAI

    Add a second OpenAI node connected to the first. Use the same model settings. Set the user message to: Write a detailed 600-word HTML blog post about: {{ $('Manual Trigger').item.json.topic }}. Use proper HTML tags like h2, p, and ul. Do not include a title tag.. This produces formatted HTML content ready for Ghost.

  4. 4

    Combine title and content with a Set node

    Add a Set node to merge the outputs into clean fields. Create two string fields: postTitle mapped to {{ $('OpenAI').item.json.message.content }} (from the first OpenAI node) and postHTML mapped to {{ $json.message.content }} (from the second OpenAI node). This prepares the data for the Ghost API call.

  5. 5

    Create a draft post in Ghost CMS

    Add a Ghost node connected to the Set node. Set Resource to Post and Operation to Create. Map Title to {{ $json.postTitle }} and HTML to {{ $json.postHTML }}. Set Status to draft. In the node credentials, enter your Ghost Admin API URL and Admin API Key from your Ghost settings under Integrations. Click Execute — your draft appears in Ghost instantly.

Frequently asked questions

Where do I find my Ghost Admin API key?

Log into your Ghost admin panel, go to Settings > Integrations, then click 'Add custom integration'. Give it a name like 'n8n' and copy the Admin API Key and API URL shown there. Paste these into the Ghost node credentials in n8n.

Can I change the length or style of the blog post?

Yes — simply edit the prompt in the second OpenAI node. You can specify a different word count, tone (e.g. 'conversational' or 'formal'), target audience, or structure. No other changes to the workflow are needed.

Will this publish the post live or just save a draft?

The workflow saves the post as a draft so you can review and edit it before publishing. To auto-publish instead, change the `Status` field in the Ghost node from `draft` to `published`, but we recommend reviewing AI content before it goes live.

About this recipe. Recipes on FlowRecipesHub are written for business owners, not developers, and are tested before publishing — how recipes get made. Some ingredient links are affiliate links that cost you nothing — full disclosure.