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
The node integrates with the Directus API, a headless CMS and data platform. Specifically, for the Files resource with the Get operation, it retrieves metadata and details about a single file stored in Directus by its unique ID.
This is useful when you want to fetch information about a specific file managed in your Directus instance, such as its filename, size, type, or other metadata, without downloading the actual file content.
Practical example:
You have a workflow that processes user uploads stored in Directus. Using this node, you can retrieve detailed metadata about a particular file (e.g., an image or document) by providing its ID, then use that metadata downstream for logging, validation, or conditional processing.
Properties
| Name | Meaning |
|---|---|
| ID | The unique identifier of the file object in Directus. This is required to specify which file's details to retrieve. |
Output
- The output JSON contains the metadata of the requested file as returned by the Directus API. This typically includes fields like file ID, filename, filesize, MIME type, upload date, and any custom metadata associated with the file.
- The node does not return the binary content of the file in this operation; it only returns metadata.
- The output is structured as a single JSON object representing the file's data.
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 to perform operations.
- No additional external dependencies beyond the Directus API and proper authentication.
Troubleshooting
Common issues:
- Providing an invalid or non-existent file ID will result in an error from the Directus API indicating the file was not found.
- Authentication failures if the API key or credentials are incorrect or expired.
- Network connectivity issues preventing access to the Directus server.
Error messages:
"File not found"or similar HTTP 404 errors indicate the specified ID does not exist."Unauthorized"or HTTP 401 errors suggest problems with API credentials.- JSON parsing errors may occur if input parameters are malformed.
Resolutions:
- Verify the file ID is correct and exists in your Directus instance.
- Check and update the API key or authentication credentials.
- Ensure the Directus server URL is reachable from the n8n environment.