Directus (denkhaus) icon

Directus (denkhaus)

Consume Directus API

Overview

This node is designed to interact with a "User" resource, specifically performing the "List" operation. It allows you to retrieve user records from an external service or database, supporting advanced querying, filtering, aggregation, and export options. Common scenarios include:

  • Fetching all users for reporting or analytics.
  • Filtering users based on specific criteria (e.g., by role, status).
  • Exporting user data in various formats (CSV, JSON, XML) for further processing or sharing.
  • Aggregating user data (e.g., counting users, calculating averages).

Practical examples:

  • Retrieve all users who registered in the last month and export their emails as a CSV file.
  • Get a paginated list of users, sorted by registration date.
  • Count the number of unique users per country.

Properties

Name Meaning
Return All Whether to return all results or only up to a given limit. If set to false, the "Limit" property determines how many results are returned.
Limit Max number of results to return (when "Return All" is false). Accepts values between 1 and 100.
Split Into Items Whether to output each element of an array as its own item. Useful for downstream nodes that expect individual items.
JSON/RAW Parameters Whether the query and/or body parameter should be set via the value-key pair UI or as raw JSON. If enabled, use "Body Parameters" to provide parameters in JSON format.
Body Parameters Body parameters as JSON or RAW. Used when "JSON/RAW Parameters" is enabled. Allows for custom request bodies.
Additional Fields A collection of optional fields to refine the query or response. Includes:
- Aggregate: Perform calculations like count, sum, average, etc., on specified fields.
- Binary Property for Export Data: Name of the binary property to store exported data.
- Deep (JSON): Set nested query parameters.
- Export: Save API response as json, csv, or xml.
- File Name for Export Data: Specify filename (without extension).
- Fields: Control which fields are returned.
- Filter (JSON): Select items by conditions.
- Group By: Group results by one or more fields.
- Meta: Specify metadata to return.
- Offset: Skip a number of items.
- Search: Filter by search query.
- Sort: Sort returned items (CSV of fields, use minus sign for descending, question mark for random).

Aggregate Options

  • Average
  • Average Distinct
  • Count
  • Count Distinct
  • Maximum
  • Minimum
  • SUM
  • SUM Distinct

Export Options

  • CSV
  • JSON
  • XML

Output

  • The node outputs a json field containing the list of users matching the specified criteria.
  • If "Split Into Items" is enabled, each user will be output as a separate item.
  • If "Export" is used, the response can be saved as a binary file (CSV, JSON, or XML), stored under the specified binary property name.
  • The structure of the json output will reflect the fields requested and any applied filters, groupings, or aggregations.

Dependencies

  • Requires access to the external service or API where the user data resides.
  • May require API credentials or authentication configured within n8n (details depend on the underlying service).
  • No additional npm dependencies are visible from the static analysis.

Troubleshooting

  • Common Issues:

    • Invalid filter or aggregation syntax in JSON fields may cause errors.
    • Exceeding the maximum allowed "Limit" value (over 100) will likely result in validation errors.
    • Missing or incorrect API credentials can lead to authentication failures.
    • Using unsupported field names in "Fields", "Group By", or "Sort" may result in errors from the backend.
  • Error Messages & Resolutions:

    • "Invalid JSON in Body Parameters" – Ensure your JSON is properly formatted.
    • "Field not found" – Double-check field names in "Fields", "Group By", or "Aggregate".
    • "Authentication failed" – Verify your API credentials and connection settings in n8n.
    • "Export failed" – Make sure the "Binary Property for Export Data" and "File Name for Export Data" are correctly set.

Links and References

Discussion