Ghost Trigger

Start the workflow when a post, a page, a tag, or a member changes in Ghost.

v1.0.1Source

Install

Manage Ghost posts, pages, tags, tiers, newsletters, offers, members, images, and webhooks with the Admin API, read published content with the Content API, and start a workflow on a Ghost webhook event.

Ghost@zerodot/ghostInstall
  1. Open System, then Nodes.
  2. Find Ghost and click Install.
  3. Use the new nodes at once. You do not restart.

How it works

Ghost Trigger (trigger.ghost) is a trigger node in the Ghost package (@zerodot/ghost): Start the workflow when a post, a page, a tag, or a member changes in Ghost.

Starts a run on a webhook event from Ghost. Events:

  • Site: changed
  • Post: added, deleted, edited, published, published edited, unpublished, scheduled, unscheduled, rescheduled
  • Page: the same events as Post
  • Tag: added, edited, deleted, added to or removed from a post, added to or removed from a page
  • Member: added, edited, deleted

The output has event and data (the body that Ghost sent, for example post.current and post.previous).

Setup:

  1. Choose the events. When the workflow is active, the trigger makes one webhook in Ghost for each event, with the Admin API. When the workflow stops, it removes them. Turn off Make The Webhooks if you made the webhooks by hand. Add ?event=<event name> to the address of each webhook, because Ghost does not send the event name in the body.
  2. Put a secret text in the Webhook Secret of the credential (required). The trigger sets it on each webhook.

Ghost signs each request with the header X-Ghost-Signature (sha256=<hmac>, t=<timestamp>). The HMAC-SHA256 is of the body followed by the timestamp, and the key is the secret. The trigger checks it, and refuses a request with a bad signature or a timestamp older than 5 minutes. The Webhook Secret is required. Without it, the trigger refuses to make webhooks and refuses all requests. Test listening is not available: publish the workflow to get events.

Logins it can use

Ghost Admin API (ghost.adminApi):

  • url: the address of the site, for example https://my-site.ghost.io.
  • apiKey: the Admin API key of a custom integration (Settings > Integrations). It has the form id:secret. The node makes a short token (HS256 JWT, 5 minutes) from it for each request.
  • apiVersion: the Accept-Version header, for example v5.0.
  • webhookSecret: required for the trigger. Ghost signs each webhook request with it.

Ghost Content API (ghost.contentApi): url, key (the Content API key of the same integration), and apiVersion (the Accept-Version header, default v5.0). The node sends the key as the key query parameter.

The apiKey, the webhookSecret, and the key are secret. The Test button reads one tag (Admin API) or the settings (Content API).

Guides and related hubs