Wechat Official Account Node icon

Wechat Official Account Node

Wechat Official Account Node

Overview

This node integrates with the WeChat Official Account platform, enabling users to manage custom menus programmatically. Specifically, the "菜单" (Menu) resource with the "创建" (Create) operation allows users to create a new custom menu for their official account by providing the menu structure in JSON format.

Common scenarios include:

  • Automating the deployment of custom menus when updating a WeChat Official Account.
  • Managing multiple menu configurations across different accounts or environments.
  • Quickly testing new menu layouts without manual intervention in the WeChat dashboard.

For example, a user can supply a JSON object defining buttons and sub-buttons according to WeChat's custom menu specification, and this node will send that configuration to WeChat to create the menu.

Properties

Name Meaning
*菜单格式 The JSON structure defining the custom menu. It must follow the format specified by WeChat's official documentation: https://developers.weixin.qq.com/doc/offiaccount/Custom_Menus/Creating_Custom-Defined_Menu.html

Output

The node outputs an array of JSON objects representing the response from the WeChat API after attempting to create the menu. Each item corresponds to one input item processed.

  • The json field contains the API response data, which typically includes success confirmation or error details.
  • No binary data output is produced by this node.

Dependencies

  • Requires an active connection to the WeChat Official Account API.
  • Needs an API authentication token or key configured in n8n credentials to authorize requests.
  • The node depends on internal helper modules for resource and operation management but no external npm packages beyond those bundled with n8n.

Troubleshooting

  • Common issues:

    • Invalid JSON structure for the menu format may cause API errors.
    • Missing or incorrect API credentials will result in authentication failures.
    • Network connectivity problems can prevent communication with WeChat servers.
  • Error messages:

    • Errors thrown during execution include descriptive messages from the WeChat API or internal node errors.
    • If the node encounters an error and "Continue On Fail" is enabled, it will return an error object per failed item instead of stopping execution.
  • Resolution tips:

    • Validate the JSON menu format against WeChat's official schema before running the node.
    • Ensure API credentials are correctly set up and have necessary permissions.
    • Check network access and proxy settings if applicable.

Links and References

Discussion