Actions111
- Item Actions
- Webhook Actions
- Collection Actions
- File Actions
- Activity Actions
- Asset Actions
- Authentication Actions
- Extension Actions
- Field Actions
- Folder Actions
- Permission Actions
- Preset Actions
- Relation Actions
- Revision Actions
- Role Actions
- Setting Actions
- User Actions
- Utility Actions
Overview
The File: Update Multiple operation in this custom n8n node allows users to update multiple file records at once within a Directus system. This is particularly useful when you need to modify properties (such as tags, metadata, or other attributes) for several files in bulk, rather than updating each file individually.
Common scenarios:
- Tagging multiple files with new categories.
- Updating metadata fields (e.g., descriptions, status) for a batch of files.
- Bulk editing file properties after a mass import or migration.
Practical example:
You have uploaded 100 images and want to assign the tag "cities" to 20 of them. You can use this operation to specify the keys of those 20 files and set their tags property in one request.
Properties
| Name | Type | Meaning |
|---|---|---|
| Update Data (JSON) | JSON | A JSON object containing: - keys: An array of primary keys (IDs) of the files you wish to update. - data: An object with the properties and values to update for each specified file. |
Example input:
{
"keys": ["b6123925-2fc0-4a30-9d86-863eafc0a6e7", "d17c10aa-0bad-4864-9296-84f522c753e5"],
"data": {
"tags": ["cities"]
}
}
Output
The node outputs a json field containing the result of the update operation. The structure typically includes:
- Confirmation of which files were updated.
- The updated properties for each file, as returned by the Directus API.
Note: The exact output structure depends on the Directus API's response for bulk file updates. It usually mirrors the updated file objects.
Dependencies
- Directus API: Requires access to a Directus instance with appropriate permissions to update files.
- Authentication/API Key: The node must be configured with valid credentials to authenticate with the Directus API.
- n8n Configuration: Ensure that any required environment variables (such as API URL, access tokens) are set up in your n8n instance.
Troubleshooting
Common issues:
- Invalid Keys: If any provided file key does not exist, the API may return an error or skip those entries.
- Insufficient Permissions: If the API credentials lack permission to update files, the operation will fail.
- Malformed JSON: Incorrectly formatted JSON in the "Update Data (JSON)" property will cause errors.
Error messages and resolutions:
"Invalid or missing 'keys' property": Ensure you provide an array of valid file IDs."Invalid or missing 'data' property": Make sure the data object contains valid file properties to update."Authentication failed": Check your API credentials and permissions.