Overview
This node sends messages to a DingTalk robot via its webhook URL. It supports sending either plain text or markdown-formatted messages, with options to mention specific users or all users in the chat. Additionally, it can operate in a JSON mode where the user constructs the entire message payload manually.
Common scenarios for this node include:
- Automating notifications from workflows to DingTalk groups.
- Sending alerts or status updates with rich formatting using markdown.
- Mentioning specific users or everyone in the group to draw attention.
- Customizing message payloads fully by enabling JSON mode for advanced use cases.
Example: Automatically send a markdown alert with a title and detailed content to a DingTalk group, mentioning all members.
Properties
Name | Meaning |
---|---|
Webhook | The DingTalk robot webhook URL to which the message will be sent. |
accessToken | The access token required for authenticating the request to DingTalk. |
是否使用JSON格式数据模式 (enableJsonMode) | Whether to enable JSON mode, allowing manual construction of the entire message payload. |
数据内容 (jsonData) | The full JSON message payload when JSON mode is enabled. |
是否@所有人 (isAtAll) | Whether to mention all users in the message (only applicable when JSON mode is disabled). |
被@人的用户Userid (atUserIds) | Comma-separated list of user IDs to mention in the message (only when JSON mode is disabled and not mentioning all). |
消息类型 (msgtype) | Message type, either "text" or "markdown" (only when JSON mode is disabled). |
消息内容 (content) | Text content of the message (required if msgtype is "text" and JSON mode is disabled). |
消息标题 (title) | Title of the markdown message, shown as preview in conversations (required if msgtype is "markdown" and JSON mode is disabled). |
Markdown格式的消息 (markdownText) | Markdown formatted message content (required if msgtype is "markdown" and JSON mode is disabled). |
Output
The node outputs the JSON response returned by the DingTalk API after sending the message. This typically includes information about the success or failure of the request.
No binary data output is produced by this node.
Dependencies
- Requires an active DingTalk robot webhook URL.
- Requires an access token for authentication with DingTalk's API.
- The node makes HTTP POST requests to the DingTalk webhook endpoint.
- No additional external dependencies beyond standard HTTP request capabilities.
Troubleshooting
- Error: "msgtype为空" — This error occurs if the message type is missing in the constructed payload. Ensure that the
msgtype
property is set correctly when JSON mode is disabled, or that the JSON payload includes a validmsgtype
. - Authentication failures — Verify that the provided access token and webhook URL are correct and have the necessary permissions.
- Invalid JSON payload — When using JSON mode, ensure the JSON structure matches DingTalk's expected format.
- Mentioning users — If mentions do not work, check that the user IDs are correct and properly comma-separated.
- Network issues — Confirm that the n8n instance has internet access to reach DingTalk's servers.