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 a file from a Directus instance by its unique ID. It is useful in scenarios where you need to automate the removal of files stored in Directus, such as cleaning up unused assets, managing user uploads, or integrating with workflows that require dynamic file management.
Practical examples:
- Automatically deleting temporary files after processing.
- Removing outdated documents or images from a content management workflow.
- Integrating with approval processes where rejected files are deleted.
Properties
| Name | Type | Meaning |
|---|---|---|
| ID | String | Unique ID of the file object to be deleted. |
Output
The output will typically be a JSON object indicating the result of the delete operation. This may include:
- Confirmation of deletion (e.g., a success message or status).
- The ID of the deleted file.
- Any error messages if the operation failed.
Example output:
{
"success": true,
"id": "0fca80c4-d61c-4404-9fd7-6ba86b64154d"
}
or, in case of an error:
{
"success": false,
"error": "File not found"
}
Dependencies
- Requires access to a Directus instance.
- May require API credentials or authentication tokens configured in n8n for Directus access.
Troubleshooting
Common issues:
- Invalid or missing ID: If the provided file ID does not exist, the node may return an error like "File not found."
- Authentication errors: If API credentials are missing or incorrect, you may see errors related to authorization.
- Network issues: Connectivity problems with the Directus server can cause timeouts or connection errors.
How to resolve:
- Double-check the file ID for accuracy.
- Ensure your Directus credentials are correctly set up in n8n.
- Verify network connectivity to the Directus server.