Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Overview

The node is designed to retrieve a single "Activity" record by its unique identifier (ID) from a data source. It allows users to specify which additional fields or metadata should be included in the response, providing flexibility in the amount of detail returned. This node is useful in scenarios where you need to fetch detailed information about a specific activity, such as auditing user actions, tracking changes, or displaying activity logs in an application.

Practical examples:

  • Fetching details of a user action by its ID to display in an admin dashboard.
  • Retrieving metadata about an activity for reporting or analytics purposes.
  • Getting selective fields of an activity to optimize data transfer and processing.

Properties

Name Meaning
ID The unique numeric identifier of the activity record to retrieve. Must be at least 1.
Additional Fields Optional collection to specify extra data to include in the response:
- Fields Comma-separated string controlling which fields of the activity object are returned.
- Meta String specifying what metadata related to the activity should be included in the output.

Output

The node outputs a JSON object representing the requested activity record. The structure includes the standard fields of the activity plus any additional fields or metadata specified in the input properties. The exact shape depends on the fields and meta options provided.

If binary data were involved (not indicated here), it would typically represent files or attachments related to the activity, but this node focuses on JSON data only.

Dependencies

  • Requires connection to the underlying data source or API that manages "Activity" records.
  • Needs appropriate authentication credentials (e.g., an API key or token) configured in n8n to access the service.
  • No other external dependencies are indicated in the provided code snippet.

Troubleshooting

  • Invalid ID: Providing an ID less than 1 or a non-numeric value may cause errors or no results. Ensure the ID is a positive integer.
  • Missing or incorrect authentication: If the API key or token is missing or invalid, the node will fail to retrieve data. Verify credentials are correctly set up.
  • Fields or Meta parameters misformatted: Incorrectly formatted strings in the additional fields may result in incomplete or failed responses. Use proper comma-separated values or valid metadata keys.
  • Record not found: If the specified ID does not exist, the node might return an empty response or an error indicating the resource was not found.

Links and References

  • Refer to the API documentation of the backend service managing activities for details on available fields and metadata options.
  • n8n documentation on creating and configuring nodes with input collections and dynamic fields.

Discussion