WeChat Enhanced icon

WeChat Enhanced

WeChat Enhanced Node - Suporte completo para Mini Programs, Official Accounts, WeChat Pay e WeChat Work

Overview

The WeChat Work - Update User operation allows updating the information of an existing user in a WeChat Work (enterprise WeChat) environment. This node is useful for automating user management tasks such as modifying user details like name, department, contact info, or other profile attributes within an organization's WeChat Work account.

Typical scenarios include:

  • Synchronizing employee data from an HR system to WeChat Work.
  • Automating updates when users change departments or roles.
  • Bulk updating user profiles based on external triggers or workflows.

For example, you might use this node to update a user's phone number or department after receiving updated employee information from your internal database.

Properties

Name Meaning
User Data JSON object containing the user information fields to update. Must be valid JSON format.

The User Data property expects a JSON string representing the user details to update. The exact structure depends on WeChat Work's API requirements but typically includes fields like userid, name, department, mobile, etc.

Example of User Data JSON:

{
  "userid": "zhangsan",
  "name": "Zhang San",
  "department": [1, 2],
  "mobile": "13800000000"
}

Output

The node outputs an array of JSON objects, each corresponding to one input item processed. Each output JSON contains the response from the WeChat Work API for the update user request.

Typical output JSON structure includes:

  • Success confirmation or error details returned by the WeChat Work API.
  • For example, a successful update might return { "errcode": 0, "errmsg": "updated" }.
  • If an error occurs, the output may contain an error message describing the issue.

No binary data is output by this operation.

Dependencies

  • Requires an active connection to the WeChat Work API via credentials configured in n8n.
  • Uses an API key credential for validation with an external service ("N8N Tools API") if available; otherwise, it skips validation.
  • The node relies on the bundled wechat-api module to interact with WeChat Work endpoints.

Troubleshooting

  • Invalid JSON in User Data: Ensure the User Data field contains valid JSON. Malformed JSON will cause parsing errors.
  • Authentication Errors: If the node throws errors related to authentication, verify that the WeChat Work API credentials are correctly set up and have sufficient permissions.
  • API Validation Failures: If the external API key validation fails with 401 or 403 status, check the subscription status and API key correctness.
  • Unsupported Operation Error: This node only supports the "updateUser" operation under the "WeChat Work" resource. Using other operations here will cause errors.
  • Network Issues: Connectivity problems with WeChat Work API endpoints can cause timeouts or failures; ensure network access is available.

Links and References

Discussion