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, and deleting departments, managing users, sending messages, and handling media files.

The Create Department operation under the WeChat Work resource allows users to create a new department within their WeChat Work organization by providing the department details in JSON format. This is useful for automating organizational structure management, syncing external HR systems, or dynamically managing teams and departments based on workflow triggers.

Practical example:
A company uses n8n to automate onboarding processes. When a new team is created in their HR system, this node can automatically create a corresponding department in WeChat Work, ensuring communication channels are properly organized without manual intervention.


Properties

Name Meaning
Department Data The department information provided as a JSON object. This includes fields like name, parent ID, order, etc., required to create the department in WeChat Work.

Note: The property expects valid JSON representing the department's attributes according to WeChat Work API specifications.


Output

The node outputs an array of JSON objects, each representing the response from the WeChat Work API for the create department request. The exact structure depends on the WeChat Work API response but typically includes:

  • id: The unique identifier of the newly created department.
  • Other metadata confirming creation success or error details if applicable.

If the operation fails and "Continue On Fail" is enabled, the output will contain an error message in the JSON field describing the failure.

No binary data output is produced by this operation.


Dependencies

  • Requires an API key credential for the external N8N Tools API service used for validation (optional; if not found, validation is skipped).
  • Uses the internal WeChatApi helper class to interact with WeChat Work APIs.
  • Proper authentication credentials for WeChat Work must be configured in n8n to authorize API calls.
  • The node sends HTTP requests to the WeChat Work API endpoints via the helper class.

Troubleshooting

  • Invalid subscription or API key error:
    If the node throws an error about invalid subscription or API key during validation, verify that the API key credential for the external validation service is correctly set up and active.

  • Malformed JSON in Department Data:
    Since the department data must be valid JSON, ensure the input is correctly formatted. Invalid JSON will cause parsing errors.

  • WeChat Work API errors:
    Errors returned from the WeChat Work API (e.g., permission denied, invalid parameters) will be surfaced in the node output. Check the department data fields against WeChat Work API documentation to ensure correctness.

  • Missing or incorrect credentials:
    Ensure that the WeChat Work credentials configured in n8n have sufficient permissions to create departments.


Links and References


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

Discussion