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
Presets → Create
AI-generatedOverview
The Directus (DrWade) n8n node for the resource Presets with the operation Create allows users to create a new preset in a Directus instance. Presets in Directus are used to store user interface preferences, such as default filters, layouts, and search queries for collections or views.
Common scenarios:
- Automating the setup of user-specific or role-based UI presets when onboarding new users.
- Programmatically managing and deploying consistent UI configurations across multiple Directus environments.
- Integrating preset creation into larger workflows, such as after creating new collections or roles.
Practical example:
When a new user is added to Directus, you can use this node to automatically create a personalized dashboard layout or set default filters for that user.
Properties
| Name | Type | Meaning |
|---|---|---|
| Data (JSON) | json | A partial preset object. This should contain the configuration for the preset, such as user ID, layout type, search query, etc. |
Output
- The output will be a
jsonobject representing the newly created preset as returned by the Directus API. - The structure of the output will match the Directus Preset Object, typically including fields like:
iduserrolecollectionlayoutsearchfilterslayout_querybookmark- ...and other preset-related properties.
Example output:
{
"id": 1,
"user": "410b5772-e63f-4ae6-9ea2-39c3a31bd6ca",
"layout": "cards",
"search": "Directus",
"filters": null,
"layout_query": null,
"bookmark": false,
...
}
Dependencies
- Directus API: Requires access to a running Directus instance.
- API Credentials: You must configure the
directusApicredentials in n8n with appropriate permissions to create presets.
Troubleshooting
Common issues:
- Invalid JSON in Data (JSON): If the input is not valid JSON, the node will throw an error. Ensure your JSON is properly formatted.
- Missing required fields: The Directus API may require certain fields in the preset object (e.g.,
user,layout). Check the Directus documentation for required fields. - Insufficient permissions: If the API credentials do not have permission to create presets, the request will fail with an authorization error.
- Error handling: If an error occurs and "Continue On Fail" is enabled, the output will include an
errorfield with the error message.
Typical error messages:
Invalid JSON: Check your Data (JSON) property for syntax errors.403 Forbiddenor401 Unauthorized: Verify your API credentials and permissions.400 Bad Request: Review the preset object for missing or invalid fields.