Automate AI Social Media Publishing from WordPress with n8n

Struggling to craft engaging, platform-tailored social media posts from your WordPress content? This unique n8n workflow leverages AI to generate customized captions and images, automating publishing across Twitter (X), Facebook, LinkedIn, and Instagram, saving hours of manual work with precision and consistency.
manualTrigger
googleSheets
wordpress
+7
Workflow Identifier: 1121
NODES in Use: ManualTrigger, GoogleSheets, Wordpress, Langchain LM Chat OpenRouter, Langchain Output Parser Structured, Langchain OpenAI, Twitter, LinkedIn, FacebookGraphApi, HttpRequest
Automate social media posts with n8n and OpenAI

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

Learn how to Build this Workflow with AI:

What this workflow does

This workflow connects WordPress blog posts to social media platforms and automatically creates and posts content with images for Twitter (X), Facebook, LinkedIn, and Instagram.

It solves the problem of manually writing and scheduling posts for each platform.

The result is saving time, avoiding mistakes, and keeping content consistent across all social media accounts.


Who should use this workflow

People managing social media for companies or blogs who want to automate posting new blog content to multiple platforms.

This is useful if manual reposting is slow, prone to errors, or inconsistent in style.


Tools and services used

This setup requires having API keys or tokens for all services mentioned.


How this workflow works (Input → Process → Output)

Inputs

The main input is a WordPress Post ID, stored in a Google Sheets document.

The workflow gets this ID from the sheet to know which blog post to use.

Processing Steps

  1. Fetch WordPress post content: Retrieves full blog content by Post ID.
  2. Generate captions: Uses OpenRouter AI to create custom text for X (Twitter), Facebook, LinkedIn, and Instagram, following each platform’s style rules.
  3. Parse AI output: Converts AI text into structured fields for each platform.
  4. Create images: OpenAI API generates images sized for Instagram (1024×1024) and Facebook/LinkedIn (1792×1024).
  5. Publish posts: Posts texts and images via social media APIs for each platform.
  6. Update status: Flags each platform’s column in Google Sheets to show post was published.

Output

All social media posts with images go live automatically.

The Google Sheets document shows which posts are published per platform.


Beginner step-by-step: How to build this in n8n

Import the workflow

  1. Download the workflow JSON file using the Download button on this page.
  2. In the n8n editor, click “Import from File” and select the downloaded JSON.
  3. The workflow will appear in the editor, ready to configure.

Configure credentials and IDs

  1. Add or update API credentials for WordPress, Google Sheets, OpenRouter, OpenAI, and social media APIs (X, Facebook, LinkedIn, Instagram).
  2. In the Google Sheets node, confirm the correct spreadsheet ID and sheet name are used.
  3. Make sure the Google Sheets document has the WordPress Post IDs in the right column for input.
  4. If needed, update page or account IDs for social platforms in respective nodes.

Test the workflow

  1. Click the manual trigger button in the Webhook node to run the workflow once.
  2. Check if the post content is retrieved, AI captions generated, images created, and posts published on social media.
  3. Confirm that Google Sheets update the status columns properly.

Activate the workflow

  1. Once tested, switch the workflow to Active in the n8n UI.
  2. Optionally, set up a scheduled trigger or webhook to run automatically when new WordPress posts appear.

If preferred, consider self-host n8n for more control and privacy.


Common problems and edge cases

  • Google Sheets API errors: Caused by wrong Post IDs, missing permissions, or exceeding API limits.
  • WordPress fetch fails: Happens when the Post ID is wrong or API credentials are revoked.
  • AI output empty or malformed: Often from incorrect prompt setup or expired OpenRouter API key.
  • Social media posts fail to publish: Usually due to expired or revoked API tokens, missing permissions, or API changes.

Check API keys, sheet permissions, and correct IDs to fix these issues.


Ideas to customize this workflow

  • Change AI prompts or switch to another supported AI model to adjust text style.
  • Add more social networks by adding relevant nodes and expanding AI prompts.
  • Modify image dimensions or prompts in the OpenAI image generation nodes for different visuals.
  • Replace manual trigger with webhook or cron to automate running when new WordPress posts are published.
  • Use different Google Sheets columns to store extra metadata or track more details.

Summary of results

✓ Time saved by automating social media posting from WordPress blogs.

✓ Reduced errors and consistent brand voice across platforms.

→ Automatic image and text creation designed for each social network’s format.

→ Google Sheets logging helps track publishing status clearly.


Automate social media posts with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes, the OpenRouter Chat Model node can be replaced with another compatible AI model supported by n8n.
Check API keys for expiry, permissions in the social media apps, and update credentials in n8n if needed.
No, self-hosting is optional. The workflow can run on the n8n cloud or any setup, but self-hosting offers more control.
Google Sheets tracks WordPress Post IDs as input and updates columns after each social media post to show publishing status.

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.