Directus (denkhaus) icon

Directus (denkhaus)

Consume Directus API

Overview

This n8n node is designed to update an existing file object in a Directus instance. It supports updating file metadata and optionally uploading new binary data to replace the file's contents. This node is useful when you need to programmatically manage files stored in Directus, such as updating file details or replacing files as part of automated workflows.

Common scenarios:

  • Updating file metadata (e.g., title, description) in Directus.
  • Replacing an existing file with a new version by uploading new binary data.
  • Automating file management tasks in content management or digital asset management systems.

Practical example:
You have a workflow that processes images and, after editing, needs to update the corresponding file record in Directus with the new image and updated metadata.

Properties

Name Type Meaning
Send Binary Data boolean Whether to upload/create a new file. If enabled, the node will expect binary data to be provided for the file update.
ID string Unique ID of the file object in Directus that you want to update.
Binary Property string Name of the binary property which contains the data for the file to be uploaded. For multiple files, values can be provided as a comma-separated list (e.g., binary1,binary2). Only shown if "Send Binary Data" is true.
Update Fields collection Additional fields to update on the file object. Allows specifying other properties of the file object as JSON.

Output

  • The output will contain a json field representing the updated file object from Directus.
  • If binary data was uploaded, the output will reflect the new file state but will not directly include the binary data itself—only its metadata and related information.
  • No direct binary output is produced; all outputs are in JSON format describing the file object.

Dependencies

  • Directus API: Requires access to a Directus instance.
  • Authentication: May require API keys or credentials configured in n8n for Directus access.
  • Binary Data: If uploading files, the input item must contain the specified binary property.

Troubleshooting

  • Missing File ID: If the "ID" property is empty or incorrect, the node will fail to find the file to update. Ensure the correct file ID is provided.
  • Binary Property Not Found: If "Send Binary Data" is enabled but the specified binary property does not exist in the input, the node will throw an error. Double-check the property name and ensure the binary data is present.
  • Invalid JSON in Update Fields: If the "File Object (JSON)" field contains invalid JSON, the node may fail. Validate your JSON before submitting.
  • Authentication Errors: If credentials are missing or incorrect, you may receive authentication or permission errors from Directus.

Links and References

Discussion