DingTalk AI Agent Plugin for OpenClaw
Deploy OpenClaw AI agents to DingTalk with streaming, multi-account support, and enterprise access controls. Production-ready TypeScript plugin.
Originally published:
DingTalk Integration for OpenClaw AI Framework
OpenClaw DingTalk is a production-ready channel plugin that bridges DingTalk (钉钉), Alibaba's enterprise communication platform used by millions of organizations in Asia, with OpenClaw's AI agent framework. It enables seamless deployment of AI conversational agents directly into DingTalk workspaces, supporting direct messages, group chats, and advanced rendering modes.
Purpose and Significance
DingTalk is the dominant workplace communication platform in China and Asia-Pacific, with tight integration into enterprise workflows. This plugin eliminates the barrier between OpenClaw's AI capabilities and DingTalk-native organizations, allowing teams to deploy intelligent assistants directly where employees already work. Unlike lightweight integrations, openclaw-dingtalk supports real-time streaming responses, intelligent message rendering, vision-capable image handling, and session-based conversation management—critical for enterprise AI adoption.
Core Features
- Stream Mode Connection: WebSocket-based communication with automatic reconnection and exponential backoff for reliable long-running conversations
- Multi-Channel Support: Direct messages, group chats, and configurable access policies (pairing, open, allowlist)
- AI Card Streaming: Real-time response streaming via DingTalk ActionCards with typewriter effect, powered by gateway SSE integration
- Smart Message Rendering: Auto-detection of content type (code blocks, tables, images) with fallback to plain text, ActionCard, or Markdown modes
- Vision-Ready Media Handling: Inbound image downloading and forwarding to AI agents; automatic upload of agent-generated images to DingTalk
- Session Management: Per-user and per-group session isolation with configurable 30-minute timeouts and automatic cleanup
- Multi-Account Support: Run multiple DingTalk bots (sales-bot, support-bot, etc.) from a single plugin instance with independent credentials
- Custom Commands: Built-in commands (/help, /status, /new, /reset) plus user-defined slash commands with flexible actions
- Context Injection: DingTalk metadata (chat type, sender info, admin status, @mentions) automatically passed to agent context
- Per-Group Configuration: Different system prompts, skills, and behaviors per group or per-user within groups
- Message Deduplication: 5-minute TTL window to prevent duplicate processing of retransmitted messages
- Enterprise Access Control: Granular policies for DM access, group access, and session scope isolation
Getting Started
Installation requires OpenClaw installed locally. Use the plugin installer:
openclaw plugins install @adongguo/dingtalk
Setup Steps:
- Create an Enterprise Internal Application in DingTalk Developer Console
- Enable Robot capability and select Stream mode (WebSocket, not webhook)
- Retrieve AppKey and AppSecret from Basic Information page
- Configure OpenClaw with credentials:
openclaw config set channels.dingtalk.appKey "dingXXXXX"openclaw config set channels.dingtalk.appSecret "your_secret"openclaw config set channels.dingtalk.enabled true - Publish the application (at minimum to test version) to activate the bot
- Optional: Configure advanced settings (render mode, session timeout, gateway token for streaming)
See the official README for detailed configuration schema, including per-group prompts, skill injection, and multi-account examples.
Who It's For
- Enterprise Teams in Asia: Organizations using DingTalk as their primary communication platform who want AI assistants integrated without separate chat platforms
- OpenClaw Developers: Builders extending OpenClaw with channel plugins or deploying multi-channel AI agents
- Conversational AI Teams: Teams building customer support bots, internal knowledge assistants, or specialized domain agents
- DevOps and SRE: Operations teams deploying on-call bots, incident response assistants, or infrastructure query agents
Technical Highlights
Render Modes: The auto mode intelligently selects between plain text (simple replies), ActionCard (for code/tables/images), and Markdown depending on content. This ensures optimal presentation without manual intervention.
Gateway Integration: For real-time AI Card streaming, configure a gateway token and port. This enables progressive response rendering—users see responses appear word-by-word rather than waiting for full completion.
Access Control Layers: DM policy (pairing/open/allowlist) and group policy (open/allowlist/disabled) provide enterprise-grade access governance. Optional allowFrom lists and per-user configuration add granularity.
Session Isolation: Conversations respect group boundaries (per-group mode) or isolate per-user (per-user mode), critical for multi-tenant scenarios and privacy compliance.
Configuration Options at a Glance
connectionMode: "stream" (recommended) or "webhook"renderMode: "auto" (default), "raw", or "card"dmPolicy: "pairing", "open", "allowlist"groupPolicy: "open", "allowlist", "disabled"groupSessionScope: "per-group" (shared) or "per-user" (isolated)sessionTimeout: Default 30 minutes (1800000 ms)mediaMaxMb: Max inbound image size, default 30 MBaiCardMode: "enabled" (streaming) or "disabled"showThinking: Display processing indicator before responsesystemPrompt: Global agent instructions (overridable per-group/per-user)
License and Community
Released under MIT license. The project is actively maintained with recent updates (February 2026) and has a growing community of enterprise deployments. Open issues and pull requests are welcome.
Related Resources
- Antfarm: Multi-Agent Workflow Orchestration for OpenClaw — Core AI agent framework
- DingTalk Developer Platform — Official documentation and developer console
- GitHub Repository — Source code, issues, and contribution guidelines
Original Source
https://github.com/adongguo/openclaw-dingtalk
Last updated: