Clawdbot WeChat Work Gateway Plugin
WeChat Work integration for Clawdbot with message queuing, health monitoring, and dynamic agent management for enterprises.
Originally published:
WorkWeixin Gateway for Clawdbot: Enterprise WeChat Integration
Clawd-gateway-wework is a dedicated channel plugin that bridges Clawdbot with WeChat Work (企业微信), enabling enterprises to interact with AI-powered agents directly through their existing corporate communication infrastructure. This integration replaces the need for external messaging platforms like Telegram, allowing organizations to maintain security and compliance within their WeChat Work ecosystem.
Core Capabilities
The plugin provides a comprehensive set of features designed for production enterprise environments:
- Message Transport: Send and receive text messages, Markdown-formatted content, and template-based notifications through WeChat Work callbacks
- Account Management: Multi-account configuration with pairing approval workflows and user allowlisting for access control
- Reliability Layer: Built-in message queue with exponential backoff retry logic, message chunking for large payloads, and circuit breaker pattern to prevent cascading failures
- Performance Optimization: HTTP connection pooling, request caching, rate limiting (configurable, default 60 requests/minute), and batch operation handling
- Observability: Health checks monitoring API connectivity, memory usage, and queue depth; comprehensive logging system; metrics collection for request counts, success/failure rates, and response times
- Agent Isolation: Dynamic agent instance creation per user or group, ensuring isolated execution contexts
- WebHook Infrastructure: Secure callback handling with token validation and AES encryption support for message integrity
Getting Started
Installation: Add the plugin via npm with npm install clawd-gateway-wework.
Configuration: Define credentials in config.yaml or environment variables:
WORKWEIXIN_CORP_ID– Your WeChat Work organization IDWORKWEIXIN_CORP_SECRET– API authentication secretWORKWEIXIN_AGENT_ID– Target agent application IDWORKWEIXIN_CALLBACK_TOKEN– Webhook verification tokenWORKWEIXIN_ENCODING_AES_KEY– Message encryption key
Webhook Setup: Register the callback URL in WeChat Work application settings at https://your-domain.com/webhooks/workweixin.
Launching: Start the channel with clawdbot start --channels workweixin, then verify status and send test messages using built-in CLI commands.
Architecture & Implementation
The plugin follows a modular structure separating concerns across dedicated modules: the API client handles WeChat Work REST interactions, the provider manages outbound message delivery, the callback processor handles inbound events, and monitoring/routing modules provide cross-cutting observability. Advanced features like the message queue, rate limiter, and circuit breaker are implemented as middleware layers, allowing transparent injection into message flows without modifying core logic.
Session routing via session-key enables per-user/group agent state management, critical for multi-tenant deployments. The health check system continuously validates API connectivity and queue depth, enabling automatic recovery or manual intervention when degradation is detected.
Who Should Use This
This plugin is ideal for:
- Enterprise Teams: Organizations already deployed on WeChat Work seeking AI agent capabilities without introducing external platforms
- Compliance-Focused Organizations: Companies requiring data residency within corporate infrastructure (avoiding cloud-based messaging platforms)
- Multi-Agent Deployments: Teams managing multiple specialized agents that need isolated execution contexts and user-based routing
- High-Volume Environments: Operations handling significant message throughput benefiting from built-in queue, batching, and rate-limiting infrastructure
Project Status & Roadmap
The project achieved substantial maturity at v0.2.0 (released January 31, 2026) with 20 iterative enhancements completing core functionality. Completed features include text/template/Markdown messaging, message queuing with retry, health monitoring, and dynamic agent management. Planned additions include media message support (images, videos, files), group messaging, onboarding wizards, message reactions, and thread support.
The codebase is actively maintained with 143 commits and demonstrates production-readiness through comprehensive error handling, monitoring instrumentation, and configuration flexibility.
Development & Contribution
The project uses JavaScript/TypeScript with standard build tooling. Build with npm run build, test with npm test, and develop with npm run dev for file-watching development. The repository actively welcomes issues and pull requests; see CONTRIBUTING.md for guidelines. The plugin is distributed under the MIT License.
Resources
- Repository: github.com/lohasle/clawd-gateway-wework
- Documentation: README.md (English) and README_CN.md (Chinese) with architecture diagrams and configuration examples
- Contributing: CONTRIBUTING.md outlines development workflow and contribution standards
- Related: ClawdBot Task Tracking Dashboard | Open Source for the parent framework, message-queuing for understanding queue patterns, enterprise-integration for deployment guidance
Original Source
https://github.com/lohasle/clawd-gateway-wework
Last updated: