Directus icon

Directus

Consume Directus API

Overview

The Directus n8n node, when configured with the Folder resource and the Get operation, retrieves detailed information about a specific folder from a Directus instance using its unique ID. This is useful for workflows that need to fetch metadata or properties of a folder stored in Directus, such as organizing files, managing digital assets, or automating content management tasks.

Practical examples:

  • Fetching folder details to display or use in subsequent workflow steps.
  • Validating the existence or properties of a folder before uploading files.
  • Integrating Directus folder data into other systems or reports.

Properties

Name Type Meaning
ID String Unique ID of the folder object to retrieve.

Output

The output will be a single item in the json field containing the folder's details as returned by the Directus API. The structure typically includes (but is not limited to):

{
  "id": "string",
  "name": "string",
  "parent": "string or null",
  "created_on": "string (ISO date)",
  "created_by": "string",
  "updated_on": "string (ISO date)",
  "updated_by": "string",
  // ...other folder metadata fields depending on your Directus setup
}
  • If the folder is not found or an error occurs, and "Continue On Fail" is enabled, the output will contain an error property with the error message.

Dependencies

  • Directus API: Requires access to a running Directus instance.
  • API Credentials: You must configure the node with valid Directus API credentials (directusApi).
  • n8n Configuration: No special environment variables are required beyond standard credential setup.

Troubleshooting

Common issues:

  • Invalid ID: If the provided folder ID does not exist, the node will return an error indicating the folder was not found.
  • Authentication errors: If credentials are missing or invalid, you may receive authentication/authorization errors from Directus.
  • Network issues: Connectivity problems between n8n and Directus can cause request failures.

Error messages and resolutions:

  • "Folder not found": Check that the ID is correct and the folder exists in Directus.
  • "Unauthorized" or "Forbidden": Ensure your API credentials have permission to read folders.
  • "Network Error": Verify network connectivity and Directus server availability.

Links and References


Discussion