Wechat Work Node icon

Wechat Work Node

Wechat Work Node

Overview

This node integrates with a WeChat Work (企业微信) environment to create new user members within an enterprise. It is designed for managing organizational users by adding their details such as user ID, name, department affiliations, contact information, and other profile attributes.

Common scenarios where this node is beneficial include:

  • Automating the onboarding process of new employees by programmatically creating their accounts in WeChat Work.
  • Synchronizing user data from HR systems or other databases into WeChat Work.
  • Managing large-scale user provisioning without manual input through the WeChat Work API.

Practical example:

  • When a new employee joins, this node can be used to create their WeChat Work account with all relevant details like department, position, mobile number, and email, enabling immediate communication and collaboration within the enterprise.

Properties

Name Meaning
*成员UserID Unique identifier for the member's account within the enterprise. Must be 1-64 bytes, composed of digits, letters, and characters "_-@.". The first character must be a digit or letter. Case-insensitive uniqueness check.
*成员名称 Member's full name, length between 1 and 64 UTF-8 characters.
成员别名 Alias or nickname for the member, 1-64 UTF-8 characters.
手机号码 Mobile phone number, must be unique within the enterprise. Either mobile or email must be provided.
成员所属部门列表 List of departments the member belongs to (up to 100). Each entry includes: Department ID (required), order (number), and whether the member is the leader in that department (boolean). If empty or department ID is 0, member goes to "Other" department.
职务信息 Position or job title of the member.
性别 Gender of the member. Options: 男性 (1), 女性 (2). Default is 男性 (1).
邮箱 Email address of the member.
企业邮箱 Enterprise email address.
座机 Landline telephone number.
直属上级列表 List of direct leaders (supervisors) within the enterprise. Maximum one leader can be set.
成员头像的Mediaid Media ID of the member's avatar image, obtained via media management interface.
地址 Address of the member.
是否主部门 Boolean indicating if the specified department is the main department for the member. Default is true.
启用/禁用成员 Boolean to enable or disable the member account. Default is enabled (true).
是否邀请成员使用企业微信 Boolean indicating whether to invite the member to use WeChat Work. Default is true.
额外属性 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 each user creation attempt. Each output item corresponds to an input item processed.

  • The json field contains the response data from the WeChat Work API regarding the created member.
  • In case of errors during processing, the output will contain an error field describing the issue for that particular item.
  • This node does not output binary data.

Dependencies

  • Requires valid credentials for accessing the WeChat Work API, including an API key or token with permissions to create users.
  • The node expects configuration of these credentials in n8n prior to execution.
  • Network access to the WeChat Work API endpoint is necessary.

Troubleshooting

  • Error: 未实现方法 (Not Implemented Method) — This error indicates that the requested resource-operation combination is not supported by the node. Verify that you have selected the correct Resource ("用户管理") and Operation ("创建成员").
  • API Authentication Errors — Ensure that the API credentials are correctly configured and have sufficient permissions.
  • Validation Errors on Input Fields — For example, UserID format violations or missing required fields like UserID or Name will cause failures. Double-check input values against the property requirements.
  • Department Not Found — If a specified department ID does not exist, the system will place the member under "Other (待设置部门)" or create a new department there. Confirm department IDs are accurate to avoid unexpected placements.
  • Continue On Fail Behavior — If enabled, the node will continue processing subsequent items even if some fail, returning error details per failed item.

Links and References

Discussion