Category: Automations › Social Media & Content · Best for: Businesses with a WordPress blog · Platform: n8n · Steps: 16
What it does
Every new blog post is shared on your social media automatically.
Get the Post ID of the Wordpress article on which you want to generate the caption for social media
Works with: AI Chat Model: OpenRouter, Output Parser Structured, Google Sheets, Chain Llm, WordPress, OpenAI, Twitter, WhatsApp Cloud API, LinkedIn, Facebook
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:
- Google (Sheets, Gmail, Drive, Calendar, Docs): how to connect (used by Google Sheets, Linkedin OK, Facebook Ok, Instagram OK, X OK)
- openRouterApi: how to connect (used by OpenRouter Chat Model)
- OpenAI API key: how to connect (used by Image Instagram, Image Facebook e Linkedin)
- WordPress application password: how to connect (used by Get Post)
- X (Twitter) developer app: how to connect (used by Publish on X)
- LinkedIn app: how to connect (used by Publish on LinkedIn)
- Meta / Facebook Graph API: how to connect (used by Publish on Facebook, Publish on Instagram)
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:
- Google Sheets →
sheetName: choose your own - Google Sheets →
documentId: choose your own - Linkedin OK →
sheetName: choose your own - Linkedin OK →
documentId: choose your own - Facebook Ok →
sheetName: choose your own - Facebook Ok →
documentId: choose your own - Instagram OK →
sheetName: choose your own - Instagram OK →
documentId: choose your own - X OK →
sheetName: choose your own - X OK →
documentId: choose your own - Publish on LinkedIn →
organization: replace the placeholder with your own
- Google Sheets →
- Click Save.
Test it
- Click Test workflow (or Execute workflow). When clicking ‘Test workflow’ 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
- When clicking ‘Test workflow’ starts the workflow (Manual).
- OpenRouter Chat Model uses AI (AI Chat Model: OpenRouter).
- Structured Output Parser uses AI (Output Parser Structured).
- Google Sheets uses Google Sheets.
- Social Media Manager uses AI (Chain Llm).
- Get Post uses WordPress to get.
- Image Instagram uses AI (OpenAI).
- Image Facebook e Linkedin uses AI (OpenAI).
- Publish on X uses Twitter.
- Publish on Instagram calls an external API (https://graph.facebook.com/v20.0/433770813646235/media).
- Publish on LinkedIn uses LinkedIn.
- Publish on Facebook uses Facebook.
- X OK uses Google Sheets to update.
- Instagram OK uses Google Sheets to update.
- Linkedin OK uses Google Sheets to update.
- Facebook Ok uses Google Sheets to update.
Extra setup notes
These notes are also on the canvas as yellow sticky notes:
Get the Post ID of the Wordpress article on which you want to generate the caption for social media
The SMM Chain analyses the content of the post and creates the most suitable caption based on the destination social network.
STEP 1
This workflow automates the process of creating and publishing social media posts across multiple platforms (Twitter/X, Facebook, LinkedIn, and Instagram) based on content from a WordPress post. It uses AI models to generate platform-specific captions and images, and integrates with Google Sheets, WordPress, and various social media APIs.
Get the API Keys of the social networks you want to publish on
Authenticate on social media nodes with the access tokens obtained
STEP 2
Clone this Sheet and set ONLY the WordPress Post ID id in the right column
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