Media → Upload
AI-generatedOverview
This node enables uploading media files (such as video or audio) to the Ghost CMS platform using its Admin API. It supports selecting the source of data (Content API or Admin API), but for media upload specifically, it uses the Admin API. The node is useful when you want to programmatically add media assets to your Ghost CMS instance, for example, uploading a podcast episode audio file or a video clip to be embedded in posts.
Typical use cases include:
- Automating media uploads during content publishing workflows.
- Integrating external media sources with Ghost CMS.
- Managing media assets in bulk via n8n workflows.
Properties
| Name | Meaning |
|---|---|
| Source | Choose where your data comes from: "Admin API" or "Content API". For media upload, only "Admin API" applies. |
| Binary Property | The name of the binary property in the input item that contains the media file to upload. |
| Additional Fields | Optional extra parameters for the upload: |
| - File Name | Custom filename to assign to the uploaded media. |
| - Reference | An optional reference identifier for the media (e.g., original file path). |
| - Thumbnail Binary Property | The name of the binary property containing a thumbnail image (required if uploading videos). |
Output
The node outputs an array of JSON objects representing the response from the Ghost Admin API after uploading the media. Each output item’s json field contains details about the uploaded media asset, such as its URL, ID, and metadata returned by Ghost.
If the node handles binary data, it expects the input binary data under the specified binary property name but does not output binary data itself; instead, it outputs JSON metadata about the uploaded media.
Dependencies
- Requires access to a Ghost CMS Admin API endpoint.
- Requires an API key credential with permissions to upload media via the Admin API.
- The node depends on internal helper functions (
ghostApiMediaUpload) to handle the actual upload process. - Proper configuration of timezone may affect timestamp handling elsewhere but is not critical for media upload.
Troubleshooting
- Missing Binary Data: If the specified binary property does not exist or is empty in the input item, the upload will fail. Ensure the binary property name matches exactly and that the input item contains valid binary data.
- Invalid API Credentials: Uploads require valid Admin API credentials. Authentication errors indicate misconfigured or expired API keys.
- Thumbnail Missing for Videos: When uploading videos, a thumbnail binary property must be provided. Omitting this may cause errors or incomplete uploads.
- File Naming Issues: Providing invalid characters or empty strings in the custom file name field might cause upload failures or unexpected filenames.
- API Rate Limits or Network Errors: Standard network or API rate limit errors can occur; retry logic or error handling should be implemented in workflows.
Common error messages:
"currentItem.binary[<binaryPropertyName>] DOES NOT exist or is not accessible": Check that the binary property exists and contains data."Content must be a valid JSON": Not applicable for media upload but relevant for other operations involving JSON content.