Directus (DrWade) icon

Directus (DrWade)

Consume Directus API

Roles → Get

AI-generated

Overview

The Directus (DrWade) node for n8n allows you to interact with the Directus API. Specifically, when using the Roles resource and the Get operation, this node retrieves detailed information about a specific role in your Directus instance by its unique identifier.

Common scenarios:

  • Fetching details of a user role for workflow logic or conditional branching.
  • Auditing or displaying role information in dashboards or reports.
  • Integrating role data into other systems or processes.

Practical example:
You might use this node to look up the permissions and metadata associated with a particular role before assigning users or making access decisions in an automated workflow.


Properties

Name Type Meaning
ID String Primary key of the role. Used to identify which role's details to retrieve.

Output

The output will be a single object in the json field containing all available details about the requested role. The structure is determined by the Directus API and typically includes fields such as:

{
  "id": "c86c2761-65d3-43c3-897f-6f74ad6a5bd7",
  "name": "Administrator",
  "icon": "user-shield",
  "description": "Full access to all resources.",
  "admin_access": true,
  "app_access": true,
  "users": [...],
  "permissions": [...],
  ...
}

Note: The actual fields may vary depending on your Directus setup.


Dependencies

  • Directus API: You must have a running Directus instance accessible from n8n.
  • API Credentials: The node requires valid Directus API credentials configured in n8n under the name directusApi.

Troubleshooting

Common issues:

  • Invalid Role ID: If the provided ID does not exist, the node will return an error message indicating that the role was not found.
  • Authentication Errors: If the API credentials are missing or incorrect, you may receive authentication or authorization errors.
  • Network Issues: Connectivity problems between n8n and the Directus server can cause request failures.

Error messages and resolutions:

  • "Role not found": Double-check the ID value; ensure it matches an existing role in Directus.
  • "401 Unauthorized" or "403 Forbidden": Verify your API credentials and permissions.
  • "ENOTFOUND" or timeout errors: Ensure the Directus API URL is correct and reachable from your n8n instance.

Links and References

Discussion