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 integrates with the Directus API, allowing users to interact with various Directus resources programmatically within n8n workflows. Specifically, for the Collections resource and the Get operation, the node retrieves metadata about a specified collection by its unique name.
Typical use cases include:
- Fetching schema or configuration details of a collection in Directus.
- Dynamically obtaining collection information to drive conditional logic or further API calls in a workflow.
- Automating documentation or auditing tasks by extracting collection definitions.
For example, you might use this node to get the structure of an "articles" collection before processing or transforming its data elsewhere in your workflow.
Properties
| Name | Meaning |
|---|---|
| Collection | Unique name of the collection to retrieve metadata for. This is a required option loaded dynamically from available collections in Directus. |
Output
The node outputs the JSON response from the Directus API containing the metadata of the specified collection. The output structure typically includes fields describing the collection's properties, such as its fields, settings, and other configuration details.
Example output snippet (simplified):
{
"collection": "articles",
"fields": [
{
"field": "id",
"type": "integer",
"primary_key": true,
...
},
{
"field": "title",
"type": "string",
...
}
],
"meta": {
"icon": "file-text",
"note": "Collection for articles",
...
}
}
No binary data is produced by this operation.
Dependencies
- Requires a valid connection to a Directus instance via an API key credential configured in n8n.
- The node uses the Directus REST API endpoints; thus, network access to the Directus server is necessary.
- No additional external dependencies beyond the Directus API and n8n environment.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication failures.
- Specifying a non-existent collection name will result in a "Not Found" error from the Directus API.
- Network connectivity problems can prevent successful API requests.
Error messages:
"error": "Unauthorized": Check that the API key credential is correctly set up and has sufficient permissions."error": "Collection not found": Verify the collection name is correct and exists in the Directus instance.- JSON parsing errors when using advanced parameters: Ensure any JSON input fields are properly formatted.
Resolution tips:
- Use the dynamic options loader to select valid collection names.
- Confirm API credentials and permissions in the Directus admin interface.
- Test connectivity to the Directus API endpoint outside n8n if needed.