Directus (denkhaus) icon

Directus (denkhaus)

Consume Directus API

Overview

The "Preset - Create Multiple" operation in this custom n8n node allows users to create multiple preset objects in a single workflow execution. This is particularly useful when you need to batch-create user interface presets for different collections or users within a Directus instance. For example, you might use this node to set up default views and layouts for several users or collections at once, streamlining the onboarding process or automating workspace configuration.

Practical Example:
Suppose you are setting up a new project in Directus and want to predefine how various users see different collections (e.g., files, articles) with specific layouts and search filters. You can use this node to send an array of such configurations, creating all necessary presets in one go.

Properties

Name Meaning
Data (JSON) An array of partial preset objects. Each object should define properties like collection, user, layout, and optionally search.

Output

  • The output will be a JSON array containing the created preset objects as returned by the Directus API.
  • Each item in the output corresponds to a successfully created preset, reflecting the structure and fields defined in the Directus preset object documentation.
  • No binary data is produced by this operation.

Dependencies

  • Directus API: Requires access to a Directus instance with appropriate permissions to create presets.
  • Authentication: Typically requires an API key or valid credentials configured in n8n for the Directus node.

Troubleshooting

  • Invalid JSON Input: If the "Data (JSON)" property is not a valid JSON array, the node may throw a parsing error. Ensure your input matches the expected format.
  • Missing Required Fields: Each preset object must include required fields such as collection and user. Omitting these may result in API errors from Directus.
  • Permission Denied: If the API credentials do not have permission to create presets, you may receive an authorization error from Directus.
  • API Connectivity Issues: Network problems or incorrect Directus endpoint configuration can cause connection errors.

Links and References

Discussion