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
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
Overview
The Directus n8n node's "Users" resource with the "Update" operation allows you to update an existing user in your Directus instance. This is useful for automating user management tasks, such as updating user roles, contact information, or other profile details from within your workflows.
Common scenarios:
- Automatically updating user profiles based on changes in another system (e.g., CRM, HR software).
- Bulk updating user attributes as part of a data migration or synchronization process.
- Managing user permissions or metadata programmatically.
Practical example:
If a user's job title changes in your HR system, you can use this node to update their corresponding Directus user record automatically.
Properties
Name | Type | Meaning |
---|---|---|
ID | String | Primary key of the user. This uniquely identifies which user will be updated. |
Data (JSON) | JSON | A partial user object. Contains the fields and values to update for the user. |
Output
- The output will be a single item with a
json
field containing the updated user object as returned by the Directus API. - The structure of the output matches the Directus user object, including only the fields that were updated and any additional fields returned by the API.
Example output:
{
"id": "72a1ce24-4748-47de-a05f-ce9af3033727",
"title": "CTO",
"first_name": "Jane",
"last_name": "Doe",
// ...other user fields
}
Dependencies
- Directus API: You must have access to a running Directus instance.
- API Credentials: The node requires valid Directus API credentials configured in n8n under the name
directusApi
.
Troubleshooting
Common issues:
- Invalid User ID: If the provided ID does not match any user, the API will return an error.
- Malformed Data (JSON): If the JSON is invalid or contains fields that do not exist in the user schema, the request may fail.
- Insufficient Permissions: The API credentials used must have permission to update users in Directus.
Error messages and resolutions:
"User not found"
: Check that the ID is correct and exists in Directus."Invalid JSON"
: Ensure the Data (JSON) property is properly formatted."Permission denied"
: Verify the API credentials have the necessary rights.