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
This node integrates with the Directus API to manage folders within a Directus project. Specifically, the "Create Multiple" operation under the "Folders" resource allows users to create multiple folder objects in one API call by providing an array of folder data.
This operation is beneficial when you need to batch-create several folders at once, for example:
- Organizing assets or files into multiple categorized folders programmatically.
- Migrating or syncing folder structures from another system into Directus.
- Automating folder creation workflows where multiple folders are needed simultaneously.
Users provide an array of partial folder objects (at minimum including the name property), and the node sends this data to Directus to create all specified folders in bulk.
Properties
| Name | Meaning |
|---|---|
| Data (JSON) | An array of partial folder objects to create. Each object must include at least the name property. Optionally, a parent property can specify the parent folder ID. The input should be valid JSON representing an array of such objects. Example: json [ { "name": "Nature", "parent": "0fca80c4-d61c-4404-9fd7-6ba86b64154d" }, { "name": "Cities" } ] |
Output
The output is an array of JSON objects, each representing a folder object as returned by the Directus API after creation. Each object contains the properties of the created folder, typically including its unique identifier, name, parent folder reference (if any), and other metadata managed by Directus.
No binary data output is produced by this operation.
Dependencies
- Requires a valid connection to a Directus instance via an API key credential configured in n8n.
- The node uses the Directus REST API endpoint for folders (
POST /folders) to perform the creation. - Proper permissions on the Directus API are necessary to create folders.
Troubleshooting
- Invalid JSON Input: If the "Data (JSON)" property contains malformed JSON, the node will fail. Ensure the JSON is correctly formatted and represents an array of objects.
- Missing Required Fields: Each folder object must have a
nameproperty. Omitting this will cause the API to reject the request. - Permission Errors: Insufficient API permissions to create folders will result in authorization errors. Verify that the API key has the required scopes.
- Parent Folder Not Found: Specifying a
parentfolder ID that does not exist or is inaccessible will cause errors. Confirm parent folder IDs are valid. - API Connectivity Issues: Network problems or incorrect Directus URL/credentials will prevent successful API calls.
If the node throws errors, check the error message for clues, validate inputs, and ensure the Directus API is reachable and credentials are correct.
Links and References
- Directus Folder Object Reference: https://docs.directus.io/reference/api/system/folders/#the-folder-object
- Directus API Documentation (Folders): https://docs.directus.io/reference/api/system/folders/
- Directus Official Website: https://directus.io/