Actions4
- Material Actions
- Draft Actions
Overview
This node integrates with the WeChat Official Account API to manage draft articles and publish them. Specifically, the Publish Draft operation allows users to take a previously created draft (identified by its media ID) and publish it as an official article on their WeChat public account.
Common scenarios where this node is beneficial include:
- Automating the publishing workflow of WeChat articles after review or approval.
- Scheduling posts by creating drafts first and publishing them later.
- Integrating WeChat content publishing into broader marketing automation pipelines.
For example, a user can create multiple draft articles in advance, then use this node to publish selected drafts automatically based on triggers or schedules.
Properties
| Name | Meaning |
|---|---|
| Media ID | The unique identifier (media_id) of the draft article that you want to publish. This is required to specify which draft to publish. |
Output
The node outputs a JSON object representing the response from the WeChat API after attempting to publish the draft. Typically, this includes information about the success or failure of the publish request, such as error codes or confirmation data.
No binary data output is produced by this operation.
Example output structure (simplified):
{
"errcode": 0,
"errmsg": "ok",
"msg_id": 1234567890
}
errcode: Numeric code indicating success (0) or type of error.errmsg: Text message describing the result.msg_id: Identifier for the published message (if successful).
Dependencies
- Requires an active connection to the WeChat Official Account API.
- Needs an API authentication token credential configured in n8n to authorize requests.
- The node uses internal helper functions to make HTTP requests to WeChat endpoints.
Troubleshooting
Common issues:
- Invalid or expired API tokens will cause authentication failures.
- Providing an incorrect or non-existent
media_idwill result in errors indicating the draft cannot be found. - Network connectivity problems may cause request timeouts or failures.
Error messages:
"invalid credential": Means the API token is invalid or expired; refresh or reauthenticate your credentials."media_id not found": The specified draft does not exist or has been deleted; verify themediaIdinput.- Other WeChat API error codes should be checked against WeChat's official documentation for resolution steps.