Directus (DrWade) icon

Directus (DrWade)

Consume Directus API

Overview

The Folders: Get operation in this n8n node retrieves detailed information about a specific folder from a Directus instance, using the folder's unique ID. This is useful when you need to fetch metadata or properties of a particular folder, such as its name, parent, or other custom fields.

Common scenarios:

  • Automating file management workflows where folder details are required for further processing.
  • Integrating with other systems that need to reference or display folder information stored in Directus.
  • Validating the existence or properties of a folder before performing additional actions (e.g., uploading files).

Practical example:
You have a workflow that organizes uploaded files into folders based on user input. Before moving a file, you use this operation to confirm the target folder exists and retrieve its metadata.


Properties

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

Output

The output will be a single json object containing all available data for the specified folder. The structure of this object depends on your Directus setup but typically includes:

{
  "id": "string",
  "name": "string",
  "parent": "string|null",
  "created_on": "string",
  "created_by": "string",
  "updated_on": "string",
  "updated_by": "string",
  // ... any other custom fields defined in your Directus folders collection
}
  • If the folder does not exist or an error occurs, and "Continue On Fail" is enabled, the output will contain an error field with the error message.

Dependencies

  • Directus API: You must have access to a running Directus instance.
  • API Credentials: The node requires valid Directus API credentials (directusApi) configured in n8n.

Troubleshooting

Common issues:

  • Invalid ID: If the provided folder ID does not exist, you'll receive an error message indicating the folder was not found.
  • Authentication errors: If the API credentials are missing or invalid, authentication errors will occur.
  • Insufficient permissions: The API user must have permission to read folders in Directus.

Error messages and resolutions:

  • "Folder not found": Check that the ID is correct and the folder exists.
  • "Unauthorized" or "Forbidden": Verify your API credentials and user permissions.
  • "Network Error": Ensure the Directus instance is reachable from your n8n server.

Links and References

Discussion