WeCom Integration: Add an AI Assistant to Your Work Group Chats
💡 One-sentence summary: use OpenClaw to create an AI colleague living inside WeCom — install the Tencent WeCom plugin, configure Bot mode to join group chats, and allow the wecom-cli business tools.
Lesson one on the office track. You chose this path in Scenario Hands-On: Choose Your Path, and this lesson plugs Claw into a real workplace: WeCom direct chats and work groups. OpenClaw WeCom integration relies on the @wecom/wecom-openclaw-plugin plugin — maintained by the Tencent WeCom team and listed in the OpenClaw official channel catalog, with native support for direct and group chats, streaming replies, and WeCom business operations like to-dos, schedules, and meetings. All examples are based on OpenClaw v2026.10.9.
What You'll Be Able to Do After This Lesson
- Ask the AI assistant questions in WeCom direct chats and group chats, receiving streaming replies with a "thinking" placeholder
- Have it directly operate WeCom to-dos, schedules, meetings, online docs, WeDrive, contacts, and other 12 categories of business objects
- Use group allowlists + sender allowlists to control who can use it and which groups it can join
- (Advanced) Set up Agent mode so scheduled morning reports are proactively pushed by department, tag, or group
Why OpenClaw Instead of a Web-Based AI?
| Capability | Web-Based AI | OpenClaw + WeCom Plugin |
|---|---|---|
| Where it appears | ❌ A separate webpage, unusable in group chats | ✅ Right inside WeCom direct/group chats — just talk to it |
| Reply experience | ❌ Nothing shows until the whole response is generated | ✅ Streaming replies + "thinking" placeholder (Bot mode) |
| WeCom business operations | ❌ Can't touch to-dos/schedules/meetings/WeDrive | ✅ wecom-cli covers mail, docs, to-dos, schedules, meetings, WeDrive, contacts |
| Reaches out to you | ❌ Only responds when you ask first | ✅ Scheduled tasks proactively push to users/groups/departments/tags |
| Data and models | ❌ All conversations sit with the service provider | ✅ Gateway runs on your own machine, swap models freely (including domestic models) |
Your Current Pain Points
- Team knowledge is scattered across dozens of groups and documents; ask "what did last week's meeting decide" and nobody can answer fully
- Repetitive work like daily reports, meeting minutes, and to-do assignments eats one or two hours of your day
- You don't dare paste internal company data into public web AI pages, but colleagues genuinely need a handy AI
When to Use This Approach
When you need:
- An AI assistant that lives directly inside WeCom — colleagues can use it just by typing in the chat window, no new tools to install
- It can conveniently create to-dos, book schedules, read meeting minutes, and search documents
- Morning reports/daily reports pushed into the group on a schedule
And you don't want:
- Switching to a browser every time and copy-pasting in a web page
- Entrusting company conversations to a third-party hosted service
- Writing your own WeCom callback service from scratch
🎒 Preparation Before You Start
- Completed Scenario Hands-On: Choose Your Path: the Gateway is running and at least one model is connected
openclaw --versionshows 2026.3.28 or above (the plugin README's environment requirement; this tutorial's baseline v2026.10.9 satisfies it)- An account that can create an agent bot on the WeCom side — both the Bot ID and Secret come from WeCom; see the entry point in official integration guide
- A cup of water ☕ — in 15 minutes your work group will gain an AI colleague
Follow Along With Me
Step 1: Install the OpenClaw WeCom Plugin (wecom-openclaw-plugin)
Why: The WeCom channel is not part of the OpenClaw core installation — it's an external plugin; only after installing it will the Gateway recognize wecom as a channel.
Option A: WeCom official CLI wizard (recommended) — installs the plugin and completes configuration automatically; use it for upgrades too:
npx -y @wecom/wecom-openclaw-cli installOption B: OpenClaw channel catalog installation — install a pinned version from the official catalog:
openclaw channels add --channel wecomOption C: Manually install the plugin package:
openclaw plugins install @wecom/wecom-openclaw-pluginYou should see: installation completes with no errors. If Option A fails, retry with --force: npx -y @wecom/wecom-openclaw-cli install --force.
💡 Take a quick look at version compatibility
The plugin README notes specifically: for OpenClaw 2026.3.22 and above, the plugin requires 2026.3.24 and above; for OpenClaw below 2026.3.22, keep the plugin at 2026.3.20. This tutorial is based on v2026.10.9, so just install the latest plugin directly.
- The install command completes without errors
Step 2: Create a WeCom bot and get the Bot ID and Secret
Why: Bot mode (WebSocket) is the fastest way to get things running—you only need the two credentials botId and secret, with no public URL and no callbacks to deal with.
How: Follow the official WeCom guide to create an AI agent bot and get the Bot ID and Secret:
Details like credentials, connection mode, and callback routing are handled by the plugin; defer to the plugin package documentation (matching the version you installed).
Interactive configuration (enter the Bot ID and Secret when prompted):
openclaw channels addYou should see: the wizard prompts for the bot credentials, and after you enter them the configuration is written.
Step 3: Configure Bot mode and restart the Gateway
Why: WebSocket is the default connection method (connectionMode: "websocket"), with long-polling auto keep-alive and reconnection, so you don't need to configure any callbacks.
openclaw config set channels.wecom.botId <YOUR_BOT_ID>
openclaw config set channels.wecom.secret <YOUR_BOT_SECRET>
openclaw config set channels.wecom.enabled true
openclaw gateway restartYou should see: the Gateway restarts without errors, and openclaw channels status --channel wecom shows the wecom channel online.
openclaw channels status --channel wecomshows online
Step 4: Say your first message in WeCom
Why: End-to-end verification—credentials, connection, and model, all three segments of the chain working at once.
How: Find your bot in WeCom, send "Hello" in a direct chat; then add it to a group and ask a question.
You should see: first a "thinking" placeholder message appears, then the reply updates in a streaming fashion (a Bot mode feature); replies support Markdown formatting. Send a voice message and it will be automatically transcribed to text before processing.
💡 This is the unique value of OpenClaw
A web-based AI can't get into your work groups; this Claw lives in your group and natively handles voice-to-text, quoted messages, and mixed text-and-image content—all built into the WeCom plugin, without you writing a single line of integration code.
Step 5: Allow the wecom-cli WeCom business tools
Why: The plugin ships with the wecom-cli tools and accompanying Skills, covering 12 categories of WeCom business; but the default tool policy does not allow plugin tools, so you must allow them manually (skip this if tools.profile is full).
openclaw config set tools.alsoAllow '["wecom-openclaw-plugin"]'
openclaw gateway restart⚠️ Don't overwrite existing entries
If tools.alsoAllow already contains other entries, wecom-openclaw-plugin merge into the existing array instead of overwriting it.
You should see: say to it "Help me create a schedule item for tomorrow at 10 a.m.", and it calls wecom-cli to complete it, with the event appearing in your WeCom calendar.
| Business covered by wecom-cli | What it can do |
|---|---|
| To-dos / schedules / meetings | Create, read, update, delete; assign participants; read meeting notes and raw transcripts |
| Online docs / sheets / smart sheets | Create, import, read and edit, append, permission management |
| Mail / WeDrive / contacts | Send and search email, upload and download files, search members by name |
Step 6: Tighten access control before going live
Why: The defaults are dmPolicy: "open" and groupPolicy: "open"—every user and every group can use it. Fine for personal experimentation, but in a company, tighten it first.
Change these in the configuration file (openclaw.json):
{
"channels": {
"wecom": {
"dmPolicy": "allowlist",
"allowFrom": ["user_id_1", "user_id_2"],
"groupPolicy": "allowlist",
"groupAllowFrom": ["group_id_1"],
"groups": {
"group_id_1": { "allowFrom": ["user_id_1", "user_id_2"] }
}
}
}
}After making the changes, run openclaw gateway restart. The three layers of the allowlist each cover one segment:
allowFrom: direct-chat whitelist (user IDs)groupAllowFrom: group whitelist (group IDs)groups.<群ID>.allowFrom: in-group sender whitelist—messages from members not listed are silently ignored
You should see: colleagues outside the whitelist no longer get replies, whether they message you directly or speak in the group.
💡 Want it even easier?
dmPolicy also supports pairing (pairing-code approval, with approval commands openclaw pairing list wecom and openclaw pairing approve wecom <CODE>) and disabled. For the complete access-control system, see Security Hardening (Part 1): Access Control and Identity.
📋 Magic Prompts
Paste the following prompts directly into a WeCom chat window and send them to your AI assistant.
⏳ Daily morning briefing push group
Expected result: the AI calls the Cron API to create a scheduled task that automatically generates a morning briefing at 9 a.m. every workday and pushes it to the target conversation—created in the conversation, effective immediately, no restart needed.
Create a scheduled task: send a daily briefing to the whole company at 9 a.m. every workday morning.
Briefing requirements:
- Summarize yesterday's industry news and pick the 5 most important items
- One-sentence summary per item, with a link to the original article
- At the end, list the 3 most important items from today's team schedule⚠️ Prerequisites for scheduled delivery
Scheduled delivery goes through the Agent outbound channel: first configure Agent mode per the "Advanced Tips" section below, and the server IP must be in WeCom's trusted IP whitelist (if the IP isn't fixed, configure egressProxyUrl). The target can also be a group (group:wr123abc), a department (party:5), a tag (tag:Ops), or an individual (user:zhangsan).
📝 One-click meeting notes cleanup
Expected result: the AI uses wecom-cli to read the meeting notes and raw transcript, organizes them into structured minutes, and sends them back to the current conversation.
## Role
You are a meeting secretary, skilled at turning lengthy transcripts into actionable minutes.
## Task
Read the raw transcript of the meeting [meeting name/time] and organize it into meeting minutes posted to this group.
## Input
### Required
- Meeting: [meeting name or time range]
### Optional
- Key topics: [topics that need special attention?]
## Output format
Output in three sections: "Conclusions / To-dos / Open issues"; use a table for to-dos: item | owner | deadline.
## Constraints
- ✅ Assign every to-do to a specific person
- ✅ List to-dos without an assigned owner separately as unclaimed
- ❌ Do not repeat the transcript sentence by sentence
- ❌ Send the minutes as a single message; do not flood the group with item-by-item posts✅ Turn post-meeting to-dos into WeCom to-dos
Expected result: the AI calls wecom-cli's to-do capability to create each to-do from the minutes as a WeCom to-do and assign participants.
## Role
You are a project assistant, responsible for turning meeting conclusions into trackable to-dos.
## Task
Create each to-do from the minutes above as a WeCom to-do, and assign it to the corresponding owner.
## Input
### Required
- To-do source: the to-do list in the minutes above
### Optional
- Default deadline: [what date should be used uniformly for to-dos without an explicit deadline?]
## Output format
After all are created, post a one-line summary in the group: how many items and who they were assigned to.
## Constraints
- ✅ Use the deadlines written in the minutes; if missing, ask me first
- ✅ Send the summary as a single message so people in the group can read it at a glance
- ❌ Do not omit any items, and do not invent to-dos that aren't in the minutesCheckpoint ✅
openclaw channels status --channel wecomshows the WeCom channel online- Send a message in a WeCom direct chat: first see the "Thinking" placeholder, then the streaming reply
- The bot can reply after joining a group; voice messages can be converted to text and processed
- Ask it to create a schedule entry or a to-do, and wecom-cli completes it normally
dmPolicy/groupPolicyhave been tightened from the defaultopen(or you have explicitly decided to keep them open)
Pitfall reminders
❌ Plugin version does not match OpenClaw
Symptom: the plugin is installed, but the channel cannot connect or behaves abnormally.
Cause: OpenClaw 2026.3.22 and above was configured with an older plugin (2026.3.20) — the plugin's README specifically noted this compatibility line.
Correct approach:
# 升级插件到 2026.3.24 及以上
npx -y @wecom/wecom-openclaw-cli install --force❌ In Agent mode, the callback URL fails validation as soon as you click "Save"
Cause: clicking Save in the WeCom admin console sends a validation request immediately (a GET with echostr); if the Gateway has not yet been configured with token / encodingAESKey, it cannot decrypt it, so validation naturally fails.
Correct order: first configure the five channels.wecom.agent.* items and run openclaw gateway restart, then go back to the WeCom admin console to save the callback URL.
❌ The scheduled task was created, but the message never arrived
Cause: Cron delivery goes through the Agent outbound channel — it cannot be sent without Agent mode configured (corpId / corpSecret / agentId); if the server's outbound IP is not in WeCom's trusted IP whitelist, it will also be blocked on the WeCom side.
Correct approach: configure Agent mode; if your IP is not fixed, configure channels.wecom.network.egressProxyUrl to route through a fixed outbound proxy.
❌ Allowing tools overwrote the existing configuration
Symptom: the original entries in tools.alsoAllow stop working, and tools from other plugins suddenly fail.
Cause: openclaw config set writes the entire array, so setting it directly wipes out the old values.
Correct approach: merge wecom-openclaw-plugin into the existing array before writing.
Advanced tips (optional)
Agent mode: a self-built app unlocks proactive push
Scheduled delivery (morning reports, alerts, broadcasts) goes through the Agent outbound channel and cannot be sent without Agent mode configured, so you need to add Agent mode — in the WeCom admin console, create a self-built app, get the CorpID / CorpSecret / AgentId, then generate the Token / EncodingAESKey under the app's "API Receive":
openclaw config set channels.wecom.agent.corpId <YOUR_CORP_ID>
openclaw config set channels.wecom.agent.corpSecret <YOUR_CORP_SECRET>
openclaw config set channels.wecom.agent.agentId <YOUR_AGENT_ID>
openclaw config set channels.wecom.agent.token <YOUR_CALLBACK_TOKEN>
openclaw config set channels.wecom.agent.encodingAESKey <YOUR_ENCODING_AES_KEY>
openclaw gateway restartFill the callback URL with https://<your-gateway-host>/plugins/wecom/agent/<accountId> (e.g., /plugins/wecom/agent/default; a single account can also use /plugins/wecom/agent). Remember pitfall 2: configure the Gateway first, then go back to the admin console and click Save.
Once configured, outbound delivery uses Bot first, Agent as fallback: when the Bot WebSocket is available it goes over WS (supporting Markdown and streaming), and it automatically falls back to the Agent HTTP API when unavailable; accounts with only Agent can also send proactive messages, Cron deliveries, and broadcasts; media files are downloaded first and then uploaded and sent via the Agent API, falling back to text + URL on failure.
Target formats for proactive push
delivery.to (in the CLI, --to) supports:
| Format | Target | Example |
|---|---|---|
party:<id> / dept:<id> | Department | party:1 (root department = everyone) |
tag:<id> | Tag group | tag:Ops |
user:<id> | Specific user | user:zhangsan |
group:<id> / chat:<id> | Group chat | group:wr123abc |
| Pure digits | Auto-detected as department | 1 → party:1 |
wr... / wc... prefix | Auto-detected as group chat | wr123 |
Namespace prefixes like wecom: and qywx: are stripped automatically, so no manual cleanup is needed.
More tricks, one-liner edition
- Multi-account:
accountsconfigures multiple WeCom accounts (e.g., main / support), with account-level fields overriding the top level; under multi-account, accounts without an explicitbindingswill not fall back to the default agent, so remember to configure bindings for each account - Dynamic Agent routing:
dynamicAgents.enabled: trueautomatically creates isolated Agents per user/group, so sessions never cross - Media limits: images/videos over 10 MB and voice over 2 MB (AMR only) are automatically downgraded to file delivery; the file limit is 20 MB, and anything larger is rejected
- Outbound proxy:
channels.wecom.network.egressProxyUrltakes precedence over environment variables likeHTTPS_PROXY
For the full details on multi-account and bindings, see C3 Multi-Agent collaboration.
Lesson summary
✅ You can now:
- Complete OpenClaw WeCom integration: an AI assistant with streaming replies in direct chats and group chats (install the plugin → configure the Bot → join the group)
- Allow wecom-cli so it can operate to-dos, schedules, meetings, documents, WeDrive, and contacts
- Use allowlists to control who can use it, which groups it can join, and who can speak in a group
- Configure Agent mode to unlock proactive push and scheduled morning reports
Key configuration fields recap:
| Field | Recommended value | Description |
|---|---|---|
channels.wecom.enabled | true | Enable the WeCom channel |
channels.wecom.botId / secret | Bot credentials | Required in Bot mode (WebSocket) |
channels.wecom.connectionMode | websocket (default) | Bot connection mode, optional webhook |
channels.wecom.dmPolicy / groupPolicy | allowlist | Default open, tighten before going live |
tools.alsoAllow | ["wecom-openclaw-plugin"] | Allow the wecom-cli business tool |
channels.wecom.agent.* | Five application credentials | Agent mode: callback receiving + active push |
Next lesson preview
Next lesson A2 Feishu integration: official plugin, group chat and document tools, you will learn:
- The differences between the official
@openclaw/feishuplugin and the WeCom external plugin - How the WebSocket default mode runs without any public URL
- How to use the Feishu documents / wiki / cloud drive / Bitable tools
- Feishu group chat configuration and access control
Is Feishu your company's main platform? Jump straight there; if you use both, just follow along and configure it again — channels don't interfere with each other, and one Gateway carries them all.