Directus icon

Directus

Consume Directus API

Overview

The Directus n8n node, when configured with the Users resource and the Get operation, retrieves detailed information about a specific user from a Directus instance using their unique ID. This is useful in workflows where you need to fetch user profile data for further processing, validation, or integration with other systems.

Practical scenarios:

  • Enriching workflow data with user details (e.g., email, roles, status).
  • Validating if a user exists before performing actions.
  • Fetching user metadata for reporting or notification purposes.

Properties

Name Type Meaning
ID String Primary key of the user to retrieve. Required. Example: 72a1ce24-4748-47de-a05f-ce9af3033727

Output

The output will be a single item in the json field containing all available properties of the requested user as returned by the Directus API. The structure typically includes fields such as:

{
  "id": "72a1ce24-4748-47de-a05f-ce9af3033727",
  "first_name": "John",
  "last_name": "Doe",
  "email": "[email protected]",
  "role": "...",
  "status": "active",
  ...
}
  • All standard and custom fields associated with the user in Directus will be present.
  • If the user does not exist or an error occurs, and "Continue On Fail" is enabled, the output will contain an error property with the error message.

Dependencies

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

Troubleshooting

Common issues:

  • Invalid or missing ID: If the provided ID does not correspond to any user, the node will return an error like User not found.
  • Authentication errors: Invalid or expired API credentials will result in authentication failures.
  • Insufficient permissions: The API user must have permission to read user data in Directus.

Error messages and resolutions:

  • "User not found": Check that the ID is correct and the user exists.
  • "Invalid credentials": Verify your Directus API credentials in n8n.
  • "Forbidden" or "Unauthorized": Ensure the API user has the necessary permissions.

Links and References

Discussion