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
Items → List
AI-generatedOverview
The Directus (DrWade) - Items: List operation allows you to retrieve a list of items from a specified collection in your Directus instance. This node is highly flexible, supporting advanced filtering, sorting, aggregation, and export options. It is particularly useful for workflows that need to fetch, process, or export data from Directus collections, such as generating reports, synchronizing data with other systems, or automating content management tasks.
Practical examples:
- Fetch all articles from a "news" collection, filter by published status, and sort by date.
- Export user data as a CSV file for reporting purposes.
- Retrieve only specific fields from a product catalog for use in another system.
Properties
| Name | Type | Meaning |
|---|---|---|
| Collection | options | Unique name of the parent collection from which to list items. Required. |
| Return All | boolean | If enabled, returns all results; otherwise, limits the number of returned objects according to the "Limit" property. |
| Limit | number | Maximum number of items to return (only used if "Return All" is false). Must be between 1 and 100. |
| Split Into Items | boolean | If enabled, outputs each element of the result array as its own n8n item. |
| JSON/RAW Parameters | boolean | If enabled, query parameters are set via a raw JSON object instead of the UI fields. |
| Query Parameters | json | (Shown if JSON/RAW Parameters is true) Query parameters as a flat JSON object. Allows for advanced custom queries. |
| Additional Fields | collection | (Shown if JSON/RAW Parameters is false) Extra options for the request, including: aggregation, export, deep querying, field selection, filtering, grouping, metadata, offset, search, and sorting. See below for details. |
Additional Fields sub-options:
- Aggregate: Apply aggregation functions (count, sum, avg, min, max, etc.) on specified fields.
- Binary Property for Export Data: Name of the binary property to store exported file data.
- Deep (JSON): Set query parameters for nested relational datasets.
- Export: Save API response to a file (json, csv, xml).
- Fields: Specify which fields to return.
- File Name for Export Data: File name for exported data (without extension).
- Filter (JSON): Filter items by conditions (as JSON).
- Group By: Group results by one or more fields.
- Meta: Specify what metadata to include in the response.
- Offset: Number of items to skip (for pagination).
- Search: Search string to filter items.
- Sort: Sort order for returned items (CSV of fields, supports ASC/DESC/random).
Output
- json: The output will be an object or array of objects representing the items retrieved from the specified collection. Each object contains the fields defined in the collection schema, plus any additional metadata requested.
- If "Split Into Items" is enabled, each item in the array is output as a separate n8n item.
- If "Export" is used, the output may also include a binary property containing the exported file (in the selected format: JSON, CSV, or XML).
Example output (simplified):
{
"json": {
"id": 123,
"title": "Sample Item",
"status": "published",
"...": "..."
}
}
or, when exporting:
{
"json": { ... },
"binary": {
"data": { /* file buffer and metadata */ }
}
}
Dependencies
- Directus API: Requires access to a running Directus instance.
- API Credentials: You must configure Directus API credentials in n8n (via the
directusApicredential type). - Environment: No special environment variables required beyond standard n8n configuration.
Troubleshooting
Common issues:
- Invalid Collection Name: Ensure the "Collection" property matches an existing collection in Directus.
- Permission Denied: The API credentials must have permission to read the specified collection.
- Malformed JSON: When using JSON/RAW Parameters or filters, ensure the JSON syntax is valid.
- Export Errors: If exporting data, ensure the "Binary Property for Export Data" and "File Name for Export Data" are set correctly.
Error messages:
"error": "Cannot read property 'data' of undefined": Likely due to an invalid API response or incorrect collection name."error": "Request failed with status code 401": Authentication issue—check your API credentials."error": "Unexpected token ..." in JSON": Malformed JSON in query/filter parameters.