Actions100
- Activity Actions
- Asset Actions
- Authentication Actions
- Collection Actions
- Extension Actions
- Field Actions
- File Actions
- Folder Actions
- Item Actions
- Permission Actions
- Preset Actions
- Relation Actions
- Revision Actions
- Role Actions
- Setting Actions
- User Actions
- Utility Actions
Overview
This node updates an existing role in a Directus system. It is designed for scenarios where you need to modify properties of a user role, such as changing its icon, permissions, or other attributes. This is useful in automated workflows that manage user access levels, update role metadata, or synchronize roles with external systems.
Practical examples:
- Automatically updating the icon or description of a role when certain conditions are met.
- Integrating with HR systems to adjust user roles based on employee status changes.
- Bulk-updating role settings during migrations or organizational restructures.
Properties
Name | Meaning |
---|---|
Data (JSON) | A partial role object. Used to specify which fields of the role to update. Example: json { "icon": "attractions" } |
ID | Primary key of the role. The unique identifier (UUID) of the role you want to update. |
Output
The output will be a JSON object representing the updated role, reflecting the changes made by your input. The structure follows the Directus Role Object, and may include fields such as:
{
"id": "c86c2761-65d3-43c3-897f-6f74ad6a5bd7",
"name": "Editor",
"icon": "attractions",
"description": "Can edit content",
...
}
If the node supports binary data, it is not relevant for this operation.
Dependencies
- Requires access to a Directus instance.
- Authentication (such as API key or credentials) must be configured in n8n for the Directus node.
Troubleshooting
- Missing or invalid ID: If the provided ID does not correspond to an existing role, the node will likely return an error indicating that the resource was not found.
- Malformed Data (JSON): If the "Data (JSON)" property is not valid JSON or does not match the expected schema, you may receive a validation error from Directus.
- Insufficient Permissions: If the connected Directus account lacks permission to update roles, an authorization error will occur.