Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Overview

This node is designed to create or upload files to a system that manages file objects. It supports uploading files either by sending binary data directly or by providing additional JSON metadata describing the file. This functionality is useful in scenarios where you need to programmatically add new files to a content management system, digital asset manager, or any platform that organizes files with associated metadata.

Practical examples include:

  • Uploading images or documents from an external source into a CMS.
  • Automating file imports as part of a workflow that processes and stores user-generated content.
  • Creating file entries with custom metadata for later retrieval or processing.

Properties

Name Meaning
Send Binary Data Boolean option to specify whether the file should be uploaded using binary data.
Binary Property The name(s) of the binary property or properties containing the actual file data to be uploaded. Multiple properties can be specified separated by commas.
Additional Fields A collection of extra fields representing other properties of the file object in JSON format. These allow setting metadata according to the file object specification.

Output

The node outputs JSON data representing the created or uploaded file object. This JSON includes all relevant file metadata as returned by the underlying API or service, such as file ID, filename, size, type, and any additional properties provided.

If binary data is sent, the node handles the upload process but does not output the binary itself; instead, it outputs the metadata about the uploaded file.

Dependencies

  • Requires access to an API or service endpoint capable of handling file uploads and file object creation.
  • Needs appropriate authentication credentials (e.g., an API key or token) configured in n8n to authorize file creation/upload operations.
  • The node depends on bundled methods and routing logic internally to handle the execution flow.

Troubleshooting

  • Issue: File upload fails or returns an error.

    • Cause: Incorrect binary property name or missing binary data.
    • Resolution: Verify that the binary property name matches exactly the name of the binary data input. Ensure the binary data exists and is correctly formatted.
  • Issue: Additional fields JSON is malformed.

    • Cause: Invalid JSON syntax in the "File Object (JSON)" field.
    • Resolution: Use a JSON validator to ensure the JSON is well-formed before inputting it.
  • Issue: Authentication errors.

    • Cause: Missing or invalid API credentials.
    • Resolution: Check that the required API key or authentication token is properly configured in n8n.

Links and References

Discussion