> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langbot.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploying WeCom Intelligent Bot

## One-Click Setup (Recommended)

LangBot supports one-click WeCom bot creation with automatic BotId and Secret filling — no manual copy-paste needed.

1. Open LangBot WebUI, go to **Bots > Create Bot**
2. Enter a bot name, select `WeCom Intelligent Bot` as the platform/adapter
3. In the **One-Click Create Bot** section that appears, click the **Start** button

<img src="https://mintcdn.com/langbot/2gQAELt1nN3_kQMs/images/zh/deploy/bots/wecom/wecombot/wecombot_oneclick.png?fit=max&auto=format&n=2gQAELt1nN3_kQMs&q=85&s=e10580a27d33723e497e8496290fba31" alt="One-Click Create Bot" width="1900" height="906" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_oneclick.png" />

4. Scan the QR code with WeCom. On your phone, tap **One-Click Create Intelligent Bot**

<img src="https://mintcdn.com/langbot/2gQAELt1nN3_kQMs/images/zh/deploy/bots/wecom/wecombot/wecombot_scan_create.png?fit=max&auto=format&n=2gQAELt1nN3_kQMs&q=85&s=9907bbd322eac4d3e77a4c4a4a7e40df" alt="Phone One-Click Create" width="1563" height="922" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_scan_create.png" />

5. After authorization, BotId and Secret will be **auto-filled** in the form
6. **Manually fill in the bot name** — it must match the bot name in WeCom

<img src="https://mintcdn.com/langbot/2gQAELt1nN3_kQMs/images/zh/deploy/bots/wecom/wecombot/wecombot_fill_name.png?fit=max&auto=format&n=2gQAELt1nN3_kQMs&q=85&s=52eb3254f4b5aa97ca50a335ded59036" alt="Fill Bot Name" width="1612" height="923" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_fill_name.png" />

7. Click **Submit** to complete

<Warning>
  WeCom Intelligent Bot **cannot use existing bots** for one-click setup — only new bots. To use an existing bot, refer to the manual configuration below.
</Warning>

***

## Manual Configuration

### Creating a Bot

First, log in to the [WeCom Admin Console](https://work.weixin.qq.com/wework_admin/frame#/).

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecombot/wecombot_1.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=0a849fb8503d1307fe02279b560ef691" alt="Homepage" width="1970" height="1094" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_1.png" />

Click `Security And Management` in the left sidebar, then click `Intelligent Bot` under `Management Tool`.

As shown:

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecombot/wecombot_2.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=22f2721d7712fe9b1891456266dad28d" alt="Intelligent Bot" width="2750" height="904" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_2.png" />

Click `Create Bot` and select `Manual Creation`, scroll to the bottom of the page, click `Create via API Mode`, and enter the page:

<img src="https://mintcdn.com/langbot/UfIG5LRrzfzmD9Of/images/zh/deploy/bots/wecom/wecombot/wecombot_3.png?fit=max&auto=format&n=UfIG5LRrzfzmD9Of&q=85&s=28aa447b19ec6f921bf3e4af32f08495" alt="Create via API Mode" width="1645" height="872" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_3.png" />

### Long Connection Configuration

#### Enable Long Connection API Mode

In the WeCom Admin Console, go to the Intelligent Bot configuration page, enable "API Mode" and select "Long Connection":

<img src="https://mintcdn.com/langbot/UfIG5LRrzfzmD9Of/images/zh/deploy/bots/wecom/wecombot/wecombot_9.png?fit=max&auto=format&n=UfIG5LRrzfzmD9Of&q=85&s=48cdf05d8ef7219f728fe762a71ed04f" alt="Long Connection Mode" width="668" height="451" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_9.png" />

#### Obtaining Credentials

After enabling the Long Connection API mode, you need to obtain the following credentials to establish the connection:

| Credential | Description                                                            |
| ---------- | ---------------------------------------------------------------------- |
| BotID      | The unique identifier of the intelligent bot, used to identify the bot |
| Secret     | The dedicated key for long connections, used for identity verification |

<Warning>
  Note:

  * The Secret is a dedicated key for long connections, which is different from the Token/EncodingAESKey used in the callback URL mode
  * Please keep the Secret safe and avoid leaking it
  * Mode switching impact: API mode can only use one method (long connection or callback URL). Switching to "Callback URL" mode will invalidate existing long connections; conversely, switching from "Callback URL" to "Long Connection" mode will make the original callback URL no longer effective
</Warning>

#### Configuring the Bot

Start the LangBot main program, select the adapter `WeCom Intelligent Bot`, and fill in the configuration items.
Enter the BotID, Secret, and bot name from the long connection into the fields, click save and enable.

> The bot name must match the name of the newly created bot, otherwise the bot will not respond in group chats.

<img src="https://mintcdn.com/langbot/3NDJgZr-XlIS_TL6/images/zh/deploy/bots/wecom/wecombot/wecombot_10.png?fit=max&auto=format&n=3NDJgZr-XlIS_TL6&q=85&s=c6f168df4aa5305e29dd2321cb8851b5" alt="Long Connection Configuration" width="1390" height="720" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_10.png" />

### URL Callback Configuration

Click to randomly generate Token and EncodingAESKey, then fill in the basic bot information above. **Pay attention to setting the visibility scope**.

<img src="https://mintcdn.com/langbot/UfIG5LRrzfzmD9Of/images/zh/deploy/bots/wecom/wecombot/wecombot_11.png?fit=max&auto=format&n=UfIG5LRrzfzmD9Of&q=85&s=ab33783927a5d237b08c6416af1fe1a2" alt="Parameter Retrieval" width="1647" height="867" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_11.png" />

Click `My Company` in the left sidebar and save the Company ID at the bottom.

#### Configuring Callback URL

Start the LangBot main program, select the adapter `WeCom Intelligent Bot`, and fill in the configuration items.\
Among them, the token is Token, the Encoding-AESKey is EncodingAESKey, and the Bot ID can be filled in as xxx (or filled in randomly, it will be changed later). After filling in, click\
`Save`, and `Enable` the robot.

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecombot/wecombot_4.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=ce2cf6c830e8f459e605dbd1c1c917e5" alt="WeCom Intelligent Bot Adapter" width="1136" height="728" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_4.png" />

On the LangBot homepage, enable and select the corresponding bot, click to enter the configuration page, copy the Webhook callback address

<Info>
  We recommend that you first refer to [Configure HTTP Reverse Proxy](/en/workshop/production/proxy-and-ssl) to configure the LangBot callback address.
</Info>

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecombot/wecombot_8.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=191a56bdf13d1ca8b10bdb1e2fd27635" alt="Webhook Callback Address" width="792" height="683" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_8.png" />

Return to the WeCom robot configuration page and fill the copied webhook address into `URL Callback`. If the creation is successful, it will jump to the details page. If the message `Request URL Failed` appears, please double-check whether the above steps have been completed one by one.

Details page after successful creation:\\

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecombot/wecombot_5.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=cd1741894f405c516228cf35ed7d38e7" alt="Creation Successful" width="2804" height="920" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_5.png" />

Copy the `Bot ID` and bot name from the WeCom robot details page, return to the LangBot management page, change the Bot ID of the deployed intelligent robot to the copied ID, fill in the bot name, and restart the robot.

### Enable Streaming

A streaming toggle has been added for locally deployed models or models that do not support streaming.

<img src="https://mintcdn.com/langbot/3NDJgZr-XlIS_TL6/images/zh/deploy/bots/wecom/wecombot/wecombot_12.png?fit=max&auto=format&n=3NDJgZr-XlIS_TL6&q=85&s=9259390f540b57997ced7a5999378f9d" alt="Streaming Toggle" width="1449" height="748" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_12.png" />

### Start Using

Enter WeCom, click `➕`, as shown:

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecombot/wecombot_6.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=b8e836de273237d44ede77ffc0ecb317" alt="Add Bot" width="1902" height="274" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_6.png" />

Click `Company-Created`, select the created bot, and enter the chat interface.

Similarly, if you want to invite the bot to a group chat, click the add member button in the group chat and add the bot from there.

### Effect Images

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecombot/wecombot_7.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=a3d69036cccb4728052ff2d12a78918e" alt="Effect Image 1" width="1256" height="454" data-path="images/zh/deploy/bots/wecom/wecombot/wecombot_7.png" />
