Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Overview

The node provides functionality to delete multiple items from a specified collection in a data management system. This operation is useful when you need to remove several records at once, for example, deleting multiple outdated articles or user entries based on their unique identifiers.

Practical examples:

  • Bulk deleting a list of product items that are discontinued.
  • Removing multiple user accounts flagged for deletion.
  • Clearing out several outdated blog posts by specifying their IDs.

Properties

Name Meaning
Collection Name The unique name of the parent collection from which items will be deleted.
Data (JSON) A JSON array containing the primary keys (IDs) of the items to be deleted from the collection.

Output

The output contains a json field that typically includes the result of the delete operation. This may include confirmation of successful deletions or details about any failures. The exact structure depends on the underlying API response but generally confirms which items were deleted.

No binary data output is expected from this operation.

Dependencies

  • Requires connection to an external data management service that supports collections and item deletion.
  • Needs an API key or authentication token configured in n8n to authorize requests.
  • The "Collection Name" options are dynamically loaded via a method fetching available collections.

Troubleshooting

  • Invalid Collection Name: If the collection name does not exist or is misspelled, the node will fail. Ensure the collection name matches exactly with the target system.
  • Invalid Item IDs: Providing non-existent or malformed item IDs in the JSON array can cause errors or partial deletions.
  • Authentication Errors: Missing or invalid API credentials will prevent the node from executing successfully.
  • Empty Data Array: Supplying an empty array for item IDs might result in no action or an error; ensure the array contains valid IDs.

Links and References

  • Refer to the external data management system's API documentation for details on bulk item deletion.
  • Consult n8n documentation on configuring API credentials and using JSON input fields.

Discussion