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
- n8n: Workflow automation platform.
- WordPress API: Fetch blog post content by Post ID.
- Google Sheets API: Track post IDs and publish status.
- OpenRouter AI: Generate social media captions tailored for each platform.
- OpenAI API: Create custom images for Instagram and Facebook/LinkedIn posts.
- Social Media APIs: Post directly to X (Twitter), Facebook, LinkedIn, Instagram using their official APIs.
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
- Fetch WordPress post content: Retrieves full blog content by Post ID.
- Generate captions: Uses OpenRouter AI to create custom text for X (Twitter), Facebook, LinkedIn, and Instagram, following each platform’s style rules.
- Parse AI output: Converts AI text into structured fields for each platform.
- Create images: OpenAI API generates images sized for Instagram (1024×1024) and Facebook/LinkedIn (1792×1024).
- Publish posts: Posts texts and images via social media APIs for each platform.
- 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
- Download the workflow JSON file using the Download button on this page.
- In the n8n editor, click “Import from File” and select the downloaded JSON.
- The workflow will appear in the editor, ready to configure.
Configure credentials and IDs
- Add or update API credentials for WordPress, Google Sheets, OpenRouter, OpenAI, and social media APIs (X, Facebook, LinkedIn, Instagram).
- In the Google Sheets node, confirm the correct spreadsheet ID and sheet name are used.
- Make sure the Google Sheets document has the WordPress Post IDs in the right column for input.
- If needed, update page or account IDs for social platforms in respective nodes.
Test the workflow
- Click the manual trigger button in the Webhook node to run the workflow once.
- Check if the post content is retrieved, AI captions generated, images created, and posts published on social media.
- Confirm that Google Sheets update the status columns properly.
Activate the workflow
- Once tested, switch the workflow to Active in the n8n UI.
- 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.
