How to Automatically Share Your Ghost Blog Posts on LinkedIn, Twitter, and Facebook with N8N

Date

Date

Date

November 11, 2025

November 11, 2025

November 11, 2025

Author

Author

Author

Lisa Zhao

Lisa Zhao

Lisa Zhao

Ever published a blog post and then had to manually copy-paste it to LinkedIn, Twitter, and Facebook? It's tedious and time-consuming. In this guide, I'll show you how I set up automatic posting so that every time I publish a blog post on Ghost, it instantly shares to all my social media accounts. No manual work required!

What You'll Learn:

  • How to connect Ghost to N8N (an automation tool)

  • How to automatically post to LinkedIn when you publish a blog

  • How to format posts differently for each platform

  • How to include images in your social media posts

What You'll Need:

  • A Ghost blog (self hosted on your server, preferably)

  • N8N installed (self-hosted or cloud)

  • Social media accounts (LinkedIn, Twitter, Facebook)

Time Required: About 1-2 hours for initial setup

What is N8N?

N8N is like a digital assembly line for your data. Think of it as connecting building blocks together:

  • Block 1: Ghost publishes a post

  • Block 2: Format the post for social media

  • Block 3: Post to LinkedIn

  • Block 4: Post to Twitter

  • Block 5: Post to Facebook

Each "block" is called a node, and connecting them creates a workflow.

Part 1: Setting Up the Foundation

Step 1: Create Your First Workflow in N8N

  1. Open N8N in your browser

  2. Click the "+" button or "Add Workflow"

  3. Name it something like "Ghost to Social Media"

  4. You'll see a blank canvas - this is where we build!

Step 2: Add the Ghost Webhook (The Starting Point)

A webhook is like a doorbell. When someone (Ghost) rings it, something happens (your workflow runs).

How to Set It Up:

  1. In your blank N8N workflow, click the "+" button

  2. Search for "Webhook"

  3. Click on it to add it to your canvas

  4. Configure these settings:

    • HTTP Method: POST (this is how Ghost sends data)

    • Path: Leave it as the auto-generated code (looks like abc123def456)

    • Authentication: None

    • Respond: "When Last Node Finishes"

  5. Activate your workflow (toggle switch at top right - make it green!)

  6. Click on the webhook node

  7. Click the "Production URL" tab

  8. Copy this URL - you'll need it in the next step

Important: The Production URL (without -test) only works when your workflow is activated (green toggle).

Step 3: Connect Ghost to Your Webhook

Now we tell Ghost to "ring the doorbell" when you publish a post.

In Ghost Admin:

  1. Go to SettingsIntegrations

  2. Click "Add custom integration"

  3. Name it "N8N Blog Automation" (or whatever you like)

  4. Ghost will create API keys - you'll need these later

  5. Scroll down to Webhooks section

  6. Click "Add webhook"

  7. Configure:

    • Name: "Post Published"

    • Event: Post published (very important!)

    • Target URL: Paste your N8N Production URL

  8. Click "Create webhook"

Test It: Publish a test post in Ghost. Go back to N8N and click the "Executions" tab. You should see a new execution appear! If not, check that your workflow is activated.

Part 2: Formatting Your Posts for Social Media

Different platforms have different vibes:

  • LinkedIn: Professional, longer posts

  • Twitter: Short and sweet (280 characters)

  • Facebook: Casual and engaging

Let's create custom text for each platform.

Step 4: Add a Code Node to Format Posts

  1. In N8N, click the "+" after your Webhook node

  2. Search for "Code"

  3. Add it and name it "Format Social Posts"

  4. Paste this code:

// Get the blog post data from Ghost
const post = $input.first().json.body.post.current;

// Extract the important pieces
const title = post.title || 'Untitled Post';
const url = post.url || '';
const excerpt = post.excerpt || post.custom_excerpt || '';
const featuredImage = post.feature_image || '';

// Make sure URLs are complete
const validUrl = url.startsWith('http') ? url : `https://yourdomain.com${url}`;
const validFeaturedImage = featuredImage.startsWith('http') ? featuredImage : 
                           (featuredImage ? `https://yourdomain.com${featuredImage}` : '');

// Create a shorter version for Twitter
const shortExcerpt = excerpt.length > 200 ? excerpt.substring(0, 200) + '...' : excerpt;

// LinkedIn: Professional tone
const linkedInText = `📝 New Article: ${title}

${excerpt}

Read more: ${validUrl}

#blog #content`;

// Twitter: Short and sweet
const twitterText = `${title}

${shortExcerpt}

${validUrl}`;

// Facebook: Friendly and engaging
const facebookText = `🎉 Just published: ${title}

${excerpt}

Check it out: ${validUrl}`;

// Package everything up for the next nodes
return [{
  json: {
    title: title,
    url: validUrl,
    excerpt: excerpt,
    featured_image: validFeaturedImage,
    twitter_text: twitterText,
    linkedin_text: linkedInText,
    facebook_text: facebookText
  }
}];

Replace yourdomain.com with your actual Ghost domain!

What This Code Does:

  • Takes your blog post data from Ghost

  • Creates three different versions of the post

  • Adds emojis and hashtags

  • Makes sure URLs work properly

Part 3: Setting Up LinkedIn Posting

Step 5: Create a LinkedIn App

Before N8N can post to LinkedIn, you need to give it permission. This requires creating a "LinkedIn App."

In LinkedIn:

  1. Go to https://www.linkedin.com/developers/apps

  2. Click "Create app"

  3. Fill in:

    • App name: "Blog Automation" (or similar)

    • LinkedIn Page: Select your personal profile or company page

    • App logo: Upload any image

  4. Check the legal agreement box

  5. Click "Create app"

  6. After creation, go to "Products" tab

  7. Request access to:

    • "Share on LinkedIn"

    • "Sign In with LinkedIn using OpenID Connect"

  8. These are usually approved instantly

  9. Go to "Auth" tab

  10. Under "OAuth 2.0 settings", find "Redirect URLs"

  11. Add: https://your-n8n-domain.com/rest/oauth2-credential/callback

    • Replace with your actual N8N URL

  12. Copy your Client ID and Client Secret - you'll need these

Important Note: To post to a company page (not your personal profile), you need additional approval from LinkedIn for "Community Management API." This can take days. For now, posting to your personal profile works immediately and still promotes your business!

Step 6: Add LinkedIn Node in N8N

  1. In N8N, click "+" after your "Format Social Posts" node

  2. Search for "LinkedIn"

  3. Add it

  4. Click "Create New Credential"

  5. Enter:

    • Client ID: From LinkedIn app

    • Client Secret: From LinkedIn app

  6. Click "Connect" or "Sign in with LinkedIn"

  7. A popup opens - log into LinkedIn and authorize

  8. The popup closes and you're connected!

Configure the LinkedIn Node:

  • Resource: Post

  • Operation: Create

  • Post As: Person (use "Organization" only if you have Community Management API approved)

  • Text: {{ $json.linkedin_text }}

  • Visibility: Public

Step 7: Add Images to LinkedIn Posts

To include your blog's featured image:

  1. Add HTTP Request node between "Format Social Posts" and "LinkedIn"

  2. Configure HTTP Request:

    • Method: GET

    • URL: {{ $json.featured_image }}

    • Options → Add "Response Format" → Select "File"

    • Options → Add "Put Output in Field" → Type "data"

  3. In LinkedIn node, scroll to Additional Fields

  4. Click "Add Field" → Select "Media Category" → Choose "Image"

  5. Input Binary Field: Leave as "data"

Your workflow now looks like:

The HTTP Request downloads the image, and LinkedIn posts it!

Part 4: Adding Twitter and Facebook (Optional)

The process is similar for Twitter and Facebook. Here's the overview:

For Twitter:

  1. Go to https://developer.twitter.com/en/portal/dashboard

  2. Create an app and get API credentials

  3. In N8N, add a Twitter node

  4. Connect with your credentials

  5. Configure:

    • Operation: Create a Tweet

    • Text: {{ $json.twitter_text }}

For Facebook:

  1. Go to https://developers.facebook.com/apps

  2. Create an app and get credentials

  3. In N8N, add a Facebook Graph API node

  4. Connect and authorize

  5. Configure:

    • Resource: Post

    • Operation: Create

    • Message: {{ $json.facebook_text }}

Pro Tip: Connect all social media nodes in parallel from "Format Social Posts" so they all post at the same time!

Part 5: Testing Your Automation

Final Workflow Structure

[Ghost Webhook][Format Social Posts][HTTP Request - Download Image]
      ↓
  ┌───┴───┬─────────┐
  ↓       ↓         ↓
[LinkedIn] [Twitter] [Facebook]

How to Test:

  1. Make sure your workflow is Activated (green toggle!)

  2. Go to Ghost and publish a test blog post

  3. In N8N, click the "Executions" tab

  4. You should see a new execution with all green checkmarks

  5. Check your social media - your posts should be live!

Troubleshooting Common Issues

"Nothing here yet" in Executions

  • Problem: Webhook isn't triggering

  • Solution:

    • Check that workflow is activated (green toggle)

    • Verify Ghost has the correct Production URL (not Test URL)

    • Make sure you're using the webhook for "Post published" event

"Duplicate post detected" on LinkedIn

  • Problem: You already posted this exact content

  • Solution: LinkedIn blocks identical posts. Publish a NEW blog post or edit the title/content slightly

"Invalid URL" error

  • Problem: URLs are malformed

  • Solution: Check the "Format Social Posts" code and make sure you replaced yourdomain.com with your actual domain

LinkedIn won't connect

  • Problem: OAuth scope errors

  • Solution:

    • Make sure "Share on LinkedIn" product is approved in your LinkedIn app

    • For personal posting, use "Post As: Person"

    • For company page posting, you need "Community Management API" (requires approval)

Image won't upload

  • Problem: LinkedIn expects binary data

  • Solution: Make sure you added the HTTP Request node to download the image BEFORE the LinkedIn node

Advanced Tips

Customize Post Text by Platform

Edit the "Format Social Posts" code to add:

  • Hashtags specific to each platform

  • Emojis that match your brand

  • @mentions of your company account

  • Call-to-actions tailored to each audience

Add Conditional Logic

Want to only post certain types of content? Add an IF node:

  • Check if post has a specific tag (like "public" or "share")

  • Only continue to social media if tag exists

  • Otherwise, skip posting

Add Error Notifications

Add an Email node or Slack node that only runs if LinkedIn/Twitter/Facebook fail. This way you'll know immediately if something breaks.

Schedule Posts Instead

Instead of instant posting:

  • Add a Wait node to delay by a few hours

  • Or use a Schedule Trigger to post at optimal times

  • Combine with a database to queue posts

What I Learned

Setting up automation takes time upfront, but saves hours every week. Here are my key takeaways:

  1. Start simple: Get one platform working (like LinkedIn) before adding others

  2. Test extensively: Publish multiple test posts to catch edge cases

  3. Read error messages carefully: They usually tell you exactly what's wrong

  4. LinkedIn's API has restrictions: Posting to company pages requires special approval, but personal posts work great and still promote your business

  5. Images need special handling: URLs aren't enough - you need to download the image as binary data first

Conclusion

Congratulations! You now have a fully automated blog-to-social-media pipeline. Every time you hit "Publish" in Ghost, your content automatically shares across your social networks with platform-specific formatting and images.

Time saved per post: 10-15 minutes Posts per month: ~4-8 Annual time savings: 8-24 hours

That's a full workday (or more!) back in your schedule!

Next Steps

Now that you have the basics working, consider:

  • Adding Instagram posting (requires Facebook Business account)

  • Creating platform-specific image templates

  • Setting up analytics tracking

  • Building a dashboard to monitor post performance

  • Adding AI-generated social media captions

Happy automating!

Resources

  • N8N Documentation: https://docs.n8n.io

  • Ghost API Docs: https://ghost.org/docs/content-api/

  • LinkedIn Developer Portal: https://www.linkedin.com/developers/

  • Twitter API Docs: https://developer.twitter.com/en/docs

  • Facebook Graph API: https://developers.facebook.com/docs/graph-api

Note: API requirements and interfaces change over time. If something doesn't match this guide exactly, check the official documentation for the most current information.

Related posts

November 10, 2025

Compassionate Systems: Clear is Kind , Unclear is Unkind

Description

November 10, 2025

Compassionate Systems: Clear is Kind , Unclear is Unkind

Description

November 10, 2025

Compassionate Systems: Clear is Kind , Unclear is Unkind

Description

November 9, 2025

How I Used Claude to Build Custom Scripts (And Why You Should Too)

Description

November 9, 2025

How I Used Claude to Build Custom Scripts (And Why You Should Too)

Description

November 9, 2025

How I Used Claude to Build Custom Scripts (And Why You Should Too)

Description

Got questions?

I’m always excited to collaborate on innovative and exciting projects!

Got questions?

I’m always excited to collaborate on innovative and exciting projects!

Got questions?

I’m always excited to collaborate on innovative and exciting projects!

Lisa Zhao, 2025

XX

Lisa Zhao, 2025

XX

Lisa Zhao, 2025

XX