Actions109
- Collections Actions
- Activity Actions
- Assets Actions
- Authentication Actions
- Extensions Actions
- Fields Actions
- Files Actions
- Folders Actions
- Items Actions
- Permissions Actions
- Presets Actions
- Relations Actions
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
- Webhooks Actions
Overview
The Directus (DrWade) n8n node with Resource Files and Operation Update Multiple allows you to update multiple file records in your Directus instance at once. This is particularly useful when you need to apply the same changes (such as updating tags, metadata, or other file properties) to several files simultaneously, saving time compared to updating each file individually.
Common scenarios:
- Bulk-tagging files for better organization.
- Updating metadata fields (e.g., descriptions, custom attributes) across many files.
- Correcting or standardizing information on a set of files after a batch import.
Practical example:
You have uploaded 100 images and want to add the tag "cities" to all of them. Using this operation, you can specify all their keys and the new tag in one request.
Properties
| Name | Type | Meaning |
|---|---|---|
| Update Data (JSON) | JSON | The data describing which files to update and what changes to apply. Required. - keys: Array of file primary keys to update.- data: Object containing the file properties to update. |
Example value:
{
"keys": ["b6123925-2fc0-4a30-9d86-863eafc0a6e7", "d17c10aa-0bad-4864-9296-84f522c753e5"],
"data": {
"tags": ["cities"]
}
}
keys: List of file IDs to update.data: Any valid file object property.
Output
- The output will be a JSON object representing the result of the bulk update operation.
- The structure typically matches the response from the Directus API for a PATCH request to
/files, which may include:- An array of updated file objects, each reflecting the new values.
- Or a summary/status of the update operation.
Example output:
{
"data": [
{
"id": "b6123925-2fc0-4a30-9d86-863eafc0a6e7",
"tags": ["cities"],
"...": "other file properties"
},
{
"id": "d17c10aa-0bad-4864-9296-84f522c753e5",
"tags": ["cities"],
"...": "other file properties"
}
]
}
- If the API returns an error, the output will contain an
errorfield with the error message.
Dependencies
- Directus API: You must have access to a running Directus instance.
- API Credentials: The node requires valid Directus API credentials configured in n8n under the name
directusApi.
Troubleshooting
Common issues:
- Invalid Keys: If any file key in the
keysarray does not exist, those files will not be updated, and the API may return an error or partial success. - Malformed JSON: If the
Update Data (JSON)property is not valid JSON, the node will throw a parsing error. - Insufficient Permissions: The API credentials used must have permission to update files in Directus; otherwise, you'll receive an authorization error.
- API Errors: Any errors returned by the Directus API (e.g., validation errors, server errors) will be passed through in the output.
Error messages and resolutions:
"Cannot read property 'keys' of undefined": Ensure your input JSON includes bothkeysanddata."Invalid JSON": Double-check that your JSON input is correctly formatted."Permission denied": Verify your API credentials and user permissions in Directus.