Directus (denkhaus) icon

Directus (denkhaus)

Consume Directus API

Overview

The Folder → Create Multiple operation in this custom n8n node allows users to create several folders at once within a Directus instance. This is particularly useful for bulk organization tasks, such as setting up project structures or importing large sets of categorized data. For example, you might use this node to quickly create multiple folders like "Nature" and "Cities" in your media library.

Properties

Name Type Meaning
Data (JSON) json An array of partial folder objects. Each object must include at least the name property. Optionally, you can specify a parent folder by its ID. This property defines which folders will be created.

Output

  • The output will be a JSON array containing the details of each folder that was created.
  • Each item in the output corresponds to a folder object as defined by the Directus API.
  • If binary data is returned (unlikely for this operation), it would represent file attachments or similar content related to folders.

Dependencies

  • Directus API: Requires access to a Directus instance with appropriate permissions to create folders.
  • API Key / Authentication: You may need to configure authentication credentials (such as an API token) in n8n to connect to your Directus instance.

Troubleshooting

  • Common Issues:
    • Invalid JSON Input: If the "Data (JSON)" property is not a valid JSON array, the node will fail. Ensure your input matches the expected format.
    • Missing Required Fields: Each folder object must have a name. Omitting this will result in an error from the Directus API.
    • Permission Denied: If your API credentials lack permission to create folders, the operation will fail.
  • Error Messages:
    • "Invalid JSON": Check your input for syntax errors.
    • "Missing required field: name": Make sure every folder object includes a name.
    • "Unauthorized" or "Forbidden": Verify your API credentials and permissions.

Links and References

Discussion