Lark / Feishu

Connect your Lark or Feishu custom app to send messages and create tasks from TogoFlow workflows.

The Lark / Feishu integration lets workflows send chat messages and create tasks using your own Lark Open Platform app. Unlike Google or Slack, Lark uses your custom app credentials (App ID and App Secret) rather than a shared TogoFlow OAuth client.

What you can do

ActionDescription
Send MessageSend a text message to a user or group chat
Create TaskCreate a task in Lark with an optional due date

Prerequisites

Step 1 — Create a custom app

  1. Open the developer console for your region:
  2. Click Create custom app and fill in the app name and description.
  3. Go to Credentials & Basic Info and copy your App ID (cli_…) and App Secret.

Step 2 — Enable bot capability

  1. In your app, open App capabilities (or Add app capability).
  2. Add Bot capability.
  3. Publish a new app version so the bot ability takes effect.

Without bot capability enabled, message sending returns error 230006 (Bot ability is not activated).

Step 3 — Grant API permissions

Under Permissions & Scopes, enable at least:

PermissionRequired for
im:message or im:message:send_as_botSend Message
im:chat:readonlyList group chats in the workflow editor (optional but recommended)
task:task:writeCreate Task

Publish a new version after changing permissions.

Step 4 — Configure redirect URI (optional)

User authorization is optional. It lets TogoFlow list more of your personal chats and groups in the workflow editor. Basic bot messaging only needs App ID + App Secret.

If you want the chat picker and user-scoped features:

  1. In your Lark app, open Security settingsRedirect URL.
  2. Add this TogoFlow API callback URL:
https://api.togoflow.ai/api/v1/auth/callback/lark-oauth

Step 5 — Connect in TogoFlow

  1. Create or open a workflow and add an Action node.
  2. Click Select App and choose Lark / Feishu.
  3. Select an action:
    • Send Message — post text to a user or group
    • Create Task — create a task with title and optional description
  4. In the Lark App Credentials section, enter:
    • App ID — from the developer console
    • App Secret — from the developer console
    • PlatformLark (International) or Feishu (China); must match where your app was created
  5. Click Connect Lark.

TogoFlow validates your credentials, fetches a tenant_access_token, and stores it securely. The token refreshes automatically before it expires — you do not need to paste access tokens manually.

Optional — Authorize your Lark user

After connecting the app, click Authorize Lark User to grant user-level access. This improves the group chat picker and is useful if you need to target chats beyond those where the bot is already a member.

Send Message

Recipient types

TypeUse when
Group ChatSending to a group — pick from a dropdown of available chats
User Open IDSending a direct message by Open ID
User IDSending by tenant User ID
EmailSending by the user's email address

For Group Chat, set Recipient Type to Group Chat. TogoFlow loads chats your bot can access. If the list is empty, add the bot to a group in Lark or complete Authorize Lark User.

Message limits

  • Text messages: up to 150 KB
  • Rate limit: 5 messages per second per user or per group (shared among bots in the group)

Common send errors

ErrorCauseFix
230002Bot not in the groupAdd the bot to the target group chat
230006Bot ability not enabledEnable bot capability and publish a new app version
230013Bot has no availability to userAdjust app availability scope in the developer console
230027Missing permissionsAdd im:message / im:message:send_as_bot and republish
230034Invalid recipient IDCheck recipient type matches the ID format

See the Lark Send Message API docs for the full error reference.

Create Task

Configure:

  • Task Title (required)
  • Description (optional)
  • Due Date (optional) — Unix timestamp in seconds, e.g. 1719878400

Requires the task:task:write permission on your Lark app.

Using template variables

All action fields support TogoFlow template syntax. For example, after a webhook or AI node:

{{inputs.message}}

Use the Variables button next to a field to insert values from upstream nodes.

Token management

  • Tenant access token — obtained from your App ID and App Secret; refreshed automatically by TogoFlow
  • User access token — optional; obtained via Authorize Lark User; used for listing chats
  • Credentials are stored per organization and are never included in workflow exports

Security best practices

  • Treat App Secret like a password — do not commit it to source control
  • Grant only the API scopes your workflows need
  • Use a dedicated Lark app for production automations
  • Review connected apps periodically in the Lark developer console

Troubleshooting

ProblemFix
Connect fails immediatelyVerify App ID, App Secret, and Platform (Lark vs Feishu) match your app
No chats in the pickerAdd the bot to groups, or click Authorize Lark User
Messages not delivered to a userEnsure the bot has availability to that user
"Lark connection required" at runtimeOpen the Action node and click Connect Lark before publishing
User OAuth redirect failsConfirm the redirect URI in Lark matches your API callback URL exactly