Directus icon

Directus

Consume Directus API

Overview

This node integrates with the Directus API to perform various operations on different resources. Specifically, for the Folders resource with the Get operation, it retrieves detailed information about a single folder by its unique ID.

Use cases include:

  • Fetching metadata or properties of a specific folder in a Directus-managed file system.
  • Integrating folder data retrieval into automated workflows, such as syncing folder info or validating folder existence before further processing.

Example: You want to get details about a folder with ID 0fca80c4-d61c-4404-9fd7-6ba86b64154d to check its name, parent folder, or other metadata before uploading files into it.

Properties

Name Meaning
ID The unique identifier of the folder to retrieve. This is required and should be a valid folder ID string.

Output

The output is a JSON object representing the folder's data as returned by the Directus API. It typically includes all folder properties such as its ID, name, parent folder reference, creation date, and any other metadata managed by Directus.

No binary data is output for this operation.

Example output structure (simplified):

{
  "id": "0fca80c4-d61c-4404-9fd7-6ba86b64154d",
  "name": "My Folder",
  "parent": null,
  "created_on": "2023-01-01T12:00:00Z",
  "modified_on": "2023-01-10T15:30:00Z",
  // ... other folder metadata fields
}

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; thus, the Directus server must be accessible from where n8n runs.
  • No additional external dependencies beyond the Directus API and n8n's HTTP request capabilities.

Troubleshooting

  • Invalid or missing ID: If the folder ID is not provided or invalid, the API will return an error. Ensure the ID is correct and exists in your Directus instance.
  • Authentication errors: If the API key or credentials are incorrect or expired, requests will fail with authentication errors. Verify your API credentials.
  • Network issues: Connectivity problems between n8n and the Directus server can cause timeouts or failures.
  • Folder not found: If the specified folder ID does not exist, the API returns a not found error. Confirm the folder ID is correct.
  • API rate limits: Excessive requests may trigger rate limiting on the Directus server.

To resolve errors, check the error message returned in the node output, verify credentials, and confirm the folder ID and network connectivity.

Links and References

Discussion