Image → Upload
AI-generatedOverview
This node integrates with the Ghost CMS API (version 2) to perform various operations, including uploading images. Specifically, for the Image Upload operation, it allows users to upload image files directly into a Ghost CMS instance via either the Admin API or Content API source.
Typical use cases include:
- Automating the process of adding images to your Ghost blog or website.
- Bulk uploading images from binary data within n8n workflows.
- Managing image assets programmatically without manual uploads through the Ghost admin interface.
For example, you could use this node to upload user-generated images collected in a form or to migrate images from another system into Ghost CMS automatically.
Properties
| Name | Meaning |
|---|---|
| Source | Choose the API source to upload the image: Admin API or Content API. |
| Binary Property | (Required if Source is Admin API) The name of the binary property in the input data that contains the image file to upload. Default is "data". |
| Additional Fields | (Optional, only for Admin API source) Extra parameters for the upload: |
| - Purpose | Intended use of the image. Options: image (general), profile_image (must be square), icon (must be square). |
| - File Name | Custom file name to assign to the uploaded image. |
| - Reference | Optional reference identifier for the image, e.g., original file path or other metadata. |
Output
The node outputs an array of JSON objects representing the response from the Ghost API after uploading the image. Each output item corresponds to one uploaded image and includes details such as URLs, IDs, and metadata returned by Ghost.
If the node supports binary data input, it does not output binary data itself but processes the binary content internally to upload the image.
Dependencies
- Requires access to a Ghost CMS instance with either Admin API or Content API enabled.
- Requires appropriate API credentials configured in n8n for authentication with Ghost.
- Uses internal helper functions to handle API requests and image uploads.
- Timezone handling depends on the
moment-timezonelibrary bundled with the node.
Troubleshooting
- Missing Binary Data: If the specified binary property does not exist or is empty in the input data, the node will log debug messages indicating the missing binary content. Ensure the binary property name matches exactly and that the input data contains valid binary image data.
- Invalid Image Format: The node expects valid image binary data. Corrupted or unsupported formats may cause upload failures.
- API Authentication Errors: Incorrect or missing API credentials will result in authentication errors. Verify that the API key/token is correctly set up in n8n credentials.
- Purpose Constraints: When setting the purpose to
profile_imageoricon, ensure the image is square; otherwise, the Ghost API might reject the upload. - General API Errors: Any error returned by the Ghost API during upload will be thrown unless "Continue On Fail" is enabled, in which case the error message will be included in the output.