Actions100
- Activity Actions
- Asset Actions
- Authentication Actions
- Collection Actions
- Extension Actions
- Field Actions
- File Actions
- Folder Actions
- Item Actions
- Permission Actions
- Preset Actions
- Relation Actions
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
Overview
The Directus node for n8n, when configured with the Resource: Field and Operation: List All, retrieves a list of all fields (schema definitions) from the Directus instance. This operation is useful for dynamically inspecting or documenting the structure of collections in your Directus project, automating schema audits, or integrating field metadata into other workflows.
Practical examples:
- Automatically generating documentation for all fields in your Directus instance.
- Building dynamic forms or UI elements based on available fields.
- Auditing or synchronizing schema information between environments.
Properties
Name | Type | Meaning |
---|---|---|
Split Into Items | Boolean | If enabled, each field from the result array will be output as a separate item; otherwise, all fields are returned in a single item. |
Output
- The node outputs data under the
json
property. - The structure of the output depends on the "Split Into Items" option:
- If enabled: Each output item contains a single field object from Directus.
- If disabled: A single output item contains an array of all field objects.
- Each field object typically includes properties such as:
collection
: The collection this field belongs to.field
: The name of the field.type
: The data type of the field.- Additional metadata (e.g., interface, options, readonly, required, etc.) as provided by Directus.
Example output (Split Into Items = false):
{
"json": [
{
"collection": "articles",
"field": "title",
"type": "string",
"...": "..."
},
{
"collection": "articles",
"field": "content",
"type": "text",
"...": "..."
}
// ...more fields
]
}
Example output (Split Into Items = true):
{
"json": {
"collection": "articles",
"field": "title",
"type": "string",
"...": "..."
}
}
Dependencies
- Directus API: Requires access to a running Directus instance.
- API Credentials: You must configure the
directusApi
credentials in n8n for authentication.
Troubleshooting
- Authentication errors: Ensure that the Directus API credentials are correctly set up in n8n.
- Connection issues: Verify network connectivity to the Directus server.
- Empty results: If no fields are returned, check that your Directus instance has collections and fields defined, and that your user has permission to view them.
- Error messages: Any error thrown by the Directus API (such as 401 Unauthorized, 403 Forbidden, or 500 Internal Server Error) will be surfaced in the output if "Continue On Fail" is enabled, or will stop execution otherwise.