n8n + Ghost Integration: 5 Powerful Workflows for Publishers
The n8n Ghost integration provides a powerful way to automate your entire content creation and distribution process. If you run a publication on the Ghost platform, you know how much manual effort goes into managing subscribers, promoting posts, and handling content. By connecting Ghost's API to n8n, you can build event-driven workflows that handle these tasks automatically, saving you hours every week and ensuring your publication runs smoothly.
Connecting n8n and Ghost: The Foundation
Before building any workflows, you need to establish the connection between n8n and your Ghost site. This is done using Ghost's Admin API. The primary n8n node you'll use is the Ghost node, which can both trigger workflows and perform actions.
Here’s how to set it up:
- Create a Custom Integration in Ghost:
- Log in to your Ghost Admin panel.
- Go to Settings → Integrations.
- Click "Add custom integration."
- Give it a name, like "n8n Automation," and click Create.
- Copy Your API Credentials:
- Once created, you'll see two key values: the Admin API Key and the API URL.
- The Admin API Key is your password. Keep it secure.
- The API URL is the endpoint n8n will use to communicate with your site.
- Configure the Ghost Node in n8n:
- In your n8n workflow, add the
Ghostnode. - Click "Create New Credential."
- A dialog will appear. Paste the Admin API Key and API URL you copied from Ghost.
- Save the credential. Now you can use the Ghost node to interact with your site's posts, pages, and members.
- In your n8n workflow, add the
For trigger-based workflows, you can also use Ghost webhooks. Add a Webhook node in n8n to get a unique URL, then paste it into the "Target URL" field of a new webhook in your Ghost integration settings for events like "Subscriber created" or "Post published."
Workflow 1: Sync New Ghost Subscribers to Your CRM
Keeping your subscriber list in sync with your primary CRM is essential for unified marketing and sales efforts. This workflow automatically adds any new Ghost subscriber to a CRM like HubSpot, ActiveCampaign, or Salesforce.
Nodes Needed: Ghost Trigger, HubSpot (or other CRM node)
- Set up the Trigger:
- Add a
Ghost Triggernode to your canvas. - Select your Ghost credentials.
- In the "Event" dropdown, choose "Member Added." This will trigger the workflow every time someone new subscribes to your Ghost publication.
- Add a
- Map Data to Your CRM:
- Add a
HubSpotnode. - For "Resource," select "Contact." For "Operation," choose "Create or Update."
- Set the "Contact Email" field to a new expression. Drag the
emailproperty from the input of the Ghost node. It should look something like{{ $json["member"]["added"][0]["email"] }}. - Map other relevant fields, like name. For instance, link HubSpot's `firstname` property to the
{{ $json["member"]["added"][0]["name"] }}from Ghost.
- Add a
Activate this workflow, and you'll never have to manually export-import subscriber lists again. A reliable hosting solution like n8nautomation.cloud ensures your instance is always on to catch these webhooks instantly.
Workflow 2: Auto-Share New Posts to Social Media
Promoting your content is just as important as writing it. This automation instantly shares your newly published posts on social media platforms like X (Twitter), LinkedIn, or Facebook, driving traffic back to your site with zero manual effort.
Nodes Needed: Ghost Trigger, X (Twitter) Node
- Trigger on Publish:
- Add a
Ghost Triggernode. - Set the "Event" to "Post Published."
- Add a
- Filter for Public Posts (Optional):
- Add an
IFnode after the trigger. - Set a condition to check if the post visibility is public. This prevents paid-member-only posts from being shared publicly. The condition would be:
{{ $json["post"]["current"]["visibility"] }}equalspublic.
- Add an
- Compose and Send the Tweet:
- Connect an
X (Twitter)node to the "true" output of the IF node. - In the "Text" field, craft your message using data from the trigger. A common format is:
New post published: {{ $json["post"]["current"]["title"] }} {{ $json["post"]["current"]["url"] }} #ghost #automation. - You can even include relevant tags from your Ghost post dynamically.
- Connect an
Tip: Use a Split in Batches node before your social media nodes if you want to post to multiple platforms. This creates parallel execution paths, so a failure on one platform (e.g., LinkedIn) doesn't stop the post from being shared on another (e.g., Twitter).
Workflow 3: Create Ghost Drafts from a Google Sheet
For teams that plan their content calendar in a spreadsheet, this workflow is a game-changer. It watches a Google Sheet for new rows and automatically creates a corresponding draft post in Ghost, pre-filled with the title, author, and even tags.
Nodes Needed: Google Sheet Trigger, Ghost Node
- Trigger from Google Sheets:
- Add a
Google Sheet Triggernode. - Authenticate with your Google account.
- Select the spreadsheet and sheet name where you manage your content ideas.
- Add a
- Create the Ghost Draft:
- Add a
Ghostnode. - Set "Resource" to "Post" and "Operation" to "Create."
- Map the columns from your sheet to the post fields in n8n.
- Set the "Title" field to the expression for your title column, e.g.,
{{ $json["body"]["Title"] }}. - Set "Status" to "Draft" so it doesn't publish immediately.
- You can map a "Content" column to the post body, a "Tags" column to the tags field, and more.
- Set the "Title" field to the expression for your title column, e.g.,
- Add a
This workflow bridges the gap between content planning and content creation, streamlining your editorial pipeline.
Workflow 4: Send a Weekly Post Digest via Email
Keep your audience engaged by sending them a weekly roundup of your latest content. This workflow runs on a schedule, fetches all posts published in the last week, formats them into a clean HTML email, and sends it via a transactional email service.
Nodes Needed: Cron, Date & Time, Ghost, HTML (optional), SendGrid (or other email node)
- Schedule the Workflow:
- Start with a
Cronnode. Set it to run once a week, for example, every Friday at 9 AM.
- Start with a
- Get Last Week's Posts:
- Use a
Date & Timenode to get the date from 7 days ago. - Add a
Ghostnode. Set "Resource" to "Post" and "Operation" to "Get All." - In the "Filter" option, add a filter for "Published At" is "greater than or equal to" and use the date from the previous node:
{{ $nodes["Date & Time"].json["iso"] }}.
- Use a
- Format and Send the Email:
- You can use an
HTMLnode to construct a beautiful email template, looping over the posts from the Ghost node to create a list with titles and links. - Add a
SendGridnode (orResend,Postmark, etc.). - Configure the sender, recipient list (which you could pull from another Ghost node call), and subject line ("Weekly Digest from My Blog").
- Use the formatted HTML from the previous node as the email body.
- You can use an
Cron-based jobs are perfect for managed n8n hosting. On a platform like n8nautomation.cloud, your workflows run on a dedicated instance with 24/7 uptime, so your scheduled tasks execute reliably without you managing a server.
Workflow 5: Automatically Backup Ghost Content
Your content is your most valuable asset. While Ghost is a robust platform, having your own backups provides peace of mind. This workflow triggers whenever a post is created or updated, and saves the content as a Markdown file in cloud storage.
Nodes Needed: Ghost Trigger, Write Binary File, Dropbox (or Google Drive, AWS S3)
- Trigger on Post Updates:
- Use a
Ghost Triggernode with the "Event" set to "Post Updated." This also fires for newly created posts.
- Use a
- Convert Content to a File:
- Add a
Write Binary Filenode. - In the "File Name" field, use an expression to create a unique name, like
{{ $json["post"]["current"]["slug"] }}.md. - In the "Data" field, use the expression
{{ $json["post"]["current"]["html"] }}to get the post's content. Ghost provides content in both HTML and MobileDoc format; choose what works best for your backup strategy.
- Add a
- Upload to Cloud Storage:
- Add a
Dropboxnode (or your preferred cloud storage provider). - Set the "Operation" to "Upload."
- Specify the "File Path" within Dropbox where you want to store your backups, e.g.,
/Ghost-Backups/. - The "Input Data" field should automatically connect to the output of the Write Binary File node.
- Add a
This simple n8n Ghost integration creates a powerful, automated backup system, ensuring your hard work is always safe and secure a world away from your primary server.