Directus (denkhaus) icon

Directus (denkhaus)

Consume Directus API

Overview

The Folder → List operation in this custom n8n node retrieves a list of folders from the connected service (likely Directus, based on naming). It supports advanced querying features such as filtering, sorting, aggregation, grouping, and exporting results in various formats (CSV, JSON, XML). This node is useful for workflows that need to fetch, process, or export folder data, for example:

  • Listing all folders for reporting or auditing.
  • Exporting folder lists to files for backup or sharing.
  • Filtering and aggregating folder data for analytics.

Properties

Name Type Meaning
Return All boolean Whether to return all results or only up to a given limit. If false, the Limit property applies.
Limit number Maximum number of results to return (applies if Return All is false).
Split Into Items boolean Whether to output each element of an array as its own item in the workflow.
JSON/RAW Parameters boolean Whether to set query/body parameters via JSON/RAW input instead of the UI.
Body Parameters json Body parameters as JSON or RAW (used if JSON/RAW Parameters is true).
Additional Fields collection Extra options for customizing the query, including:
— Aggregate fixedCollection Aggregation functions (e.g., count, sum, average) to apply to fields.
— Binary Property for Export Data string Name of the binary property to store exported file data.
— Deep (JSON) json Set nested relational dataset query parameters.
— Export options Format to export API response: CSV, JSON, or XML.
— File Name for Export Data string File name for exported data (without extension).
— Fields string Specify which fields to return in the objects.
— Filter (JSON) json Conditions to filter items in the collection.
— Group By string Field(s) to group results by, enabling grouped aggregations.
— Meta string Metadata to include in the response.
— Offset number Number of items to skip when fetching data (for pagination).
— Search string Search query to filter items containing the specified text.
— Sort string How to sort returned items; accepts CSV of fields, with optional minus sign for descending order.

Output

  • The node outputs a json field containing the list of folders matching the query and filters.
  • If "Export" is used, the node can output binary data (e.g., a file in CSV, JSON, or XML format) under the specified binary property name.
  • When "Split Into Items" is enabled, each folder is output as a separate item.

Example Output Structure

[
  {
    "json": {
      "id": 1,
      "name": "Folder A",
      // ...other folder fields
    }
  },
  {
    "json": {
      "id": 2,
      "name": "Folder B"
      // ...other folder fields
    }
  }
]

If exporting, the output will include a binary property (e.g., "data") containing the file.

Dependencies

  • Requires access to a Directus API or similar backend.
  • May require API credentials/configuration within n8n (e.g., API key, base URL).
  • No external npm dependencies are visible in the provided code, but the node relies on internal methods and router logic.

Troubleshooting

  • Authentication Errors: If API credentials are missing or incorrect, you may receive authentication errors. Ensure your credentials are configured correctly in n8n.
  • Invalid Query/Filter: Malformed JSON in filter or body parameters can cause errors. Double-check your JSON syntax.
  • Export Issues: If the export format or binary property name is misconfigured, the node may fail to generate or attach the file.
  • Limit Exceeded: Setting a limit above the allowed maximum (100) will result in an error.
  • Empty Results: If filters are too restrictive, no folders may be returned.

Links and References

Discussion