Actions15
Overview
The "Bulk Create" operation of the Upload resource in this node allows users to upload multiple files to DatoCMS by providing URLs. It supports two main ways to specify these URLs: either directly as a list of URLs or by extracting URLs from the input data fields. This bulk upload capability is useful for automating the process of importing many assets into DatoCMS at once, such as images or documents referenced in external sources or datasets.
Common scenarios include:
- Migrating or syncing large sets of media files from external URLs into DatoCMS.
- Automatically processing incoming data streams that contain URLs pointing to assets to be uploaded.
- Organizing uploads into collections within DatoCMS for better asset management.
Practical example:
- You have a CSV or JSON dataset with product information including image URLs. Using this node, you can extract all image URLs from specified fields and bulk upload them to DatoCMS, optionally replacing the original URLs in your data with references to the uploaded assets.
Properties
| Name | Meaning |
|---|---|
| Source | How to provide the URLs for bulk upload. Options: • Input Data — Extract URLs from the input data. • URL List — Provide a list of URLs directly. |
| URL List | A multiline string containing URLs to upload, one per line. Required if Source is "URL List". |
| Extract URLs From | Where to look for URLs in the input data when Source is "Input Data". Options: • All Fields — Search for URLs in all fields. • Specific Fields — Extract URLs only from specified fields. |
| Field Names | Comma-separated list of field names to extract URLs from when Extract URLs From is "Specific Fields". Supports nested fields using dot notation (e.g., "product.image.URL"). |
| Skip Creation If Already Exists | Whether to skip creating uploads for files that already exist in DatoCMS to avoid duplicates. Defaults to true. |
| Upload Collection | Optional upload collection to organize the uploads in DatoCMS. Can be selected from a list or specified by ID. |
| Include Original Data | Whether to include the original input data in the output alongside the upload results. Defaults to true. |
| Replace URLs in Data | When including original data, whether to replace URLs with DatoCMS asset references in the format {upload_id: "..."} inside the original data structure. Defaults to false. |
| Concurrent Uploads | Maximum number of uploads to process simultaneously. Integer between 1 and 20. Defaults to 5. |
Output
The output JSON object contains the following fields:
uploads: An array of successfully created upload objects returned by DatoCMS for each URL.mapping: An object mapping each original URL to its corresponding upload object or an error object if the upload failed.errors: An array of errors encountered during the upload process, each with the URL and error message.stats: Statistics about the bulk upload process, including total URLs processed, number uploaded, failed, and duplicates skipped.originalDataordata: Depending on the "Include Original Data" and "Replace URLs in Data" settings, the output may include the original input data, optionally with URLs replaced by upload references.
This structure allows downstream workflow nodes to handle both successful uploads and errors gracefully, and optionally continue working with enriched original data.
Dependencies
- Requires an API key credential for authenticating with the DatoCMS API.
- Uses the official DatoCMS Node.js client library (
@datocms/cma-client-node) bundled with the node. - No additional external dependencies are required.
- The node writes temporary files to the OS temp directory when uploading binary data (not applicable for bulk create from URLs).
Troubleshooting
- No valid URLs found to upload: This error occurs if no URLs are extracted or provided. Ensure the URL list is not empty and URLs are correctly formatted. When extracting from input data, verify the correct fields and extraction mode are set.
- Invalid URL format: URLs must start with
http://orhttps://. Invalid URLs will be ignored or cause errors. - Upload failures for specific URLs: Individual URL upload errors are collected in the
errorsoutput array with messages. Common causes include inaccessible URLs, permission issues, or unsupported file types. - Permission errors accessing upload collections: If the configured API key lacks permissions to list or use upload collections, the node will show limited options or fail. Verify API key scopes.
- Concurrent uploads too high: Setting concurrency above 20 is disallowed; setting it too high may cause rate limiting or timeouts.
- Replacing URLs in data fails: If the original data structure is complex or URLs appear in unexpected formats, URL replacement might not work as intended. Check the "Field Names" and extraction settings.