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
This node is designed to delete multiple folders in a Directus instance by accepting an array of folder primary keys. It is useful in scenarios where you need to perform batch deletions of folders, such as cleaning up unused directories or managing content organization at scale. For example, if you have several obsolete media folders in your Directus project, you can use this node to remove them all at once by providing their unique identifiers.
Properties
| Name | Type | Meaning |
|---|---|---|
| Keys (JSON) | JSON | An array of folder primary keys to be deleted. This should be a JSON array of strings, each representing the unique identifier of a folder you wish to delete. Example: ["d97c2e0e-293d-4eb5-9e1c-27d3460ad29d", "fc02d733-95b8-4e27-bd4b-08a32cbe4e66"] |
Output
The output will contain a json field. The structure of this field depends on the response from the Directus API after attempting to delete the specified folders. Typically, it may include information about which folders were successfully deleted and any errors encountered for specific keys.
Example output structure:
{
"deleted": [
"d97c2e0e-293d-4eb5-9e1c-27d3460ad29d",
"fc02d733-95b8-4e27-bd4b-08a32cbe4e66"
],
"errors": []
}
Note: Actual output may vary depending on the Directus API implementation.
Dependencies
- Directus API: Requires access to a Directus instance with appropriate permissions to delete folders.
- API Key / Authentication: You must configure authentication credentials in n8n to connect to your Directus instance.
Troubleshooting
- Invalid Keys Format: If the "Keys (JSON)" property is not a valid JSON array, the node may throw a parsing error. Ensure you provide a properly formatted JSON array.
- Permission Denied: If the API credentials do not have permission to delete folders, you may receive an authorization error from Directus.
- Non-existent Keys: Attempting to delete folders that do not exist may result in partial success or error messages indicating which keys could not be found.