What This Automation Does
This workflow takes latest 3 blog posts from a Ghost blog and turns them into LinkedIn posts automatically.
It solves how time-consuming it is to write LinkedIn promotions by hand.
The result is professional LinkedIn messages ready for sharing, saved into Google Sheets for tracking.
Tools and Services Used
- Ghost Blog API: Fetches latest blog posts.
- OpenAI Chat Model (GPT 4o-mini) via LangChain: Creates LinkedIn text from blog content.
- Google Sheets API: Records post data and generated LinkedIn messages.
- n8n: Workflow automation platform hosting this process.
Inputs → Processing Steps → Output
Inputs
- Ghost Admin API Key and blog URL
- OpenAI API Key for ChatGPT model
- Google Sheets API credentials and target sheet information
Processing Steps
- Trigger manually through Manual Trigger node.
- Extract Blog Posts node gets latest 3 posts from Ghost API.
- Extract Post Content Set node maps fields: id, title, content, excerpt, featured image, link.
- Loop Over Posts SplitInBatches node processes posts one by one.
- Clean HTML Code node removes HTML tags and extra spaces from content.
- Add Clean HTML Merge node combines cleaned text with original metadata.
- AI Agent node crafts LinkedIn post text using dynamic blog data.
- Merge Linkedin node combines AI text with metadata.
- Record the posts Google Sheets node appends all results to the sheet.
Output
- Google Sheet filled with rows containing blog post info plus AI-generated LinkedIn post text.
- Consistent, professional social post texts ready for publishing.
Beginner Step-by-Step: How to Use This Workflow in n8n
Import the Workflow
- Download the workflow file using the Download button on this page.
- Open the n8n editor.
- Use the Import from File feature to add the downloaded workflow.
Configure Credentials and Settings
- Add Ghost API credentials with the correct Admin API key and blog URL.
- Set OpenAI API Key for the Chat Model node, using GPT 4o-mini model.
- Configure Google Sheets credentials and select the spreadsheet and worksheet to append data.
- Update any IDs, emails, channels, folders, or table names if required.
- Copy any code or prompt text from the AI Agent node input for reference if needed.
Test and Activate Workflow
- Run the workflow manually by clicking “Execute Workflow” in the editor.
- Review each node for successful execution and no errors.
- If tests pass, activate the workflow by toggling it to active.
You may want to schedule the workflow or add triggers for automation.
Consider using self-host n8n for better control over workflows.
Customizations
- Change the Ghost node Limit parameter to fetch more or fewer blog posts.
- Edit the AI Agent node prompt in systemMessage to adjust tone, signature, or messaging style.
- Add more metadata fields like tags or categories in the Extract Post Content Set node and update Google Sheets mapping.
- Switch to different AI models (newer GPT, Claude, Grok) by updating the OpenAI Chat Model node’s model.
Troubleshooting
- Ghost API returns empty array
Cause: Wrong or expired API key or wrong blog URL.
Fix: Check Ghost Admin API key, URL; test API with tools like Postman. - AI Agent returns no output or error
Cause: Invalid OpenAI API key, exceeded quota, or bad prompt.
Fix: Verify OpenAI key, ensure prompt uses correct expressions. - Google Sheets append fails
Cause: No write permission or incorrect sheet ID.
Fix: Reauthorize Google credentials, confirm spreadsheet ID and worksheet name.
Pre-Production Checklist
- Confirm Ghost, OpenAI, and Google Sheets API credentials work.
- Test Ghost API connection alone to ensure posts retrieval.
- Run full workflow manually and check Google Sheet rows.
- Read AI output for good format and tone.
- Backup Google Sheets data before mass inserts.
Deployment Guide
After successful tests, activate the workflow for automatic runs.
Setup error notifications in n8n for key nodes to catch any failures.
Consider scheduling or connecting with triggers for ongoing use.
If using self-host n8n, find help about setup here.
Summary
✓ Saves hours by automating LinkedIn post creation from Ghost blogs.
✓ Produces consistent, professional LinkedIn messages linked to full articles.
✓ Stores data and posts in Google Sheets for tracking.
✓ Easy to import, configure, and run in n8n for content marketers.
