Actions25
Overview
This node is designed to update a member's information within a user management system, specifically for an enterprise environment. It allows modifying various attributes of a user such as their ID, name, contact details, department affiliations, position, and status. This node is beneficial in scenarios where organizations need to keep their internal user directory up-to-date, synchronize employee data with external systems, or automate user profile maintenance.
Practical examples include:
- Updating an employee’s phone number or email after a change.
- Changing the department or role of a user when they are promoted or transferred.
- Enabling or disabling a user account based on employment status.
- Setting a user's manager or leader within the organizational hierarchy.
Properties
| Name | Meaning |
|---|---|
| *成员UserID (userid) | The unique identifier for the user account within the enterprise system. Must be 1-64 characters long, consisting of digits, letters, and the characters _ - @ .. The first character must be a digit or letter. |
| 成员名称 (name) | The full name of the member, between 1 and 64 UTF-8 characters. |
| 成员别名 (alias) | An alias or nickname for the member, 1 to 64 UTF-8 characters. |
| 手机号码 (mobile) | The mobile phone number of the member. Must be unique within the enterprise. Either mobile or email must be provided. |
| 成员所属部门列表 (department) | A list of departments the member belongs to. Each entry includes department ID (required), order (sort priority), and whether the member is a leader in that department. Up to 100 departments can be specified. If empty or zero, the member is placed in a default "other" department. |
| 职务信息 (position) | The job title or position of the member. |
| 性别 (gender) | Gender of the member. Options: 男性 (male) = 1, 女性 (female) = 2. |
| 邮箱 (email) | Email address of the member. |
| 企业邮箱 (biz_mail) | Corporate email address of the member. |
| 座机 (telephone) | Landline telephone number. |
| 直属上级列表 (direct_leader) | List of direct leaders (managers) for the member within the enterprise. Can specify up to one leader by UserID. |
| 成员头像的Mediaid (avatar_mediaid) | Media ID referencing the member’s avatar image, obtained via a media upload interface. |
| 地址 (address) | Physical address of the member. |
| 是否主部门 (main_department) | Boolean indicating if the specified department is the member’s main department. Defaults to true. |
| 启用/禁用成员 (enable) | Boolean to enable or disable the member’s account. Defaults to enabled (true). |
| 是否邀请成员使用企业微信 (to_invite) | Boolean indicating whether to invite the member to use the enterprise WeChat service. Defaults to true. |
| 额外属性 (json) | JSON object for additional extended properties such as external profiles or positions. |
Output
The node outputs an array of JSON objects representing the result of the update operation for each input item. Each output item corresponds to an input item and contains either the updated user data or an error message if the update failed.
If the update fails for any item and the node is configured to continue on failure, the output will include an error field describing the issue.
No binary data output is indicated.
Dependencies
- Requires an API key credential for authentication with the enterprise user management backend.
- The node internally uses HTTP requests to communicate with the backend API.
- Proper configuration of the API base URL, corporate ID, and secret (or equivalent credentials) is necessary.
- The node depends on helper utilities for request handling and metadata construction.
Troubleshooting
Common issues:
- Invalid or missing UserID: The UserID must be unique and follow the specified format; otherwise, the update will fail.
- Missing required fields: At least one of mobile or email must be provided.
- Department IDs that do not exist may cause the user to be assigned to a default "other" department.
- Incorrect or expired API credentials will cause authentication failures.
Error messages:
- Errors returned from the backend API will be propagated as node errors with descriptive messages.
- If the node is set to continue on failure, errors will appear in the output JSON under an
errorproperty.
Resolution tips:
- Verify all required fields are correctly filled.
- Ensure API credentials are valid and have sufficient permissions.
- Check department IDs exist in the system before assigning.
- Use the node’s logging/debugging features to trace request and response details.
Links and References
- Enterprise user management API documentation (specific to the backend system used).
- n8n documentation on creating and using custom nodes.
- General best practices for managing user directories and synchronization.