Feishu Channel Configuration Guide
The Feishu channel connects an AskTable agent to a Feishu bot. After configuration, users can ask questions in Feishu one-on-one chats or group chats. AskTable converts Feishu messages into agent conversations and sends the agent's reply back to Feishu.
Use Cases
- Let business users query data and follow up on analysis directly in Feishu.
- Connect an existing AskTable agent to the company's IM workspace.
- Provide an internal data Q&A entry point through a Feishu bot in a private deployment.
The current Feishu channel is designed for text conversations. Images, files, voice messages, and other non-text messages are not processed by the agent.
How It Works
The Feishu integration is handled by Feishu Gateway. The gateway does not store business data or run agent logic. It only converts messages between Feishu long connections and AskTable Server.
Feishu user
|
| Sends a text message
v
Feishu Open Platform
|
| Long-connection event im.message.receive_v1
v
Feishu Gateway
|
| Redis: at:channel:inbound / at:channel:outbound:feishu
v
AskTable Server
|
| Runs the bound AskTable agent
v
Feishu Gateway
|
| Feishu message reply API
v
Feishu user
Feishu Gateway uses Feishu Open Platform long connections. You do not need to configure a public webhook request URL in the Feishu console.
Prerequisites
Before you begin, make sure that:
- AskTable is deployed and the console is accessible.
- The AskTable agent that will be connected to Feishu has been created.
- The
asktable_feishu_gatewayservice is enabled in your private deployment. - You can create and configure an internal app in Feishu Open Platform.
- You have administrator permissions in the AskTable project and can edit agent channel settings.
Step 1: Enable Feishu Gateway
If you deploy AskTable with Docker Compose, the Feishu gateway service is marked as optional in the deployment documentation. Enable it when you need Feishu IM integration.
asktable_feishu_gateway:
image: registry.cn-shanghai.aliyuncs.com/datamini/asktable-feishu-gateway:latest
# image: datamini/asktable-feishu-gateway:latest
container_name: asktable_feishu_gateway
restart: unless-stopped
depends_on:
- asktable_redis
environment:
TZ: Asia/Shanghai
REDIS_URL: redis://asktable_redis:6379
Restart the services:
docker compose up -d
Check the gateway logs:
docker logs -f asktable_feishu_gateway
If you see a log similar to Feishu Gateway running, the gateway process has started. It will connect to Feishu after you finish the app credential and event configuration.
Step 2: Create a Feishu Internal App
- Open Feishu Open Platform.
- Select your organization and create an internal app.
- Fill in the app name, description, and icon. Use a name that helps users recognize it as the AskTable data assistant.
- Open the app details page after creation.
Step 3: Get App Credentials
In the Feishu app details page, open "Credentials & Basic Info" and copy these fields:
| Field | Required | Purpose |
|---|---|---|
| App ID | Required | Identifies the Feishu app |
| App Secret | Required | Used to create the Feishu long connection and call the reply API |
App Secret is sensitive. Only enter it in the AskTable Feishu channel configuration. Do not share it in chats, tickets, or public documents.
Step 4: Configure Bot Capability and Permissions
In the Feishu app console:
- Enable the bot capability for the app.
- Open permission management and add message-related permissions.
- Make sure the app can receive messages sent to the bot and reply as the bot.
- Publish a new app version and wait for administrator approval.
Permission names in Feishu Open Platform may change over time. Use the names shown in the Feishu console, and make sure the app has these capabilities:
- Receive message events in bot one-on-one chats or group chats.
- Send or reply to messages as the bot.
Step 5: Subscribe to Message Events
AskTable currently uses Feishu long connections to receive events. In the Feishu app console, open the event or callback settings:
- Enable the long-connection or event subscription capability.
- Subscribe to the
im.message.receive_v1event. - If Feishu asks for an
Encrypt KeyorVerification Token, copy those values and enter them in AskTable later. If encryption is not enabled or the page does not require them, leave them empty. - Publish the app version so the new permissions and event subscriptions take effect.
You do not need to configure a https://.../callback request URL for AskTable Feishu Gateway. The gateway receives events through Feishu long connections.
Step 6: Configure the Feishu Channel in AskTable
- Log in to the AskTable console.
- Open the project that contains the target agent.
- Open the agent editing page.
- Switch to the "Channels" tab.
- Enable the "Feishu" channel.
- Enter the Feishu app credentials.
| Setting | Required | Description |
|---|---|---|
| App ID | Required when creating | App ID of the Feishu app |
| App Secret | Required when creating | App Secret of the Feishu app |
| Encrypt Key | Optional | Event encryption key. Fill it in if event encryption is enabled |
| Verification Token | Optional | Event verification token. Fill it in if Feishu requires verification |
- Save the configuration.
- Check the runtime status on the same page. Refresh it if necessary.
When the status becomes "Connected", AskTable Server has synchronized the channel configuration to Feishu Gateway, and the gateway has established the Feishu connection.
Step 7: Install and Test in Feishu
- Publish the app version in Feishu and make sure it is approved by the organization administrator.
- Install the app for the organization or the target user scope.
- Find the bot in Feishu and start a one-on-one chat.
- To use it in a group, add the bot to the target group.
- Send a text question, for example:
- "How many new customers did we get this week?"
- "Which store had the highest sales yesterday?"
- "Analyze the order trend over the last 7 days."
AskTable keeps a conversation context for the same Feishu sender and the same channel for a period of time. Follow-up questions from the same user continue in that context.
Verification and Troubleshooting
The Channel Stays Disconnected
Check the following:
- The
asktable_feishu_gatewaycontainer is running. REDIS_URLin Feishu Gateway points to the same Redis used by AskTable.- AskTable Server can access the same Redis.
- App ID and App Secret are correct.
- The Feishu app has been published and approved.
- The
im.message.receive_v1event is subscribed.
Feishu Receives Messages but AskTable Does Not Reply
Check the following:
- The Feishu app has permission to reply as a bot.
- The user sent a text message.
- The bound AskTable agent can chat normally in the AskTable console.
- Feishu Gateway logs do not show outbound or reply API errors.
No Response in a Group Chat
Check the following:
- The bot has been added to the group.
- The group allows the bot to receive messages.
- The app availability scope includes the group members.
- After changing permissions or event subscriptions, the app was republished and approved.
Credential Changes Do Not Take Effect
Save the Feishu channel configuration again in the agent's "Channels" tab, then refresh the connection status. If necessary, restart the asktable_feishu_gateway container so the gateway reloads the channel configuration.