Category: Automations › Social Media & Content · Best for: Content teams · Platform: n8n · Steps: 9
What it does
The AI writes blog posts and publishes them on your WordPress site.
- ChatGPT generates full-length articles with structured headings.
Works with: OpenAI, Google Sheets, WordPress
What you get
- The n8n workflow file (
workflow.json), ready to import - This setup guide
- The list of fields to change for your own accounts (see Install below)
- Email support if you get stuck
Before you start
-
An n8n account. Easiest: n8n Cloud (free trial). Self-host for free with Docker:
docker run -it --rm -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n, then open http://localhost:5678. -
Accounts and API keys for these services:
- WordPress application password: how to connect (used by Create posts on Wordpress)
- Google (Sheets, Gmail, Drive, Calendar, Docs): how to connect (used by Save to Sheet)
- OpenAI API key: how to connect (used by Generate AI Content)
Install
- In n8n, click Create workflow (top right).
- Click the ⋯ menu → Import from file and choose
workflow.json. Or open the file, copy everything and paste it onto the empty canvas with Ctrl/Cmd + V. - Open each node with a red warning triangle and pick or create the matching credential from the list above.
- Point these fields at your own sheets, chats and accounts:
- Save to Sheet →
sheetName: choose your own - Save to Sheet →
documentId: choose your own - Automated Image Retrieval from Pexels →
Authorization: replace the placeholder with your own
- Save to Sheet →
- Click Save.
Test it
- Click Test workflow (or Execute workflow). 1. Auto Start starts it. Trigger it once with real sample data.
- Click each node to check its output. A green tick means the step worked.
- Fix any red node: it's almost always a credential or a field that still points at a sheet or chat that isn't yours.
Go live
Toggle Active (top right). From now on it runs on its own. Check Executions in the left sidebar to see every run.
How it works, step by step
- 1. Auto Start starts the workflow (Schedule).
- 2. When clicking ‘Test workflow’ starts the workflow (Manual).
- 3. Schedule Your Posts starts the workflow (Schedule).
- Processing Delay reshapes the data for the next step.
- Random Wait pauses before continuing.
- Generate AI Content uses AI (OpenAI).
- Save to Sheet uses Google Sheets to append.
- Automated Image Retrieval from Pexels calls an external API (=https://api.pexels.com/v1/search?per_page=1&orientation=lan).
- Create posts on Wordpress uses WordPress.
Extra setup notes
These notes are also on the canvas as yellow sticky notes:
Automated Article Scheduling
1. Fast Bulk Article Generation Quickly create multiple AI-generated articles. Efficiently streamline content creation. Reduces manual effort while maintaining quality.
2. Workflow Testing Before Execution Manually test the workflow for debugging. Ensure each step runs as expected. Optimize before full automation.
3. Automated & Randomized Publishing Schedule posts at predefined intervals. Introduce random delays for a natural posting pattern. Prevents overly predictable publishing behavior.
AI Content Generating
**Automatic Content & Keyword Generation
- Use your own prompt to start
- ChatGPT generates full-length articles with structured headings.
- Extracts relevant image search keywords for visual enhancement.
- To implement this, add the following prompt (green note) below your workflow:
(YOUR PROMPT)
Image Search Keywords (For Visual Alignment)
- Automatically generates 3-5 English keywords for image searches based on the article content.
- Keywords should be specific objects, locations, or atmospheres rather than abstract concepts.
Article Formatting Requirements
1⃣ Title (H1): Ensure unique and trend-driven headlines. 2⃣ H2 / H3 Subheadings: Structure content in an SEO-optimized format. 3⃣ Article Structure (Enhanced Readability)
** Introduction **
- Go straight to the point, avoiding excessive background.
- Use question hooks or market trend data to engage readers.
** Core Content **
- Include at least three knowledge points to ensure depth.
- Balance short and long sentences for better flow.
** Conclusion **
- Avoid generic AI-style summaries; instead, provide insights or actionable takeaways.
- Optionally include a CTA (Call to Action).
** HTML Formatting ** Ensure the article is properly structured in HTML format:
- Headings: Use <h1>, <h2>, <h3> appropriately.
- Paragraphs: Enclose text within <p>.
- Emphasized Words: Use <strong> to highlight key terms.
- Lists: Use <ul> and <li> for bullet points.
Ensure a clean, well-structured output instead of plain text.
**Final JSON Format
Ensure the output follows this structure:
{ "title": "{Generate an H1 title that aligns with market trends, ensures high click-through rates, and follows keyword strategy}", "content": "{Generate a complete HTML article including H1, H2, H3 headings, paragraphs, lists, etc.}", "keywords": ["{Image search keyword 1}", "{Image search keyword 2}", "{Image search keyword 3}", "{Image search keyword 4}", "{Image search keyword 5}"] }
Google Sheet Setting
You need to set up these in your sheet column
- title
- content
- image search keyword
Mapping "Values to Send"
- {{ $json.message.content.title }}
- {{ $json.message.content.content }}
- {{ $json.message.content.keywords.join("+") }}
Introduction: WordPress automatically publishes posts and inserts the first image
It is highly recommended to install the Featured Image from URL (FIFU) plugin and enable:
Auto > Set Featured Media Automatically from Content. before you generate contents.
Add your API credential
Add your API credential
Add your API credential
Troubleshooting
- "Credentials not found": open the node and select your credential again.
- Google "access blocked": in Google Cloud, add your email as a test user on the OAuth consent screen.
- Webhook not firing: copy the node's Production URL (not Test URL) into the other app, and make sure the workflow is Active.
- AI node errors: check your API key has billing enabled and the model name exists on your plan.
- Nothing happens on schedule: the workflow must be Active, and self-hosted n8n must stay running.
Need help?
Reply to your Morning Method order email and we'll help you get it running.
© Morning Method