Directus (denkhaus) icon

Directus (denkhaus)

Consume Directus API

Overview

This n8n node is designed to interact with a "Field" resource, specifically performing the "Get" operation. It retrieves detailed information about a specific field within a given collection. This functionality is useful when you need to programmatically inspect metadata or configuration of fields in a data collection, such as for dynamic form generation, validation, or integration tasks.

Practical examples:

  • Fetching the properties of a field (e.g., type, validation rules) in a CMS collection before creating or updating records.
  • Building dynamic user interfaces that adapt based on the structure of a collection's fields.

Properties

Name Type Meaning
Field Name options Unique name of the field within the selected collection. Used to specify which field to retrieve details for.
Collection Name options Name of the collection containing the field. Determines the context in which the field exists.

Output

The node outputs a JSON object containing the details of the requested field. The exact structure depends on the underlying API but typically includes properties such as:

{
  "field": "title",
  "type": "string",
  "interface": "input",
  "required": true,
  "options": { /* ... */ },
  // ...other field metadata
}
  • field: The unique identifier of the field.
  • type: Data type of the field (e.g., string, integer).
  • interface: UI component used for this field.
  • required: Whether the field is mandatory.
  • options: Additional configuration for the field.

Dependencies

  • Requires access to a Directus API instance.
  • May require authentication credentials (API key, token, etc.) configured in n8n.
  • The node relies on external methods and router logic bundled with the node package.

Troubleshooting

  • Invalid Collection or Field Name: If the specified collection or field does not exist, the node may throw an error indicating "Not Found" or similar. Double-check the names using the load options dropdowns.
  • Authentication Errors: If credentials are missing or invalid, errors related to authorization will occur. Ensure correct API credentials are set up in n8n.
  • Network Issues: Connectivity problems with the Directus API endpoint can result in timeout or connection errors.

Links and References

Discussion