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 to manage and retrieve metadata about fields within collections. Specifically, the "Fields" resource with the "Get" operation allows users to fetch detailed information about a specific field in a given collection by its unique field name.
Common scenarios where this node is beneficial include:
- Retrieving schema details for a particular field to understand its configuration or constraints.
- Dynamically inspecting field properties before performing data operations.
- Automating documentation or validation workflows based on field metadata.
Practical example:
- A user wants to get the metadata of the "title" field in the "articles" collection to check its data type and validation rules before updating content programmatically.
Properties
| Name | Meaning |
|---|---|
| Collection | The name of the collection containing the field. Options are dynamically loaded from the API. |
| Field | The unique name of the field within the specified collection. Options are dynamically loaded based on the selected collection. |
Output
The output JSON contains the metadata object of the requested field. This includes all properties describing the field's configuration as returned by the Directus API, such as its type, validation rules, default values, interface settings, and other relevant attributes.
Example output structure (simplified):
{
"field": "title",
"type": "string",
"interface": "text-input",
"required": true,
"default_value": null,
"options": { ... },
"validation": { ... }
}
No binary data output is produced by this operation.
Dependencies
- Requires an active connection to a Directus instance via an API key credential configured in n8n.
- The node uses the Directus REST API endpoints to fetch collections and fields metadata.
- Proper permissions on the Directus API are necessary to access collection and field information.
Troubleshooting
Common issues:
- Invalid or missing collection name: Ensure the collection exists and is correctly spelled.
- Invalid or missing field name: The field must exist uniquely within the specified collection.
- Authentication errors: Verify that the API key credential is valid and has sufficient permissions.
- Network or connectivity problems: Check the Directus server URL and network accessibility.
Error messages:
"Field not found"or similar: The specified field does not exist in the given collection."Collection not found": The collection name is invalid or inaccessible."Unauthorized"or"Forbidden": API credentials lack required permissions.
Resolution tips:
- Use the dynamic options loading feature to select valid collections and fields.
- Confirm API credentials and permissions in the Directus admin panel.
- Test connectivity to the Directus API endpoint outside n8n if needed.