Directus icon

Directus

Consume Directus API

Overview

The Directus node for n8n, when configured with the Resource: Extension and Operation: List, allows users to retrieve a list of installed extensions from a Directus instance. Extensions in Directus can be of various types, such as Displays, Interfaces, Layouts, or Modules. This operation is useful for automation scenarios where you need to audit, document, or dynamically interact with the available extension types in your Directus environment.

Practical examples:

  • Automatically generating documentation or reports about which extensions are installed.
  • Building conditional workflows that depend on the presence of certain extension types.
  • Monitoring changes in installed extensions over time.

Properties

Name Type Meaning
Type options The category of extension to list (Displays, Interfaces, Layouts, Modules).
Split Into Items boolean If enabled, outputs each extension as a separate item; otherwise, returns an array.

Output

  • The output is provided in the json field.
  • If Split Into Items is enabled, each output item contains a single extension object.
  • If not enabled, the output is a single item containing an array of extension objects.
  • The structure of each extension object depends on the Directus API response for the selected type, but typically includes properties such as name, type, and other metadata relevant to the extension.

Example output (for Split Into Items = true):

[
  {
    "json": {
      "name": "my-custom-display",
      "type": "display",
      // ...other extension-specific fields
    }
  },
  {
    "json": {
      "name": "another-display",
      "type": "display"
      // ...other extension-specific fields
    }
  }
]

Example output (for Split Into Items = false):

[
  {
    "json": [
      {
        "name": "my-custom-display",
        "type": "display"
        // ...other extension-specific fields
      },
      {
        "name": "another-display",
        "type": "display"
        // ...other extension-specific fields
      }
    ]
  }
]

Dependencies

  • Directus API: Requires access to a running Directus instance.
  • API Credentials: You must configure the directusApi credentials in n8n to authenticate requests.

Troubleshooting

  • Invalid Credentials: If the API credentials are incorrect or missing, the node will throw an authentication error. Ensure the directusApi credential is set up correctly in n8n.
  • Network Issues: If n8n cannot reach the Directus server, you may see connection errors. Check network connectivity and firewall settings.
  • Unknown Extension Type: If an invalid value is provided for the "Type" property, the API may return an error or an empty result. Use only the supported options.
  • Unexpected Output Structure: The structure of extension objects may change if Directus updates its API. Always refer to the current Directus API documentation for details.

Links and References

Discussion