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 list fields of a specified collection. It is useful when you want to retrieve metadata about the fields defined in a particular collection within your Directus project. For example, you might use this node to dynamically fetch field definitions for building forms, validating data, or generating reports based on the schema.
In practical scenarios, this node helps automate workflows that depend on the structure of your Directus collections without hardcoding field names or types.
Properties
| Name | Meaning |
|---|---|
| Collection | The name of the collection whose fields you want to list. This is a required option. |
| Split Into Items | Boolean flag indicating whether to output each field as a separate item or as a single array. |
Output
- The node outputs JSON data representing the fields of the specified collection.
- If "Split Into Items" is set to
true, each field object is output as an individual item. - Otherwise, all fields are output together in a single JSON array.
- The JSON objects contain metadata about each field, such as its name, type, and other attributes as returned by the Directus API.
- This node does not output binary data.
Dependencies
- Requires a valid connection to a Directus instance via an API key credential configured in n8n.
- The node uses the Directus REST API endpoint
/fields/{collection}to fetch the fields. - No additional environment variables are needed beyond the API authentication setup.
Troubleshooting
Common issues:
- Invalid or missing collection name will cause the API request to fail.
- Network connectivity problems or incorrect API credentials will result in authentication errors.
- If the collection does not exist or the user lacks permissions, the API will return an error.
Error messages:
- Errors from the Directus API are propagated; typical messages include "Collection not found" or "Unauthorized".
- To resolve, verify the collection name is correct, ensure the API key has sufficient permissions, and check network access to the Directus server.