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.
- 1
Set your blog topic with a Manual Trigger
Add a
Manual Triggernode as the starting point. In the node settings add a field calledtopicusing theAdd Fieldoption, 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
Generate the blog post title using OpenAI
Add an
OpenAInode connected to the trigger. SetResourcetoTextandOperationtoMessage a Model. In theModelfield choosegpt-4o-mini. In theMessagessection 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
Generate the full blog body using OpenAI
Add a second
OpenAInode 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
Combine title and content with a Set node
Add a
Setnode to merge the outputs into clean fields. Create two string fields:postTitlemapped to{{ $('OpenAI').item.json.message.content }}(from the first OpenAI node) andpostHTMLmapped to{{ $json.message.content }}(from the second OpenAI node). This prepares the data for the Ghost API call. - 5
Create a draft post in Ghost CMS
Add a
Ghostnode connected to the Set node. SetResourcetoPostandOperationtoCreate. MapTitleto{{ $json.postTitle }}andHTMLto{{ $json.postHTML }}. SetStatustodraft. 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.