Automate Blog Writing and Publishing with n8n and OpenAI

Discover how this n8n workflow automates blog content creation and publishing for WordPress using Google Sheets and OpenAI. Save hours by streamlining your editorial process with automated content generation, scheduling, and posting via XML-RPC.
set
googleSheets
lmChatOpenAi
+7
Workflow Identifier: 1067
NODES in Use: set, scheduleTrigger, manualTrigger, googleSheets, code, lmChatOpenAi, if, chainLlm, httpRequest, stickyNote
Automate blog writing with n8n and OpenAI

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Automation Does ⚙️

This workflow reads blog post plans from Google Sheets.

It writes blog posts using OpenAI.

Then it publishes posts to WordPress automatically.

It also updates the sheet with what happened.

This saves lots of manual work and avoids mistakes.


Who Should Use This Workflow

If you manage blog posts often and feel stuck with manual copying or delays, this workflow can help.

It is good for content managers who want less busy work.

You don’t need to be a tech expert to run it.


Tools Used in This Workflow

  • n8n Automation Platform: Runs the workflow nodes.
  • Google Sheets: Stores blog schedules and prompts.
  • OpenAI API: Generates blog content from prompts.
  • WordPress XML-RPC: Publishes posts automatically.

Workflow Inputs, Processing, and Outputs

Inputs

  • Blog post schedule rows from Google Sheets.
  • Configured prompt templates and model settings from Config sheet.
  • Current date and time to check publishing triggers.
  • Authentication data for Google Sheets, OpenAI, and WordPress.

Processing Steps

  • Load schedule and config data from sheets.
  • Replace placeholders in prompts using schedule data.
  • Check if action is needed based on status and schedule.
  • Send prompt to OpenAI to create blog content.
  • Clean and merge AI output back into row data.
  • Prepare XML payload and send to WordPress for posting.
  • Parse WordPress response to confirm publishing.
  • Update Google Sheets with status and logs.

Outputs

  • Published blog posts on WordPress.
  • Updated Google Sheets status fields showing completed or errors.
  • Logs with timestamps for auditing workflow runs.

Beginner Step-by-Step: How to Use This Workflow in n8n

1. Download and Import the Workflow

  1. Click the Download button on this page to get the workflow file.
  2. Open n8n editor where you want to run this automation.
  3. Use “Import from File” option to load the workflow JSON.

2. Configure Credentials and Settings

  1. Add Google Sheets OAuth2 credentials in n8n credentials manager.
  2. Add your OpenAI API Key or compatible OpenRouter credentials.
  3. Add WordPress username and application password in the Settings node.
  4. Update spreadsheet URL, sheet names, and WordPress site URL in the Settings node.
  5. If needed, update prompt templates or model names in the Config sheet.

3. Test and Activate

  1. Trigger the workflow with the ManualTrigger node for an initial test run.
  2. Check Google Sheets for updates and WordPress for created posts.
  3. Fix errors if any appear, then activate the workflow.
  4. The ScheduleTrigger will run automatically according to your set time.
  5. Monitor logs inside Google Sheets for workflow status and issues.

If self-hosting n8n, consider self-host n8n for better control.


Customization Ideas ✏️

  • Change the publish action word in Settings node to trigger different actions.
  • Use other language models by changing model names in Config sheet.
  • Add more placeholders in the PreparedData code node for dynamic data.
  • Update WordPress URL if using a custom domain.
  • Adjust how often the ScheduleTrigger runs to fit publishing needs.

Troubleshooting 🔧

  • Google Sheets shows empty or auth error: Re-add Google OAuth credentials in n8n and check spreadsheet access.
  • AI returns wrong or empty content: Verify prompts exist and match action names in Config sheet.
  • WordPress publish fails with XML-RPC errors: Check username and app password, correct URL, and XML escaping code.

Pre-Production Checklist ✅

  • Confirm spreadsheet URLs and tab names in Settings are correct.
  • Test Google Sheets and OpenAI credentials to ensure connection.
  • Run the workflow manually through the ManualTrigger node to check functionality.
  • Validate schedule sheet has future dates and correct actions set.
  • Make sure XML-RPC publishing is enabled on WordPress with a valid application password.
  • Backup spreadsheet data regularly to avoid loss on updates.

Deployment Guide

Switch the workflow from inactive to active inside n8n editor.

The ScheduleTrigger node will check hourly for posts to publish.

Watch your Google Sheets log tabs for status and any errors.

Use the ManualTrigger node anytime for urgent runs or tests.


Summary of Results

✓ Save 4-6 hours per week on manual blog tasks.

✓ Reduce manual mistakes by about 90%.

✓ Automate writing, publishing, and logging blog posts.

✓ Get clear audit logs in Google Sheets.

✓ Focus time freed for content strategy and creativity.


Automate blog writing with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Go to Credentials in n8n, choose Google Sheets OAuth2, then follow prompts to link your account.
Missing or wrong prompt templates in the Config sheet usually cause empty or irrelevant AI output.
Check WordPress username, application password, correct endpoint URL, and XML escaping code in the workflow.
Yes, import and run the workflow on self-hosted n8n with proper credential setup.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.