Directus (DrWade) icon

Directus (DrWade)

Consume Directus API

Users → List

AI-generated

Overview

The Directus (DrWade) n8n node for the Users resource with the List operation allows you to retrieve a list of users from your Directus instance. This is useful for automating workflows that need to access, process, or export user data, such as generating reports, synchronizing user lists with other systems, or performing bulk operations on user accounts.

Practical examples:

  • Fetch all users and send them a notification.
  • Export user data to CSV for analysis.
  • Filter users based on specific criteria (e.g., role, status).
  • Retrieve only selected fields for lightweight integrations.

Properties

Name Type Meaning
Return All boolean If enabled, returns all user records; if disabled, limits the number of returned users according to the "Limit" property.
Limit number The maximum number of user records to return (only used if "Return All" is false). Must be between 1 and 100.
Split Into Items boolean If enabled, outputs each user as a separate item in the workflow; otherwise, returns all users in a single array.
JSON/RAW Parameters boolean If enabled, allows setting query/body parameters via raw JSON instead of the UI fields.
Body Parameters json Raw JSON body parameters for advanced queries (used when "JSON/RAW Parameters" is enabled).
Additional Fields collection Extra options to refine the query, including aggregation, export settings, filtering, sorting, grouping, and more.
└ Aggregate fixedCollection Aggregation functions (e.g., count, sum, avg) to perform calculations on user fields.
└ Binary Property for Export Data string Name of the binary property to store exported file data.
└ Deep (JSON) json Set nested relational query parameters.
└ Export options Format to export the API response (json, csv, xml).
└ Fields string Specify which user fields to return.
└ File Name for Export Data string Filename for exported data (without extension).
└ Filter (JSON) json Conditions to filter users by.
└ Group By string Field(s) to group results by for aggregation.
└ Meta string Metadata to include in the response.
└ Offset number Number of users to skip (for pagination).
└ Search string Search term to filter users by matching fields.
└ Sort string Sorting order for the returned users (CSV of fields, use minus sign for descending).

Output

  • If "Split Into Items" is enabled:
    Each output item contains a single user's data in the json field.

  • If "Split Into Items" is disabled:
    A single output item contains an array of users in the json field.

  • If "Export" is set (csv/json/xml):

    • The exported file is available in the specified binary property (default: data).
    • The json field still contains the user data (array or object).

Example output (Split Into Items = false):

{
  "json": [
    {
      "id": 1,
      "email": "user@example.com",
      "first_name": "John",
      ...
    },
    {
      "id": 2,
      "email": "jane@example.com",
      "first_name": "Jane",
      ...
    }
  ]
}

Example output (Split Into Items = true):

{
  "json": {
    "id": 1,
    "email": "user@example.com",
    "first_name": "John",
    ...
  }
}

Binary output:
If exporting, the binary property (e.g., data) will contain the file in the chosen format.


Dependencies

  • Directus API: Requires a valid Directus instance accessible via HTTP(S).
  • API Credentials: You must configure the directusApi credentials in n8n with appropriate permissions to read user data.

Troubleshooting

Common issues:

  • Authentication errors: Ensure your API credentials are correct and have permission to access user data.
  • Invalid filter/sort/group syntax: When using JSON fields like "Filter" or "Deep", ensure the input is valid JSON.
  • Export issues: If the export file is empty or missing, check that the "Export" option and "Binary Property for Export Data" are set correctly.
  • Limit exceeded: If "Limit" is set above 100, the request may fail due to API restrictions.

Error messages:

  • "error": "Request failed with status code 401": Invalid credentials or insufficient permissions.
  • "error": "Unexpected token ... in JSON": Malformed JSON in one of the JSON input fields.
  • "error": "Field not found": Specified field in "Fields", "Sort", or "Group By" does not exist.

Links and References

Discussion