Directus icon

Directus

Consume Directus API

Overview

The Directus - Field: Get operation retrieves detailed information about a specific field within a given collection in a Directus instance. This is useful for automation scenarios where you need to inspect the configuration, type, or metadata of a particular field (column) in your data model—such as when dynamically generating forms, validating data, or synchronizing schema information between systems.

Practical examples:

  • Fetching the definition of a "status" field in an "articles" collection to determine its allowed values.
  • Auditing field settings before performing data migrations or updates.
  • Building dynamic user interfaces that adapt to the field's properties.

Properties

Name Type Meaning
Field options Unique name of the field within the selected collection. Specifies which field to fetch.
Collection options The name of the collection containing the field.

Output

The node outputs a single json object representing the field's details as returned by the Directus API. The structure typically includes:

{
  "collection": "articles",
  "field": "status",
  "type": "string",
  "meta": {
    "interface": "select-dropdown",
    "options": { /* ... */ },
    "display": "Status",
    // ...other metadata
  },
  // ...other field properties
}
  • collection: Name of the collection the field belongs to.
  • field: The unique field name.
  • type: Data type of the field (e.g., string, integer).
  • meta: Metadata describing how the field behaves and is displayed in Directus.
  • Additional properties may be present depending on the field's configuration.

Note: No binary output is produced by this operation.


Dependencies

  • Directus API: Requires access to a running Directus instance.
  • API Credentials: You must configure the directusApi credentials in n8n with appropriate permissions to read field definitions.

Troubleshooting

Common issues:

  • Invalid Collection or Field Name: If the specified collection or field does not exist, the node will throw an error such as Field not found or Collection not found.
    • Resolution: Double-check the collection and field names using the dropdowns or Directus admin panel.
  • Insufficient Permissions: If the API credentials lack permission to read field definitions, you may see errors like Unauthorized or Forbidden.
    • Resolution: Ensure the API user has at least read access to the schema/fields endpoints.
  • Network/API Errors: Connectivity issues or incorrect API URLs can result in timeouts or connection errors.
    • Resolution: Verify the Directus instance URL and network connectivity from the n8n host.

Links and References

Discussion