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, specifically enabling operations on various Directus resources. For the Presets resource with the Create Multiple operation, it allows users to create multiple preset objects in a single API call. This is useful when you want to batch-create several presets at once, saving time and reducing the number of API requests.
Practical scenarios include:
- Initializing a Directus project with a set of predefined UI or collection presets.
- Migrating or syncing presets from another system by bulk importing them.
- Automating the setup of user-specific or collection-specific layouts and filters in Directus.
Properties
| Name | Meaning |
|---|---|
| Data (JSON) | An array of partial preset objects to be created. Each object should conform to the Directus preset object structure. Example: json [ { "collection": "directus_files", "user": "410b5772-e63f-4ae6-9ea2-39c3a31bd6ca", "layout": "cards", "search": "Directus" }, { "collection": "articles", "user": "410b5772-e63f-4ae6-9ea2-39c3a31bd6ca", "layout": "tabular" } ] |
Output
The output is an array of JSON objects representing the created preset records as returned by the Directus API. Each item corresponds to one preset that was created. The structure matches the Directus preset object format, including fields such as id, collection, user, layout, search, and any other properties defined in the preset.
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 endpoints for presets (
POST /presets). - Proper permissions are required on the Directus side to create presets.
Troubleshooting
- Invalid JSON in Data property: If the JSON array provided in the "Data (JSON)" property is malformed, the node will throw a parsing error. Ensure the JSON syntax is correct.
- API authentication errors: If the API key or credentials are invalid or missing, the node will fail to authenticate. Verify the API credentials configuration.
- Permission denied: If the authenticated user lacks permission to create presets, the API will return an authorization error.
- Partial failure: If some preset objects in the array are invalid, the entire request might fail. Validate each preset object against the Directus API requirements.
- Network issues: Connectivity problems to the Directus server will cause request failures.
To resolve errors, check the error message returned by the node, verify credentials, validate input JSON, and ensure the Directus API endpoint is reachable.
Links and References
- Directus Presets API documentation: https://docs.directus.io/reference/api/system/presets/#the-preset-object
- Directus API general docs: https://docs.directus.io/reference/api/
- n8n HTTP Request node documentation (for understanding API calls): https://docs.n8n.io/nodes/n8n-nodes-base.httpRequest/