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 integrates with various WeChat services, including Mini Programs, Official Accounts, WeChat Pay, and WeChat Work. Specifically, for the WeChat Work resource and the Create Department operation, this node allows users to create a new department within their WeChat Work organization.

This operation is useful in scenarios where an organization wants to programmatically manage its internal structure by adding departments dynamically based on business logic or external triggers. For example, when onboarding a new team or restructuring company divisions, this node can automate the creation of corresponding departments in WeChat Work.

Properties

Name Meaning
Department Data JSON object containing the details of the department to be created. This should include all necessary fields as required by the WeChat Work API for creating a department.

Example value for Department Data might look like:

{
  "name": "Marketing",
  "parentid": 1,
  "order": 1,
  "id": 2
}

(Note: The exact structure depends on WeChat Work API requirements.)

Output

  • The output is a JSON object representing the response from the WeChat Work API after attempting to create the department.
  • It typically includes information such as the newly created department's ID and any status messages returned by the API.
  • No binary data output is involved in this operation.

Example output snippet:

{
  "errcode": 0,
  "errmsg": "created",
  "id": 2
}

Dependencies

  • Requires an active subscription and valid API key for the external "N8N Tools API" service, which acts as a proxy/validation layer before calling WeChat APIs.
  • Requires credentials for accessing the WeChat Work API (e.g., an API authentication token).
  • The node uses the bundled wechat-api module internally to interact with WeChat Work endpoints.
  • Proper configuration of these credentials in n8n is necessary for successful execution.

Troubleshooting

  • Invalid Subscription or API Key: If the node throws an error indicating invalid subscription or API key, verify that the API key credential configured in n8n is correct and active.
  • Malformed Department Data: Errors may occur if the JSON provided in the "Department Data" property does not conform to the expected schema by WeChat Work API. Validate the JSON format and required fields.
  • API Permission Issues: Ensure that the WeChat Work account used has sufficient permissions to create departments.
  • Network or Timeout Errors: Check network connectivity and API endpoint availability.
  • Error Messages: The node surfaces errors from both the validation step and the WeChat Work API call. Review the error message for clues and consult WeChat Work API documentation for specific error codes.

Links and References


This summary focuses exclusively on the "WeChat Work" resource and the "Create Department" operation as requested.

Discussion