Post → Update
AI-generatedOverview
This node integrates with the Ghost CMS API (version 2) to manage blog posts, images, and media with enhanced features. Specifically, for the Post - Update operation, it allows users to update existing blog posts via the Admin API. This includes modifying post content, metadata, publication status, authors, tags, and other post attributes.
Common scenarios where this node is beneficial include:
- Automating updates to blog posts based on external triggers or workflows.
- Bulk updating post metadata such as SEO fields or featured images.
- Scheduling posts by setting publication dates and statuses programmatically.
- Managing post content in different formats (HTML or Mobile Doc JSON).
Practical example:
- A marketing team uses this node to update multiple blog posts' featured images and meta descriptions automatically after a campaign launch.
- A content automation workflow updates scheduled posts’ content and publication times dynamically.
Properties
| Name | Meaning |
|---|---|
| Source | Choose the API source: "Admin API" (full control including updates) or "Content API" (read-only access). For update operations, only "Admin API" is applicable. |
| Post ID | The unique identifier of the post to update (required when using Admin API). |
| Content Format | Format of the post content: "HTML" or "Mobile Doc" (a JSON-based format used by Ghost). Determines how content is sent in the update. |
| Update Fields | Collection of fields to update on the post. Includes: |
| - Authors ID Names or IDs: Select or specify author IDs. | |
| - Canonical URL: URL to specify canonical link for SEO. | |
| - Code Injection Foot / Head: Custom code snippets injected into the post's footer or header. | |
| - Content: Post content in HTML format (shown if Content Format is HTML). | |
| - Content (JSON): Post content in Mobile Doc JSON format (shown if Content Format is Mobile Doc). | |
| - Excerpt: Custom excerpt text; if empty, Ghost auto-generates one. | |
| - Feature Image: URL of the feature image. | |
| - Feature Image Alt Text / Caption / Height / Width: Accessibility and display properties for the feature image. | |
| - Featured: Boolean flag to mark post as featured. | |
| - Meta Description / Title: SEO metadata. | |
| - Open Graph Description / Image / Title: Social sharing metadata. | |
| - Published At: DateTime to schedule or set publication time. | |
| - Slug: URL-friendly identifier for the post. | |
| - Status: Post status, options are "Draft", "Published", or "Scheduled". | |
| - Tag Names or IDs: Tags associated with the post. | |
| - Title: Post title. | |
| - Twitter Description / Image / Title: Twitter card metadata. |
Output
The node outputs an array of JSON objects representing the updated posts returned from the Ghost Admin API. Each object contains the post's updated data fields as confirmed by the API, including any changes made during the update operation.
No binary data output is produced by this operation.
Example output snippet (simplified):
[
{
"id": "post-id",
"title": "Updated Post Title",
"slug": "updated-post-slug",
"status": "published",
"published_at": "2024-06-01T12:00:00Z",
"feature_image": "https://example.com/image.jpg",
...
}
]
Dependencies
- Requires connection to a Ghost CMS instance supporting Admin API v2.
- Requires an API key credential with admin privileges configured in n8n.
- Uses
moment-timezonelibrary internally to handle date/time conversions for scheduling posts. - The node depends on helper functions to make authenticated HTTP requests to Ghost API endpoints.
Troubleshooting
Error: "Content must be a valid JSON"
Occurs if the content format is set to Mobile Doc but the provided content JSON is invalid or malformed.
Resolution: Ensure the content JSON is well-formed and valid before passing it to the node.Error: "Published at must be define when status is scheduled"
Happens when the post status is set to "scheduled" but no publication date/time is provided.
Resolution: Provide a validpublished_atdatetime value when scheduling posts.Missing or incorrect Post ID
If the Post ID is not specified or incorrect, the update will fail because the API cannot identify which post to update.
Resolution: Verify the Post ID is correct and corresponds to an existing post.API Authentication Errors
If the API key credential is missing, invalid, or lacks permissions, requests will fail.
Resolution: Check that the API key has admin rights and is correctly configured in n8n credentials.Binary Property Not Found (for image/media upload operations)
Although not relevant for the Post Update operation, if users attempt uploads without proper binary data, errors occur.
Resolution: Ensure the binary property name matches the input data.