Actions8
Overview
This node integrates with the MediaCockpit Digital Asset Management (DAM) REST API to upload new assets into a specified folder or collection. It supports two main upload modes: uploading binary data directly from a previous node (such as an HTTP Request or Gemini node), or downloading a file from a given URL and then uploading it.
Typical use cases include:
- Automating the ingestion of media files into MediaCockpit DAM from various sources.
- Uploading images, videos, documents, or other digital assets fetched dynamically during workflow execution.
- Organizing uploaded assets by specifying the target folder or collection ID.
For example, you could use this node to upload images downloaded from a public URL or binary files generated earlier in your workflow into a specific MediaCockpit collection for centralized management.
Properties
| Name | Meaning |
|---|---|
| Upload Asset | Operation selector; here it is fixed to "Upload Asset" to trigger the upload functionality. |
| Folder/Collection ID | The key or ID of the folder or collection within MediaCockpit where the asset will be uploaded. |
| Upload Mode | Method of upload: - Binary Data: Upload file content from binary data provided by a previous node. - URL: Download the file from a specified URL and upload it. |
| File URL | (Shown only if Upload Mode is "URL") The URL of the file to download and upload to MediaCockpit. |
| Filename | Optional override for the filename of the uploaded asset. If empty, the filename is derived from the binary data, URL, or generated automatically. |
Output
The node outputs JSON data containing debug information about the upload process and the result returned by the MediaCockpit API. Key output fields include:
_debug_upload_mode: Indicates whether the upload was done via binary data or URL._debug_upload_collection: The collection ID used for the upload._debug_upload_filename: The final filename used for the uploaded asset._debug_upload_mime_type: MIME type of the uploaded file._debug_upload_data_size: Size in bytes of the uploaded file data.uploadResult: The JSON response from the MediaCockpit API after a successful upload, typically containing metadata about the newly created asset.
No binary data is output by this node; it focuses on uploading assets and returning metadata about the operation.
Dependencies
- Requires an active connection to the MediaCockpit DAM REST API.
- Needs credentials providing API authentication (an API key or token).
- The node uses HTTP requests internally to download files (if URL mode is selected) and to upload assets.
- No additional external libraries beyond standard n8n helpers and Node.js buffer utilities are required.
Troubleshooting
Missing Binary Data Error:
If using "Binary Data" upload mode but no binary data is connected from a previous node, the node throws an error instructing to connect a node that provides binary data or switch to URL mode.File URL Required:
When "URL" upload mode is selected, the "File URL" property must be set and non-empty. Otherwise, an error is thrown.Download Failures:
If the node fails to download the file from the provided URL (e.g., network issues, invalid URL), it throws an error with details about the failure.Upload Failures:
Errors during upload to MediaCockpit (e.g., invalid collection ID, authentication issues) result in an error message including the collection ID and filename for easier debugging.Filename Resolution:
If no filename is provided, the node attempts to extract it from the URL or binary metadata. If unsuccessful, it generates a fallback filename with a timestamp and appropriate extension based on MIME type.
Links and References
- MediaCockpit DAM API Documentation (general reference for MediaCockpit REST API)
- n8n HTTP Request Node Documentation
- n8n Binary Data Handling
If you need further details on other operations or resources, feel free to ask!