Wechat Work Node icon

Wechat Work Node

Wechat Work Node

Overview

This node integrates with a WeChat Work (企业微信) API to manage organizational departments. Specifically, the "创建部门" (Create Department) operation allows users to create a new department within the organization's hierarchy. This is useful for automating the setup and management of company structures in WeChat Work, ensuring that departments are properly organized and synchronized with other systems.

Practical examples include:

  • Automatically creating new departments when onboarding new teams.
  • Synchronizing department structures from an HR system into WeChat Work.
  • Managing hierarchical relationships between departments programmatically.

Properties

Name Meaning
部门名称 The name of the department. Must be unique at the same level. Length must be 1 to 64 UTF-8 characters. Cannot include: `* ? " < >
英文名称 English name of the department. Also must be unique at the same level. Requires multi-language support enabled in admin backend. Length 1 to 64 characters, excluding `* ? " < >
父部门ID Parent department ID as a 32-bit integer. Specifies under which department this new one will be created.
次序值 Order value within the parent department. Departments with higher order values appear first. Valid range: [0, 2^32).
部门ID Department ID as a 32-bit integer. If specified, must be greater than 1. If omitted, the system auto-generates an ID.

Output

The node outputs JSON data representing the result of the create department operation. This typically includes details about the newly created department such as its ID and status. The output is structured as an array of JSON objects, each corresponding to an input item processed.

No binary data output is indicated.

Dependencies

  • Requires an API key credential for authenticating with the WeChat Work API.
  • Needs network access to the WeChat Work API endpoints.
  • The node depends on internal resource and operation modules dynamically loaded from the resource directory.
  • Proper configuration of credentials with valid corporate ID and secret is necessary.

Troubleshooting

  • Common issues:

    • Duplicate department names at the same hierarchy level will cause errors.
    • Invalid characters in department names may lead to request rejection.
    • Incorrect or missing parent department ID can cause failures.
    • Specifying a department ID less than or equal to 1 will be invalid.
    • Network or authentication errors if API credentials are incorrect or expired.
  • Error messages:

    • "未实现方法: 部门管理.创建部门" ("Unimplemented method") indicates the requested resource-operation pair is not supported or incorrectly configured.
    • API errors returned from WeChat Work will be surfaced as error messages; check the message for details like invalid parameters or permission issues.
  • Resolutions:

    • Ensure department names are unique and valid.
    • Verify parent department IDs exist and are correct.
    • Confirm API credentials are valid and have required permissions.
    • Enable multi-language support in the admin backend if using English names.

Links and References

Discussion