Directus icon

Directus

Consume Directus API

Overview

The Directus node for n8n, when configured with the Resource: Revisions and Operation: Get, retrieves detailed information about a specific revision from a Directus instance. This is useful in scenarios where you need to audit, review, or process changes made to items within your Directus-managed data collections.

Common use cases:

  • Fetching the details of a particular revision for auditing purposes.
  • Integrating revision history into approval workflows.
  • Displaying change logs or version histories in dashboards.

Example:
You want to retrieve all metadata and changes associated with revision ID 368 to display who made the change, what was changed, and when.


Properties

Name Type Meaning
ID String Primary key of the revision to be retrieved.

Output

The output will be a single object in the json field containing all available data for the specified revision. The structure of this object depends on the Directus API's response for a revision, but typically includes fields such as:

{
  "id": "368",
  "activity": "...",
  "collection": "...",
  "item": "...",
  "parent": "...",
  "data": { /* ... */ },
  "delta": { /* ... */ },
  "user": "...",
  "timestamp": "...",
  // ...other revision-specific fields
}
  • All properties returned by the Directus /revisions/{id} endpoint are included.
  • No binary data is produced by this operation.

Dependencies

  • Directus API: You must have access to a running Directus instance.
  • API Credentials: The node requires valid Directus API credentials (configured in n8n as directusApi).

Troubleshooting

Common issues:

  • Invalid ID: If the provided revision ID does not exist, the node will return an error message indicating that the revision could not be found.
  • Authentication errors: If the API credentials are missing or invalid, you may receive authentication/authorization errors.
  • Network issues: Connectivity problems between n8n and the Directus server can cause request failures.

Error messages and resolutions:

  • "Revision not found": Double-check the ID value; ensure the revision exists in Directus.
  • "401 Unauthorized" or "403 Forbidden": Verify your API credentials and user permissions.
  • "Network Error": Ensure the Directus instance is reachable from your n8n environment.

Links and References

Discussion