Directus icon

Directus

Consume Directus API

Overview

This node integrates with the Directus API, a headless CMS and data platform. Specifically, for the Presets resource with the Get operation, it retrieves a single preset by its primary key (ID). This is useful when you want to fetch detailed information about a specific preset configuration stored in Directus.

Common scenarios:

  • Fetching a preset to apply or inspect its settings in an automation workflow.
  • Retrieving preset details for validation or conditional logic in a data pipeline.
  • Integrating Directus presets into other systems by extracting their configurations dynamically.

Practical example:
You have a preset saved in Directus that defines certain display or filter settings for your content. Using this node, you can retrieve that preset by ID and then use its data downstream in your workflow to customize how content is presented or processed.

Properties

Name Meaning
ID The unique identifier (primary key) of the preset to retrieve. This is required to specify which preset to get.

Output

The output contains a JSON object representing the retrieved preset's data as returned by the Directus API. The structure corresponds directly to the preset entity in Directus, including all its fields and metadata.

  • The output is provided under the json property of the item.
  • No binary data is produced by this operation.

Example output snippet (conceptual):

{
  "id": "39",
  "name": "Example Preset",
  "description": "A sample preset configuration",
  "settings": { /* preset-specific settings */ },
  "created_at": "2023-01-01T12:00:00Z",
  "updated_at": "2023-01-10T15:30:00Z"
}

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; thus, network access to the Directus server is necessary.
  • No additional external dependencies beyond the Directus API and n8n environment.

Troubleshooting

  • Invalid ID or Preset Not Found: If the specified ID does not exist, the node will throw an error indicating the preset could not be found. Verify the ID is correct and the preset exists in Directus.
  • Authentication Errors: Ensure the API key credential is valid and has sufficient permissions to read presets.
  • Network Issues: Connection failures or timeouts may occur if the Directus server is unreachable. Check network connectivity and endpoint URL.
  • Malformed Input: The ID must be a valid string matching the preset's primary key format.

If the node is set to continue on failure, errors will be returned in the output JSON under an error property instead of stopping execution.

Links and References

Discussion