Actions33
- Mini Program Actions
- WeChat Pay Actions
- Official Account Actions
- WeChat Work Actions
Overview
The node provides enhanced integration with WeChat services, supporting multiple WeChat platforms including Mini Programs, Official Accounts, WeChat Pay, and WeChat Work. Specifically for the Official Account resource with the Upload Media operation, this node allows users to upload various types of media files (such as images, voice, video, thumbnails, or generic files) to a WeChat Official Account.
This functionality is beneficial in scenarios where you want to programmatically manage media assets on your Official Account, such as uploading images for use in messages, videos for content sharing, or other media types required by your WeChat Official Account workflows.
Practical example:
A marketing automation workflow could use this node to upload an image file (base64 encoded) to the Official Account media library, then use the returned media ID to send image messages or create rich content posts.
Properties
| Name | Meaning |
|---|---|
| Media Type | The type of media being uploaded. Options: Image, Voice, Video, Thumb, File |
| Media | The media file data encoded in base64 format. This is the actual content of the media file |
Output
The output JSON contains the response from the WeChat Official Account API after uploading the media. Typically, this includes metadata about the uploaded media such as a media ID that can be used in subsequent operations (e.g., sending messages referencing the media).
If the node supports binary data output (not explicitly shown here), it would represent the uploaded media or related binary content, but in this case, the media is input as base64 and the output is JSON metadata.
Dependencies
- Requires an active subscription and valid API key credential for the external "N8N Tools API" service, which acts as a proxy or validation layer for WeChat API calls.
- Requires proper credentials configured in n8n for accessing WeChat Official Account APIs.
- The media content must be provided as a base64 encoded string.
- The node internally uses a helper class (
WeChatApi) to interact with WeChat endpoints.
Troubleshooting
Invalid subscription or API key error:
If the node throws an error indicating invalid subscription or API key, verify that the API key credential for the external service is correctly set up and has the necessary permissions.Base64 decoding issues:
Ensure the media property contains valid base64 encoded data. Invalid encoding will cause upload failures.Unsupported media type errors:
Only the specified media types (image, voice, video, thumb, file) are supported. Using unsupported types will result in errors.API rate limits or quota exceeded:
The underlying WeChat API may enforce rate limits; if uploads fail repeatedly, check your account's API usage limits.