Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Overview

The node is designed to interact with a "Collection" resource, specifically to list collections. It retrieves a list of collections from an external service or database. This operation is useful when you want to fetch and process multiple collections in workflows, such as displaying available collections, filtering them, or using their data downstream.

A practical example would be automating the retrieval of all collections from a content management system to synchronize or analyze their metadata.

Properties

Name Meaning
Split Into Items Whether to output each element of the returned array as its own individual item (true/false).

Output

The node outputs a JSON field containing the list of collections retrieved. If the "Split Into Items" property is set to true, each collection will be output as a separate item; otherwise, the entire list is output as a single item.

No binary data output is indicated by the source code.

Dependencies

  • The node depends on an external API or service that manages collections.
  • It requires appropriate authentication credentials (e.g., an API key or token) configured in n8n to access the collections.
  • The bundled code references external modules for version description, methods, and routing logic, indicating modular design but no additional external dependencies beyond the API.

Troubleshooting

  • Common issues:

    • Authentication failures due to missing or invalid API credentials.
    • Network connectivity problems preventing access to the external service.
    • Empty or unexpected responses if the collections resource is empty or the API endpoint changes.
  • Error messages:

    • Errors related to authorization typically indicate misconfigured or missing API keys.
    • Timeout or connection errors suggest network issues.
    • Parsing errors may occur if the response format changes unexpectedly.

To resolve these, verify API credentials, check network connectivity, and ensure the external service's API has not changed.

Links and References

  • Refer to the external service's official API documentation for collections listing.
  • Consult n8n documentation on setting up API credentials and handling list operations.

Discussion