Actions109
- Activity Actions
- Assets Actions
- Authentication Actions
- Collections 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
This node integrates with the Directus API to manage various resources, including collections. Specifically, for the Collections resource and the Delete operation, the node deletes a specified collection by its unique name.
Use cases include:
- Automating the removal of obsolete or temporary collections in your Directus instance.
- Managing schema changes programmatically as part of a deployment or cleanup workflow.
- Integrating collection deletion into larger automation pipelines that maintain your data structure.
Example: You have a collection named "articles" that is no longer needed. Using this node configured to delete the "articles" collection will remove it from Directus via the API.
Properties
| Name | Meaning |
|---|---|
| Collection | Unique name of the collection to delete. This is a required option loaded dynamically from available collections in Directus. |
Output
The output JSON contains the response from the Directus API after attempting to delete the specified collection. Typically, this includes confirmation of deletion or details about the deleted collection.
Example output JSON structure:
{
"json": {
// Directus API response data confirming deletion
}
}
No binary data output is produced by this operation.
Dependencies
- Requires an active connection to a Directus instance via an API key credential (configured in n8n).
- The node uses the Directus REST API endpoints, specifically the DELETE method on
collections/{collectionName}. - Proper permissions are required on the API key to delete collections.
Troubleshooting
Common issues:
- Attempting to delete a collection that does not exist will result in an error.
- Insufficient permissions on the API key can cause authorization errors.
- Network connectivity problems may prevent the API call from succeeding.
Error messages:
"Collection not found": Verify the collection name is correct and exists."Unauthorized"or"Forbidden": Check that the API key has delete permissions for collections.- JSON parsing errors: Ensure input parameters are correctly formatted.
Resolution tips:
- Use the dynamic options loading feature to select valid collection names.
- Confirm API credentials and permissions in Directus.
- Enable "Continue On Fail" in the node settings to handle errors gracefully in workflows.