# Publish a Ghost Post from HTML

Source: https://openflow.run/en/templates/publish-ghost-post-from-html/
Content language: en
Template revision: d291811835b4d4defcd934c79186ed436e74219f

Content

Create a Ghost draft from your HTML, publish that same post and read back its rendered body.

[Use in Open Flow](https://console.openflow.run/flows?importUrl=https%3A%2F%2Fraw.githubusercontent.com%2Foomol-lab%2Fawesome-workflow-templates%2Fd291811835b4d4defcd934c79186ed436e74219f%2Fworkflows%2Fpublish-ghost-post-from-html%2Ftemplates%2Fpublish-ghost-post-from-html.openflow.json)

*   [Open Flow JSON](https://github.com/oomol-lab/awesome-workflow-templates/blob/d291811835b4d4defcd934c79186ed436e74219f/workflows/publish-ghost-post-from-html/templates/publish-ghost-post-from-html.openflow.json)
*   [n8n JSON](https://github.com/oomol-lab/awesome-workflow-templates/blob/d291811835b4d4defcd934c79186ed436e74219f/workflows/publish-ghost-post-from-html/templates/publish-ghost-post-from-html.n8n.json)

![Publish a Ghost Post from HTML workflow in Open Flow](https://openflow.run/template-previews/publish-ghost-post-from-html/light.webp)

Create a Ghost draft from your HTML, publish that same post and read back its rendered body.

## Setup

1.  In Ghost Admin, create a custom integration and copy its Admin API URL and Admin API key. Add the key as an Open Flow Secret Variable named `GHOST_ADMIN_KEY` and select it in **Create and publish the Ghost post**. [Ghost Admin API](https://docs.ghost.org/admin-api)
2.  In the same step, replace the sample Admin site URL, title and HTML. Use the integration’s HTTPS site URL, including its installation subdirectory if present. For a custom hostname, set this step’s HTTP capability host to that exact hostname. The template allows Ghost(Pro) Admin hosts under `ghost.io` by default.
3.  Run manually when the HTML is ready for public publication. The output contains the ID, title, rendered HTML and status.

## Behavior

The workflow creates a draft, reads back its version and rendered HTML, and publishes the same post ID. The publishing request changes only status and includes the current `updated_at` to detect concurrent edits. Ghost can normalize HTML when creating the draft. The final read verifies that the same published post retains the draft’s title and rendered body. The workflow does not request a newsletter send. [Create a post](https://docs.ghost.org/admin-api/posts/creating-a-post) · [Publish a post](https://docs.ghost.org/admin-api/posts/publishing-a-post)

Each manual run starts a new draft. If a creation or publication response fails, review Ghost Admin before running again. A request with an unreadable response may already have taken effect. Errors include the post ID when Ghost has confirmed it. The HTTP response limit is 1 MiB.

In n8n

Run this format on a self-hosted instance where trusted workflow editors can use Code. Configure `GHOST_ADMIN_KEY` as an environment secret accessible to the Code node through `$env`. Allow the built-in modules with `NODE_FUNCTION_ALLOW_BUILTIN=crypto,https,url` and enable environment access with `N8N_BLOCK_ENV_ACCESS_IN_NODE=false`. If you run external task runners, apply the built-in allowlist in their JavaScript runner environment and make the secret available to the n8n deployment. These instance settings grant access to trusted workflows. [Code node module configuration](https://docs.n8n.io/hosting/configuration/configuration-examples/modules-in-code-node/)

Set the HTTPS Admin site URL, title and HTML in **Create and publish the Ghost post**. Run manually and inspect that step’s output for the result. The short-lived Admin JWT stays inside the step in both formats.

Inspiration & credits

Adapted from [Manual Ghost create workflow](https://github.com/Zie619/n8n-workflows/blob/ae8cf6dc5b873cbb4f74587aa9180ed3a9f70682/workflows/Manual/0217_Manual_Ghost_Create_Triggered.json) in [Zie619/n8n-workflows](https://github.com/Zie619/n8n-workflows). Attribution: Zie619 / n8n-workflows.

The collection’s [MIT notice](https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/LICENSE) is pinned at a later revision. This is the collection notice at that revision; it does not establish a separate original template author’s license. Our changes are listed above; see [repository licensing](https://github.com/oomol-lab/awesome-workflow-templates/blob/d291811835b4d4defcd934c79186ed436e74219f/README.md#licensing).

> MIT License
> 
> Copyright (c) 2025 Zie619
> 
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
> 
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
> 
> THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## What you’ll need

*   Ghost site that supports Admin API v5.0 or later
*   Ghost custom integration Admin API key

*   ghost
*   publishing
*   html

[View on GitHub](https://github.com/oomol-lab/awesome-workflow-templates/blob/d291811835b4d4defcd934c79186ed436e74219f/workflows/publish-ghost-post-from-html/README.md)
