WeChat Enhanced icon

WeChat Enhanced

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

Overview

The "WeChat Enhanced" node provides comprehensive integration with various WeChat services, including Mini Programs, Official Accounts, WeChat Pay, and WeChat Work. Specifically, for the WeChat Work resource, the node supports operations such as creating, updating, deleting users, sending messages, managing departments, and uploading media.

The Create User operation under the WeChat Work resource allows you to create a new user in your WeChat Work organization by providing user details in JSON format. This is useful for automating user management workflows, such as onboarding new employees or synchronizing user data from other systems into WeChat Work.

Practical example:
You can use this node to automatically add new employees to your company's WeChat Work directory when they are added to your HR system, ensuring that communication channels are ready without manual intervention.


Properties

Name Meaning
User Data User data in JSON format containing all necessary fields to create a new WeChat Work user

The User Data property expects a JSON object describing the user's attributes according to WeChat Work's API requirements (e.g., userid, name, department, position, mobile, email, etc.).


Output

  • The node outputs an array of JSON objects, each representing the response from the WeChat Work API for the create user request.
  • The JSON output typically contains confirmation of the created user or error information if the creation failed.
  • No binary data output is produced by this operation.

Example output snippet (conceptual):

{
  "errcode": 0,
  "errmsg": "created",
  "userid": "new_userid"
}

Dependencies

  • Requires an active subscription and valid API key credentials for the external "N8N Tools API" service used for validation.
  • Requires proper authentication credentials configured in n8n to access the WeChat Work API.
  • The node internally uses a helper class (WeChatApi) to interact with WeChat Work endpoints.
  • The userData must be provided in valid JSON format matching WeChat Work API specifications.

Troubleshooting

  • Invalid subscription or API key error:
    If the node throws errors related to invalid subscription or API key during the initial validation step, verify that your API key credential is correctly set up and has the required permissions.

  • JSON parsing errors:
    Ensure that the User Data JSON is well-formed and includes all mandatory fields required by WeChat Work's create user API.

  • API errors from WeChat Work:
    Errors returned by the WeChat Work API (e.g., user ID already exists, missing required fields) will be surfaced in the node output. Review the error message and adjust the input data accordingly.

  • Continue on Fail:
    If enabled, the node will continue processing subsequent items even if one fails, returning error details in the output JSON.


Links and References


This summary covers the static analysis of the node's execute logic for the WeChat Work resource's Create User operation based on the provided source code and properties.

Discussion