Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Overview

The node's "Folder - Create Multiple" operation allows users to create multiple folder entries in a batch by providing an array of folder objects in JSON format. This is useful for organizing content or files into hierarchical structures programmatically, such as setting up project directories or categorizing assets in bulk.

A practical example would be creating several folders at once, some with specified parent folders and others as root-level folders, streamlining the setup process without needing to create each folder individually.

Properties

Name Meaning
Data (JSON) An array of partial folder objects to create. Each object must include a name property (string). Optionally, a parent property can specify the ID of the parent folder to nest under. The input should be valid JSON representing this array.

Example value:

[
  {
    "name": "Nature",
    "parent": "0fca80c4-d61c-4404-9fd7-6ba86b64154d"
  },
  {
    "name": "Cities"
  }
]

Output

The output will contain a JSON field representing the created folder objects. Each object corresponds to one folder created based on the input data, typically including properties like the folder's unique identifier, name, parent folder reference, and other metadata as defined by the external API's folder object schema.

If the node supports binary data output, it would relate to any file or media content associated with folders, but this operation focuses on folder metadata creation only.

Dependencies

  • Requires access to an external service that manages folders (likely a Directus instance or similar CMS).
  • Needs appropriate API authentication credentials configured in n8n to authorize folder creation requests.
  • The user must provide valid JSON input for the folders to be created.

Troubleshooting

  • Invalid JSON Input: If the provided JSON is malformed or missing required fields like name, the node will likely throw an error. Ensure the JSON is correctly formatted and includes all necessary properties.
  • Authentication Errors: Failure to authenticate with the external service will prevent folder creation. Verify that API keys or tokens are correctly set up.
  • Parent Folder Not Found: Specifying a non-existent parent folder ID may cause errors or result in folders being created at the root level. Confirm parent IDs exist.
  • API Rate Limits or Quotas: Creating many folders at once might hit service limits; consider batching requests if needed.

Links and References

Discussion