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
Overview
This node interacts with the Directus API to manage and retrieve information about collections. Specifically, for the Collections resource with the List operation, it fetches a list of collections from the Directus instance.
This operation is useful when you want to programmatically obtain metadata about all collections defined in your Directus project. For example, you might use this to dynamically populate dropdowns in workflows, audit available collections, or integrate collection data into other systems.
A practical example: You have an automation that needs to process data from multiple collections. Before processing, you use this node to list all collections, then iterate over them to perform further actions like fetching items or updating schemas.
Properties
| Name | Meaning |
|---|---|
| Split Into Items | Boolean option to output each element of the returned array as its own separate item. |
- When Split Into Items is set to
true, each collection in the list will be output as an individual item. - When set to
false, the entire list of collections is output as a single item containing an array.
Output
The node outputs JSON data representing the collections retrieved from the Directus API.
- If Split Into Items is
false, the output JSON contains a single object with a property holding an array of collection objects. - If Split Into Items is
true, each output item corresponds to one collection object.
Each collection object includes metadata fields as provided by the Directus API, such as collection name, schema details, and other relevant properties describing the collection.
No binary data output is involved in this operation.
Dependencies
- Requires a valid connection to a Directus API instance.
- Needs an API authentication credential (e.g., an API key or token) configured in n8n to authorize requests to the Directus API.
- The node uses internal helper functions to make HTTP requests to the Directus API endpoints.
Troubleshooting
- Authentication errors: Ensure the API credential is correctly configured and has sufficient permissions to access the collections endpoint.
- Empty results: Verify that the Directus instance actually has collections defined; otherwise, the list will be empty.
- API request failures: Network issues or incorrect Directus API URL configuration can cause failures. Check connectivity and credentials.
- JSON parsing errors: If using advanced query parameters (not typical for this operation), ensure JSON inputs are well-formed.
If the node throws errors related to request limits or permissions, review the Directus API user roles and rate limits.