The OpenClaw Connector (connector) is a standalone process that allows you to control your local ComfyUI instance remotely via chat platforms like Telegram, Discord, LINE, WhatsApp, WeChat Official Account, KakaoTalk (Kakao i Open Builder), Slack, and Feishu/Lark.
Per the product boundary contract, the connector is an optional attached subsystem. The primary published artifact of this repo remains the ComfyUI custom node pack, and the connector augments that package rather than replacing it.
Current extraction decision: keep the connector in-repo as an optional attached subsystem for now. OpenClaw does not currently treat a standalone connector package/repo as a supported distribution; see ADR-0003.
The connector runs alongside ComfyUI on your machine.
- It connects outbound to Telegram/Discord (polling/gateway).
- LINE/WhatsApp/WeChat/KakaoTalk/Slack use inbound webhooks (HTTPS required), while Feishu/Lark can run in webhook mode or long-connection mode with a separate callback ingress path for interactive actions.
- It talks to ComfyUI via
localhost. - It relays commands and status updates securely.
Security:
- Transport Model: Telegram/Discord are outbound. LINE/WhatsApp/WeChat/KakaoTalk/Slack require inbound HTTPS webhook endpoints. Feishu/Lark supports webhook ingress or long-connection transport, but interactive callbacks still use a bounded local HTTPS callback path.
- Allowlist/Trust Model: Allowlists define trusted senders/channels. Non-allowlisted senders are treated as untrusted (for example,
/runis approval-routed instead of auto-executed). - Strict Profile Gate: In
publicdeployment orhardenedruntime posture, enabling connector ingress without platform allowlist coverage is fail-closed at startup/deployment checks. - Local Secrets: Bot tokens are stored in your local environment, never sent to ComfyUI.
- Admin Boundary: Control-plane actions call admin endpoints on the local OpenClaw server and require connector-side admin token configuration for admin command paths.
- Reply Visibility: Shared visibility policy can suppress text-only silent/internal/tool-only/no-mention replies without suppressing approval cards, action buttons, or the underlying trust checks.
OpenClaw now includes a platform-agnostic baseline for multi-workspace connector lifecycle and interactive callback security:
- installation registry stores normalized records:
platform,workspace_id,installation_id,token_refs,status,updated_at
- token material is kept in encrypted server-side secret storage; registry and diagnostics expose token references only
- workspace resolution is fail-closed on missing/ambiguous/inactive/stale bindings
- installation diagnostics can also surface stable health states such as
ok,invalid_token,revoked,workspace_unbound, anddegraded - interactive callback contract enforces signed envelope checks, timestamp window, payload-hash validation, replay/idempotency guardrails, and command-policy mapping (
public/run/admin) with explicit force-approval outcomes for untrustedruncallbacks - connector replay handling acknowledges duplicate committed events as no-ops while allowing retryable failures before delivery commit to be retried
- text reply visibility is resolved through one connector policy for direct-message, shared-chat, thread, internal-delivery, and tool-only contexts; suppressed text is logged/diagnostic and treated as successful no-op delivery
Admin diagnostics APIs:
GET /openclaw/connector/installationsGET /openclaw/connector/installations/{installation_id}GET /openclaw/connector/installations/resolve?platform=<platform>&workspace_id=<workspace_id>GET /openclaw/connector/installations/auditGET /openclaw/connector/extraction-contract
Extraction diagnostics note:
/openclaw/connector/extraction-contractis an admin-only structural metadata route for maintainers and operators. It returns the current packaging recommendation, candidate extraction options, seam families, and blockers, but it does not expose live token or installation-state details beyond the existing diagnostics routes above.- The extraction contract also includes the static service-env SecretRef propagation policy. It is not a live environment dump and does not expose token values.
Slack multi-workspace notes:
- Slack OAuth installs bind one workspace per installation record and persist only encrypted token refs.
- OAuth callback state is single-use and replay/invalid-state callbacks fail closed instead of reusing a prior install session.
GET /openclaw/connector/installations/resolve?platform=slack&workspace_id=<team_id>returns the fail-closed resolution view for a specific Slack workspace.GET /openclaw/connector/installationsdiagnostics may include per-install health metadata plus aggregatehealth_counts.- Slack lifecycle events such as
tokens_revoked,app_uninstalled, and rate-limit degradation update installation health so outbound replies fail closed or degrade predictably for the affected workspace. - In multi-workspace mode, outbound replies and delayed result deliveries resolve the bot token by workspace binding and keep Slack thread context when replying back to the originating conversation.
- Slack interactive callbacks use the configured interactions path, signature verification, replay/idempotency checks, and connector policy mapping before accepting action payloads.
- Slack text replies honor the shared reply-visibility policy when context metadata is available; channel no-mention or tool-only text can be suppressed while Block Kit/action responses remain deliverable.
Feishu / Lark notes:
- Feishu bindings can be declared with a single app pair or a multi-account
OPENCLAW_CONNECTOR_FEISHU_BINDINGS_JSONmanifest; each binding resolves to one normalized installation record with account/workspace identity. - The connector supports both
feishuandlarkAPI domains through one shared binding contract, so region-specific app hosts do not require a different adapter. - Websocket-mode Feishu deployments still host a callback route so interactive approval cards and command buttons remain available when message ingress itself is long-connection based.
- Feishu callback actions are signed, replay-guarded, tenant-aware, and deduplicated. Untrusted actors pressing run-affecting buttons are downgraded to approval flow instead of executing directly.
- Feishu text replies honor the shared reply-visibility policy when context metadata is available; group no-mention or tool-only text can be suppressed while interactive cards remain deliverable.
When backend multi-tenant mode is enabled (OPENCLAW_MULTI_TENANT_ENABLED=1):
- installation records are tenant-owned (
tenant_id) and diagnostics are tenant-scoped - resolution rejects cross-tenant matches fail-closed (
tenant_mismatchpath) - admin diagnostics calls can pass tenant context via token context and/or
X-OpenClaw-Tenant-Id(or your configuredOPENCLAW_TENANT_HEADER) - missing tenant context currently falls back to
defaulttenant for compatibility unless stricter caller paths are used
- Telegram: Long-polling (instant response), including forum topic reply context for immediate replies and delayed result delivery.
- Discord: Gateway WebSocket (instant response).
- LINE: Webhook (requires inbound HTTPS).
- WhatsApp: Webhook (requires inbound HTTPS).
- WeChat Official Account: Webhook (requires inbound HTTPS).
- KakaoTalk (Kakao i Open Builder): Webhook (requires inbound HTTPS).
- Slack (Events API): Webhook (requires inbound HTTPS).
- Feishu / Lark: Webhook or long-connection transport; interactive callbacks require inbound HTTPS for the callback route.
- Python 3.10+
aiohttp(installed with ComfyUI-OpenClaw)
Set the following environment variables (or put them in a .env file if you use a loader):
Common:
OPENCLAW_CONNECTOR_URL: URL of your ComfyUI (default:http://127.0.0.1:8188)OPENCLAW_CONNECTOR_DEBUG: Set to1for verbose logs.OPENCLAW_CONNECTOR_ADMIN_USERS: Comma-separated list of user IDs allowed to run admin commands (for example/stop,/cancel, approvals, schedules). Admin users are also treated as trusted senders for/run.OPENCLAW_CONNECTOR_ADMIN_TOKEN: Admin token sent to OpenClaw (X-OpenClaw-Admin-Token).OPENCLAW_LOG_TRUNCATE_ON_START: Optional backend runtime flag. Set1to clearopenclaw.logonce at backend startup to avoid stale-history noise in UI log panels.OPENCLAW_MULTI_TENANT_ENABLED: Optional backend mode toggle. If1, connector diagnostics and installation resolution become tenant-scoped.OPENCLAW_TENANT_HEADER: Optional tenant header key (defaultX-OpenClaw-Tenant-Id) used when calling tenant-scoped backend APIs.
Admin token behavior:
- Connector admin command paths require
OPENCLAW_CONNECTOR_ADMIN_TOKENto be set in connector runtime. - If the OpenClaw server has
OPENCLAW_ADMIN_TOKENconfigured,OPENCLAW_CONNECTOR_ADMIN_TOKENmust match it or admin calls return HTTP 403. - Without
OPENCLAW_CONNECTOR_ADMIN_TOKEN, admin command flows (/approve,/reject,/trace, schedules) are blocked by connector policy before upstream calls.
SecretRef service environment behavior:
- Service/sidecar launch helpers may preserve structured env-backed SecretRef metadata for connector credential variables such as platform bot tokens and signing secrets.
- Diagnostics show only the config path, env var name, source, status, and reason. They do not show raw token values from the installing shell.
- Raw secret strings, legacy
secretref-env:<NAME>markers, unsupported env names, and gateway/admin auth env vars are rejected instead of being written into service metadata. - Runtime-only auth secrets such as
OPENCLAW_CONNECTOR_ADMIN_TOKEN,OPENCLAW_WORKER_TOKEN, and bridge device tokens must be provided by the runtime environment or a local secret manager rather than persisted through the connector service-env SecretRef boundary.
Telegram:
OPENCLAW_CONNECTOR_TELEGRAM_TOKEN: Your Bot Token (from @BotFather).OPENCLAW_CONNECTOR_TELEGRAM_ALLOWED_USERS: Comma-separated list of User IDs (e.g.123456, 789012).OPENCLAW_CONNECTOR_TELEGRAM_ALLOWED_CHATS: Comma-separated list of Chat/Group IDs.- Telegram forum topics are preserved when Telegram provides
message_thread_id; command replies and delayed result delivery are sent back to the same topic. Manually configured delivery contexts must use numeric topic/thread IDs.
Discord:
OPENCLAW_CONNECTOR_DISCORD_TOKEN: Your Bot Token (from Discord Developer Portal).OPENCLAW_CONNECTOR_DISCORD_ALLOWED_USERS: Comma-separated User IDs.OPENCLAW_CONNECTOR_DISCORD_ALLOWED_CHANNELS: Comma-separated Channel IDs the bot should listen in.
LINE:
(Requires Inbound Connectivity - see below)
OPENCLAW_CONNECTOR_LINE_CHANNEL_SECRET: LINE Channel Secret.OPENCLAW_CONNECTOR_LINE_CHANNEL_ACCESS_TOKEN: LINE Channel Access Token.OPENCLAW_CONNECTOR_LINE_ALLOWED_USERS: Comma-separated User IDs (e.g.U1234...).OPENCLAW_CONNECTOR_LINE_ALLOWED_GROUPS: Comma-separated Group IDs (e.g.C1234...).OPENCLAW_CONNECTOR_LINE_BIND: Host to bind (default127.0.0.1).OPENCLAW_CONNECTOR_LINE_PORT: Port (default8099).OPENCLAW_CONNECTOR_LINE_PATH: Webhook path (default/line/webhook).
WhatsApp:
(Requires Inbound Connectivity - see below)
OPENCLAW_CONNECTOR_WHATSAPP_ACCESS_TOKEN: Cloud API access token.OPENCLAW_CONNECTOR_WHATSAPP_VERIFY_TOKEN: Webhook verify token (used during setup).OPENCLAW_CONNECTOR_WHATSAPP_APP_SECRET: App secret for signature verification (recommended).OPENCLAW_CONNECTOR_WHATSAPP_PHONE_NUMBER_ID: Phone number ID used for outbound messages.OPENCLAW_CONNECTOR_WHATSAPP_ALLOWED_USERS: Comma-separated senderwa_idvalues (phone numbers).OPENCLAW_CONNECTOR_WHATSAPP_BIND: Host to bind (default127.0.0.1).OPENCLAW_CONNECTOR_WHATSAPP_PORT: Port (default8098).OPENCLAW_CONNECTOR_WHATSAPP_PATH: Webhook path (default/whatsapp/webhook).
WeChat Official Account:
(Requires Inbound Connectivity - see below)
OPENCLAW_CONNECTOR_WECHAT_TOKEN: WeChat server verification token (required for adapter startup).OPENCLAW_CONNECTOR_WECHAT_APP_ID: Official Account AppID (required for proactive outbound message API calls).OPENCLAW_CONNECTOR_WECHAT_APP_SECRET: Official Account AppSecret (required for proactive outbound message API calls).OPENCLAW_CONNECTOR_WECHAT_ALLOWED_USERS: Comma-separated OpenID allowlist. Non-allowlisted users are treated as untrusted and routed through approval semantics for sensitive actions.OPENCLAW_CONNECTOR_WECHAT_BIND: Host to bind (default127.0.0.1).OPENCLAW_CONNECTOR_WECHAT_PORT: Port (default8097).OPENCLAW_CONNECTOR_WECHAT_PATH: Webhook path (default/wechat/webhook).
KakaoTalk (Kakao i Open Builder):
(Requires Inbound Connectivity - see below)
OPENCLAW_CONNECTOR_KAKAO_ENABLED: Set totrueto enable Kakao webhook adapter.OPENCLAW_CONNECTOR_KAKAO_ALLOWED_USERS: Comma-separated Kakao user IDs (userRequest.user.id/ botUserKey). Non-allowlisted users are treated as untrusted and sensitive actions require approval.OPENCLAW_CONNECTOR_KAKAO_BIND: Host to bind (default127.0.0.1).OPENCLAW_CONNECTOR_KAKAO_PORT: Port (default8096).OPENCLAW_CONNECTOR_KAKAO_PATH: Webhook path (default/kakao/webhook).
Slack (Events API):
(Requires Inbound Connectivity - see below)
OPENCLAW_CONNECTOR_SLACK_BOT_TOKEN: Optional legacy single-workspace Bot User OAuth Token (xoxb-...). When Slack OAuth is configured, per-workspace tokens are resolved from the installation registry instead.OPENCLAW_CONNECTOR_SLACK_SIGNING_SECRET: Signing Secret (from App Credentials).OPENCLAW_CONNECTOR_SLACK_CLIENT_ID: OAuth client ID for multi-workspace installation flow.OPENCLAW_CONNECTOR_SLACK_CLIENT_SECRET: OAuth client secret for multi-workspace installation flow.OPENCLAW_CONNECTOR_SLACK_OAUTH_REDIRECT_URI: Explicit OAuth callback URL. If omitted, connector derives it fromOPENCLAW_CONNECTOR_PUBLIC_BASE_URL+ callback path.OPENCLAW_CONNECTOR_SLACK_OAUTH_INSTALL_PATH: Local install route (default/slack/install).OPENCLAW_CONNECTOR_SLACK_OAUTH_CALLBACK_PATH: Local callback route (default/slack/oauth/callback).OPENCLAW_CONNECTOR_SLACK_OAUTH_SCOPES: Comma-separated bot scopes used for install URL generation.OPENCLAW_CONNECTOR_SLACK_OAUTH_STATE_TTL_SEC: TTL in seconds for single-use OAuth state tokens (default600, clamped to60..3600).OPENCLAW_CONNECTOR_SLACK_ALLOWED_USERS: Comma-separated user IDs (e.g.U12345, U67890).OPENCLAW_CONNECTOR_SLACK_ALLOWED_CHANNELS: Comma-separated channel IDs (e.g.C12345).OPENCLAW_CONNECTOR_SLACK_BIND: Host to bind (default127.0.0.1).OPENCLAW_CONNECTOR_SLACK_PORT: Port (default8095).OPENCLAW_CONNECTOR_SLACK_PATH: Webhook path (default/slack/events).OPENCLAW_CONNECTOR_SLACK_REQUIRE_MENTION:true(default) to require@Botmention in public channels.OPENCLAW_CONNECTOR_SLACK_REPLY_IN_THREAD:true(default) to reply in threads.
Feishu / Lark:
(Long connection or webhook; callback ingress still requires inbound HTTPS if interactive cards are enabled)
OPENCLAW_CONNECTOR_FEISHU_APP_ID: App ID for the default Feishu/Lark binding.OPENCLAW_CONNECTOR_FEISHU_APP_SECRET: App secret for the default binding.OPENCLAW_CONNECTOR_FEISHU_VERIFICATION_TOKEN: Verification token for webhook event ingress.OPENCLAW_CONNECTOR_FEISHU_ENCRYPT_KEY: Optional encrypt key for encrypted webhook payloads.OPENCLAW_CONNECTOR_FEISHU_ACCOUNT_ID: Explicit account ID for the default binding.OPENCLAW_CONNECTOR_FEISHU_DEFAULT_ACCOUNT_ID: Fallback account ID when binding manifest entries omit one.OPENCLAW_CONNECTOR_FEISHU_WORKSPACE_ID: Workspace or tenant identifier associated with the default binding.OPENCLAW_CONNECTOR_FEISHU_WORKSPACE_NAME: Human-readable workspace name used in diagnostics.OPENCLAW_CONNECTOR_FEISHU_BINDINGS_JSON: JSON list of account bindings for multi-account / multi-workspace setups.OPENCLAW_CONNECTOR_FEISHU_ALLOWED_USERS: Comma-separated trusted user IDs.OPENCLAW_CONNECTOR_FEISHU_ALLOWED_CHATS: Comma-separated trusted chat IDs.OPENCLAW_CONNECTOR_FEISHU_BIND: Host to bind (default127.0.0.1).OPENCLAW_CONNECTOR_FEISHU_PORT: Port (default8094).OPENCLAW_CONNECTOR_FEISHU_PATH: Event ingress route (default/feishu/events).OPENCLAW_CONNECTOR_FEISHU_CALLBACK_PATH: Interactive callback route (default/feishu/callback).OPENCLAW_CONNECTOR_FEISHU_DOMAIN: API domain selector (feishuorlark).OPENCLAW_CONNECTOR_FEISHU_MODE: Transport mode (websocketdefault, orwebhook).OPENCLAW_CONNECTOR_FEISHU_REQUIRE_MENTION: Setfalseto allow commands without explicit mention in shared chats.OPENCLAW_CONNECTOR_FEISHU_REPLY_IN_THREAD: Setfalseto disable reply threading when the source chat supports it.
Image Delivery:
OPENCLAW_CONNECTOR_DELIVERY_MAX_IMAGES: Max completed images delivered per job (default4, clamped to1..16).OPENCLAW_CONNECTOR_DELIVERY_MAX_BYTES: Per-image delivery cap in bytes (default10485760, clamped to65536..52428800).OPENCLAW_CONNECTOR_DELIVERY_TIMEOUT_SEC: Result delivery timeout in seconds (default600, clamped to30..3600).OPENCLAW_CONNECTOR_PUBLIC_BASE_URL: Public HTTPS URL of your connector (e.g.https://your-tunnel.example.com). Required for sending images.OPENCLAW_CONNECTOR_MEDIA_PATH: URL path for serving temporary media (default/media).OPENCLAW_CONNECTOR_MEDIA_TTL_SEC: Image expiry in seconds (default300, clamped to60..86400).OPENCLAW_CONNECTOR_MEDIA_MAX_MB: Max image size in MB (default8, clamped to1..64).
Connector numeric guardrails:
- Platform bind ports (
OPENCLAW_CONNECTOR_LINE_PORT,...WHATSAPP_PORT,...WECHAT_PORT,...KAKAO_PORT,...SLACK_PORT,...FEISHU_PORT) must stay within1..65535; invalid or out-of-range values fall back to the platform default port. OPENCLAW_CONNECTOR_RATE_LIMIT_USER_RPM: Per-user connector rate limit (default10, clamped to1..600).OPENCLAW_CONNECTOR_RATE_LIMIT_CHANNEL_RPM: Per-channel connector rate limit (default30, clamped to1..600).OPENCLAW_CONNECTOR_MAX_COMMAND_LENGTH: Max accepted command text length (default4096, clamped to128..32768).
Note: Media URLs are signed with a secret derived from
OPENCLAW_CONNECTOR_ADMIN_TOKENor a random key. To ensure URLs remain valid after connector restarts, you must setOPENCLAW_CONNECTOR_ADMIN_TOKEN. LINE and WhatsApp also requirepublic_base_urlto be HTTPS. WeChat currently supports text-first control. Image/media upload delivery is not implemented in phase 1. Kakao currently supports text-first control and quick replies. Rich media delivery is not enabled in the default Kakao webhook flow. Slack supports text responses and image uploads (viafiles.uploadAPI). Feishu currently supports text replies plus interactive approval/command cards; richer card templates can be added on top of the same signed callback contract.
Connector commands are evaluated through a centralized authorization policy with three command classes:
public: low-risk status/help style commandsrun: execution commands such as/run(still subject to trust/approval behavior)admin: sensitive commands such as/trace,/approvals,/approve,/reject, and schedule controls
Default behavior:
- If no explicit allow-from list is configured for a command class, class-level defaults apply.
admincommands require the sender to be inOPENCLAW_CONNECTOR_ADMIN_USERS.publicandruncommands still pass through each platform adapter's trust/allowlist checks.
Optional policy controls:
OPENCLAW_COMMAND_OVERRIDES: JSON object mapping command name to class (public,run,admin).OPENCLAW_COMMAND_ALLOW_FROM_PUBLIC: comma-separated sender IDs.OPENCLAW_COMMAND_ALLOW_FROM_RUN: comma-separated sender IDs.OPENCLAW_COMMAND_ALLOW_FROM_ADMIN: comma-separated sender IDs.
Normalization rules:
- Command keys in
OPENCLAW_COMMAND_OVERRIDESare normalized to lowercase. - Missing leading
/is added automatically.
Example:
OPENCLAW_COMMAND_OVERRIDES='{"run":"admin","/status":"public"}'
OPENCLAW_COMMAND_ALLOW_FROM_ADMIN=alice_id,bob_id
OPENCLAW_COMMAND_ALLOW_FROM_RUN=alice_id,ops_bot_idIf a class-level OPENCLAW_COMMAND_ALLOW_FROM_* list is set and non-empty, only listed IDs can run that class.
python -m connectorUnlike Telegram/Discord which pull messages, LINE pushes webhooks to your connector.
Since the connector runs on localhost (default port 8099), you must expose it to the internet securely.
Option A: Cloudflare Tunnel (Recommended)
- Install
cloudflared. - Run:
cloudflared tunnel --url http://127.0.0.1:8099 - Copy the generated URL (e.g.
https://random-name.trycloudflare.com). - In LINE Developers Console > Messaging API > Webhook settings:
- Set URL to
https://<your-tunnel>/line/webhook(or your custom path). - Enable "Use webhook".
- Set URL to
Option B: Reverse Proxy (Nginx/Caddy)
- Configure your proxy to forward HTTPS traffic to
127.0.0.1:8099.
WhatsApp Cloud API delivers webhooks to your connector. You must expose it via HTTPS.
- Create a Meta app and add the WhatsApp product.
- Add a phone number and note its Phone Number ID.
- Configure the webhook URL:
https://<your-public-host>/whatsapp/webhook. - Set the webhook Verify Token to match
OPENCLAW_CONNECTOR_WHATSAPP_VERIFY_TOKEN. - Subscribe to
messagesevents. - Ensure
OPENCLAW_CONNECTOR_PUBLIC_BASE_URLis an HTTPS URL so media can be delivered.
If you run locally, use a secure tunnel (Cloudflare Tunnel or ngrok) and point it to http://127.0.0.1:8098.
WeChat Official Account pushes webhook requests to your connector. You must expose the WeChat endpoint publicly over HTTPS.
-
Prepare the required environment variables:
OPENCLAW_CONNECTOR_WECHAT_TOKEN=replace-with-your-wechat-token OPENCLAW_CONNECTOR_WECHAT_APP_ID=replace-with-your-wechat-app-id OPENCLAW_CONNECTOR_WECHAT_APP_SECRET=replace-with-app-secret OPENCLAW_CONNECTOR_WECHAT_ALLOWED_USERS=openid_1,openid_2 OPENCLAW_CONNECTOR_WECHAT_BIND=127.0.0.1 OPENCLAW_CONNECTOR_WECHAT_PORT=8097 OPENCLAW_CONNECTOR_WECHAT_PATH=/wechat/webhook
Use descriptive placeholders for App IDs in docs and examples. Secret scanners can treat AppID-shaped samples as real credentials even when they are only documentation.
-
Start the connector:
python -m connector
-
Expose the local webhook service to HTTPS (Cloudflare Tunnel or reverse proxy):
- local upstream:
http://127.0.0.1:8097 - public path:
/wechat/webhook - expected public URL:
https://<your-public-host>/wechat/webhook
- local upstream:
-
In WeChat Official Account backend (Developer settings / server config), configure:
- URL:
https://<your-public-host>/wechat/webhook - Token: same value as
OPENCLAW_CONNECTOR_WECHAT_TOKEN - EncodingAESKey: set according to your WeChat backend requirement
- Message encryption mode: use plaintext/compatible mode for this adapter path
- URL:
-
Save/submit server config. WeChat will call your endpoint with verification query parameters.
- expected success behavior: connector returns
echostrand logs verification success - expected failure behavior:
403 Verification failedif token/signature mismatches
- expected success behavior: connector returns
-
Functional test:
- follow your Official Account with a test user
- send
/helpor/status - verify connector receives command and returns text reply
-
Verify trusted/untrusted behavior:
- if sender OpenID is in
OPENCLAW_CONNECTOR_WECHAT_ALLOWED_USERS,/runcan execute directly (subject to trust/approval policy and command policy) - if not allowlisted, sensitive actions are routed to approval flow
- if sender OpenID is in
WeChat-specific notes:
- The adapter validates WeChat signature on every request and applies replay/timestamp checks.
- Timestamp skew outside policy window is rejected (
403 Stale Request). - XML payload parsing is bounded (size/depth/field caps) and fails closed on parser budget violations.
- DTD / ENTITY declarations are rejected before parser entry; the adapter does not attempt to recover from unsafe XML payloads.
- Runtime XML security gate is fail-closed: unsafe/missing parser baseline blocks ingress startup.
- Current command surface is text-first. Unsupported message/event types are ignored with success response.
- Proactive outbound API messaging requires both
OPENCLAW_CONNECTOR_WECHAT_APP_IDandOPENCLAW_CONNECTOR_WECHAT_APP_SECRET.
Kakao i Open Builder sends webhook requests to your connector Skill endpoint. You must expose the Kakao endpoint publicly over HTTPS.
-
Prepare the required environment variables:
OPENCLAW_CONNECTOR_KAKAO_ENABLED=true OPENCLAW_CONNECTOR_KAKAO_ALLOWED_USERS=kakao_user_id_1,kakao_user_id_2 OPENCLAW_CONNECTOR_KAKAO_BIND=127.0.0.1 OPENCLAW_CONNECTOR_KAKAO_PORT=8096 OPENCLAW_CONNECTOR_KAKAO_PATH=/kakao/webhook
-
Start the connector:
python -m connector
-
Expose the local webhook service to HTTPS (Cloudflare Tunnel or reverse proxy):
- local upstream:
http://127.0.0.1:8096 - public path:
/kakao/webhook - expected public URL:
https://<your-public-host>/kakao/webhook
- local upstream:
-
In Kakao i Open Builder:
- create/select your bot
- create/select a Skill
- set Skill server URL to
https://<your-public-host>/kakao/webhook - deploy/publish the Skill scenario that calls this Skill endpoint
-
Functional test:
- chat with your Kakao bot
- send
/helpor/status - verify connector receives command and returns a SkillResponse (
version: 2.0)
-
Verify trusted/untrusted behavior:
- if sender
userRequest.user.idis inOPENCLAW_CONNECTOR_KAKAO_ALLOWED_USERS,/runcan execute directly (subject to trust/approval policy and command policy) - if not allowlisted, sensitive actions are routed to approval flow
- if sender
-
Optional first-time allowlist bootstrap:
- temporarily leave
OPENCLAW_CONNECTOR_KAKAO_ALLOWED_USERSempty - send a test message and check logs for
Untrusted Kakao message from user=<id> - add that ID to allowlist and restart connector
- temporarily leave
Kakao-specific notes:
- Adapter is disabled unless
OPENCLAW_CONNECTOR_KAKAO_ENABLED=true. - Kakao webhook ingress is
POSTonly onOPENCLAW_CONNECTOR_KAKAO_PATH. - Replay protection is enabled: identical payloads within the replay window are acknowledged and not re-executed.
- Kakao command requests are normalized from:
userRequest.user.id->sender_iduserRequest.utterance-> command text
- Response format follows Kakao SkillResponse v2.0 with text-first output and optional quick replies.
- If
aiohttpis missing, the adapter is skipped at startup.
Slack uses the Events API webhook mode in OpenClaw. You must expose the endpoint publicly over HTTPS.
-
Create the Slack App
- Go to api.slack.com/apps.
- Create a new app (From scratch) and select your workspace.
- In Basic Information, copy the Signing Secret.
-
Configure OAuth Scopes and install
- Go to OAuth & Permissions.
- Add bot scopes:
chat:writefiles:writeapp_mentions:readim:history(DM support)channels:history(public channel messages)groups:history(private channel messages)
- For legacy single-workspace mode, click Install to Workspace and copy the Bot User OAuth Token (
xoxb-...). - For multi-workspace mode, configure a redirect URL and let OpenClaw handle installs through its OAuth routes.
-
Configure connector environment variables
OPENCLAW_CONNECTOR_SLACK_SIGNING_SECRET=your-signing-secret OPENCLAW_CONNECTOR_SLACK_CLIENT_ID=1234567890.1234567890 OPENCLAW_CONNECTOR_SLACK_CLIENT_SECRET=replace-with-client-secret OPENCLAW_CONNECTOR_PUBLIC_BASE_URL=https://your-public-host OPENCLAW_CONNECTOR_SLACK_OAUTH_INSTALL_PATH=/slack/install OPENCLAW_CONNECTOR_SLACK_OAUTH_CALLBACK_PATH=/slack/oauth/callback OPENCLAW_CONNECTOR_SLACK_INTERACTIONS_PATH=/slack/interactions OPENCLAW_CONNECTOR_SLACK_ALLOWED_USERS=U12345,U67890 OPENCLAW_CONNECTOR_SLACK_ALLOWED_CHANNELS=C12345 OPENCLAW_CONNECTOR_SLACK_BIND=127.0.0.1 OPENCLAW_CONNECTOR_SLACK_PORT=8095 OPENCLAW_CONNECTOR_SLACK_PATH=/slack/events OPENCLAW_CONNECTOR_SLACK_REQUIRE_MENTION=true OPENCLAW_CONNECTOR_SLACK_REPLY_IN_THREAD=true OPENCLAW_CONNECTOR_ADMIN_TOKEN=replace-with-openclaw-admin-token
Notes:
- Legacy single-workspace fallback can still set
OPENCLAW_CONNECTOR_SLACK_BOT_TOKEN=xoxb-...; multi-workspace mode no longer requires that token at startup if OAuth install flow is configured. OPENCLAW_CONNECTOR_ADMIN_TOKENmust match serverOPENCLAW_ADMIN_TOKENif server-side admin token is enabled.- Slack ingress is fail-closed: invalid/missing signature, stale timestamp, and replayed events are rejected.
- Slack interactive callbacks use the same signing-secret verification and route actions through the connector policy layer before executing run-affecting behavior.
- OAuth callbacks also fail closed on invalid or replayed
statevalues. - External OAuth/install failures intentionally use bounded generic text; inspect connector logs and installation diagnostics for redacted detail instead of expecting raw exception text in the callback response.
- Legacy single-workspace fallback can still set
-
Start connector and expose webhook endpoint
- Start connector:
python -m connector - Expose local endpoint to public HTTPS (Cloudflare Tunnel/ngrok/reverse proxy):
- local upstream:
http://127.0.0.1:8095 - public URL:
https://<public-host>/slack/events - interactions URL:
https://<public-host>/slack/interactions - install URL:
https://<public-host>/slack/install - callback URL:
https://<public-host>/slack/oauth/callback
- local upstream:
- Start connector:
-
Enable Event Subscriptions and Interactivity
- Go to Event Subscriptions and enable events.
- Set Request URL to
https://<public-host>/slack/events. - Slack sends
url_verification; connector responds automatically. - Add bot events:
app_mentionmessage.channelsmessage.groupsmessage.im
- Go to Interactivity & Shortcuts and enable interactivity.
- Set Request URL to
https://<public-host>/slack/interactions.
-
Invite and validate
- Open
https://<public-host>/slack/installand complete the workspace install. - Invite the app to target channels:
/invite @YourBot. - In channel:
@YourBot /status(whenOPENCLAW_CONNECTOR_SLACK_REQUIRE_MENTION=true). - In DM:
/help. - For approval or action-capable replies, press a rendered Slack button and confirm the connector logs show a signed interaction accepted or a bounded policy rejection.
- Verify connector logs show signed ingress accepted and replies delivered.
- Verify
GET /openclaw/connector/installationsshows the Slack workspace binding and health stateok. - If you test uninstall/token-revoke scenarios, verify the installation health flips to
revokedorinvalid_tokenand that subsequent replies for that workspace fail closed until reinstalled.
- Open
-
Security checklist before production
- Keep
OPENCLAW_CONNECTOR_SLACK_ALLOWED_USERS/OPENCLAW_CONNECTOR_SLACK_ALLOWED_CHANNELSrestricted. - Keep
OPENCLAW_CONNECTOR_SLACK_REQUIRE_MENTION=trueunless intentionally running command-style channels. - Rotate Slack signing secret and OAuth client secret on incident response.
- Do not expose connector without HTTPS termination.
- Keep
Use Socket Mode when you cannot expose a public HTTPS webhook endpoint.
-
Enable Socket Mode in Slack
- Open your Slack App settings.
- Go to Socket Mode and enable it.
- Create an App-Level Token (
xapp-...) withconnections:write.
-
Configure connector
OPENCLAW_CONNECTOR_SLACK_MODE=socket OPENCLAW_CONNECTOR_SLACK_APP_TOKEN=xapp-your-token # Signing secret remains required for parity/security checks. OPENCLAW_CONNECTOR_SLACK_SIGNING_SECRET=your-signing-secret # Either configure legacy single-workspace token... OPENCLAW_CONNECTOR_SLACK_BOT_TOKEN=xoxb-your-token # ...or configure multi-workspace OAuth install flow: OPENCLAW_CONNECTOR_SLACK_CLIENT_ID=1234567890.1234567890 OPENCLAW_CONNECTOR_SLACK_CLIENT_SECRET=replace-with-client-secret
-
Start connector
python -m connector- Expect log:
Slack Socket Mode connected.
Notes:
- Socket Mode uses outbound WebSocket, so
OPENCLAW_CONNECTOR_SLACK_BIND,OPENCLAW_CONNECTOR_SLACK_PORT, andOPENCLAW_CONNECTOR_SLACK_PATHare ignored in this mode. - Startup is fail-closed if
OPENCLAW_CONNECTOR_SLACK_APP_TOKENis missing or does not start withxapp-. - In multi-workspace mode, outbound replies still resolve the workspace-specific bot token from the installation registry even though the WebSocket connection itself uses the app-level token.
Feishu support can run in either long-connection (websocket) mode or webhook mode. Long-connection is usually the simpler default for message ingress, but interactive cards still need a reachable callback route if you want approval buttons and other signed actions.
-
Create the Feishu or Lark app
- Create a bot app in the Feishu or Lark developer console.
- Record the
App IDandApp Secret. - If you want webhook ingress, also configure the event subscription verification token.
- If encrypted event delivery is enabled, record the encrypt key as well.
-
Choose transport mode
OPENCLAW_CONNECTOR_FEISHU_MODE=websocket- Uses long connection for message ingress.
- Recommended when you do not want to expose the event route publicly.
OPENCLAW_CONNECTOR_FEISHU_MODE=webhook- Uses HTTPS webhook delivery for messages.
- Requires a public HTTPS route for
OPENCLAW_CONNECTOR_FEISHU_PATH.
-
Configure the default binding
OPENCLAW_CONNECTOR_FEISHU_APP_ID=cli_xxx OPENCLAW_CONNECTOR_FEISHU_APP_SECRET=sec_xxx OPENCLAW_CONNECTOR_FEISHU_ACCOUNT_ID=acct-default OPENCLAW_CONNECTOR_FEISHU_DEFAULT_ACCOUNT_ID=acct-default OPENCLAW_CONNECTOR_FEISHU_WORKSPACE_ID=tenant-alpha OPENCLAW_CONNECTOR_FEISHU_WORKSPACE_NAME="Alpha Workspace" OPENCLAW_CONNECTOR_FEISHU_DOMAIN=feishu OPENCLAW_CONNECTOR_FEISHU_MODE=websocket OPENCLAW_CONNECTOR_FEISHU_ALLOWED_USERS=ou_xxx,ou_yyy OPENCLAW_CONNECTOR_FEISHU_ALLOWED_CHATS=oc_xxx,oc_yyy -
Optional: multi-account binding manifest
- Use
OPENCLAW_CONNECTOR_FEISHU_BINDINGS_JSONwhen one connector runtime should host more than one Feishu/Lark app or workspace binding. - Each entry may include:
account_idapp_idapp_secretworkspace_idworkspace_nameverification_tokenencrypt_keydomainmode
- Use
-
Configure interactive callback ingress
- Set
OPENCLAW_CONNECTOR_PUBLIC_BASE_URLto your public HTTPS origin. - Expose
OPENCLAW_CONNECTOR_FEISHU_CALLBACK_PATH(default/feishu/callback) through your reverse proxy or tunnel. - In long-connection mode this callback route is still required for interactive approval cards; message ingress transport does not remove callback security requirements.
- Set
-
Start connector
python -m connector- Expect logs showing the chosen Feishu mode and callback/event route bindings.
-
Verify runtime behavior
- Run
/statusfrom an allowlisted Feishu/Lark user. - Run
/approvalsand confirm the reply renders approval buttons as an interactive card. - Click
ApproveorRejecton a test approval and verify the callback succeeds once, then duplicate clicks are deduped.
- Run
Notes:
OPENCLAW_CONNECTOR_FEISHU_DOMAIN=larkswitches outbound API host behavior without changing the rest of the connector contract.- Untrusted users can still see bounded command responses, but run-affecting interactive actions are downgraded to approval flow instead of auto-executing.
- Callback signing secrets are resolved from the bound Feishu installation record; diagnostics expose binding state, not raw secret material.
- Callback/event wrapper failures intentionally return bounded external error codes; inspect logs and installation diagnostics for redacted detail instead of expecting stack traces in callback responses.
General:
| Command | Description |
|---|---|
/status |
Check ComfyUI system status, logs, and queue size. |
/jobs |
View active jobs and queue summary. |
/history <id> |
View details of a finished job. |
/help |
Show available commands. |
/run <template> [k=v] [--approval] |
Submit a job. Use --approval to request approval gate instead of creating job immediately. |
/stop [job_id ...] |
Stop jobs. With no job IDs, sends an explicit global interrupt. With one or more IDs, requests targeted job cancellation through ComfyUI's jobs API; older single-job hosts may fall back to targeted interrupt. |
/cancel [job_id ...], /interrupt [job_id ...] |
Aliases for /stop with the same targeted or global behavior. |
Admin Only:
(Requires User ID in OPENCLAW_CONNECTOR_ADMIN_USERS)
| Command | Description |
|---|---|
/trace <id> |
View raw execution logs/trace for a job. |
/approvals |
List pending approvals. |
/approve <id> |
Approve a pending request (triggers execution immediately). |
/reject <id> [reason] |
Reject a workflow. |
/schedules |
List schedules. |
/schedule run <id> |
Trigger a schedule immediately. |
-
Submission (Admin):
User: /run my-template steps=20 --approval Bot: [Approval Requested] ID: apr_12345 Trace: ... Expires: 2026-02-07T12:00:00Z -
Approval (Admin):
User: /approve apr_12345 Bot: [Approved] apr_12345 Executed: p_98765
-
(Not Executed):
- If
/approvereturns[Approved] ... (Not Executed), it means the request state was updated to Approved, but the job could not be autostarted. - Reason: Backend might lack a submit handler for this trigger type, or
auto_executefailed. Checkopenclawserver logs. - Action: Manually run the job using the template/inputs from the approval request.
- If
-
Access Denied:
- Sender is not in
OPENCLAW_CONNECTOR_ADMIN_USERS. - Fix: Add ID to
.envand restart connector.
- Sender is not in
-
No visible chat reply after a command:
- The command may have completed in a context where text-only replies are intentionally suppressed, such as internal delivery, tool-only handling, or a shared chat/channel without an active mention.
- Fix: check connector logs and job/approval state. Approval cards and action buttons should still be delivered when the action requires visible operator input.
-
Duplicate platform event is acknowledged but not executed again:
- The connector has already committed the action and treats the retry/replay as a successful no-op.
- Fix: check the original event, job, or approval record instead of resending the same action payload. Retry only failures that happened before delivery/action commit.
-
HTTP 403 (Admin Token):
- Connector has the right user allowlist, but the upstream OpenClaw server rejected the Admin Token.
- Fix: Ensure
OPENCLAW_CONNECTOR_ADMIN_TOKENmatches the server'sOPENCLAW_ADMIN_TOKEN.
-
Kakao requests not arriving:
OPENCLAW_CONNECTOR_KAKAO_ENABLEDis nottrue, or Kakao Skill URL/path does not matchOPENCLAW_CONNECTOR_KAKAO_PATH.- Fix: set
OPENCLAW_CONNECTOR_KAKAO_ENABLED=true, verify public HTTPS URL, and confirm Skill URL exactly matches/kakao/webhook(or your custom path).
-
Kakao returns empty/fallback response:
- Payload is malformed (missing
userRequest.user.id/userRequest.utterance) or the adapter rejected malformed JSON. - Fix: validate Skill request payload shape in Open Builder test console and check connector logs for
Bad JSON/ payload errors.
- Payload is malformed (missing
-
Kakao
/runalways goes to approval:- Sender is not in
OPENCLAW_CONNECTOR_KAKAO_ALLOWED_USERS(or allowlist is empty). - Fix: capture
userRequest.user.idfrom logs, add it toOPENCLAW_CONNECTOR_KAKAO_ALLOWED_USERS, restart connector.
- Sender is not in
-
Slack Event Subscriptions verification fails:
- Request URL/path mismatch, connector not reachable, or
OPENCLAW_CONNECTOR_SLACK_SIGNING_SECRETis wrong. - Fix: confirm public URL points to
/slack/events, verify tunnel/proxy routes to127.0.0.1:8095, and re-check Signing Secret.
- Request URL/path mismatch, connector not reachable, or
-
Slack commands ignored in channels:
OPENCLAW_CONNECTOR_SLACK_REQUIRE_MENTION=trueand message does not mention the bot.- Fix: mention bot explicitly (
@Bot /status) or setOPENCLAW_CONNECTOR_SLACK_REQUIRE_MENTION=falseif policy allows.
-
Slack OAuth callback shows only a generic install failure:
- This is expected on current builds; callback responses intentionally suppress raw exception text.
- Fix: inspect connector logs plus
GET /openclaw/connector/installations//resolvediagnostics to find the redacted root cause.
-
I need to know whether the connector is supported as a separate package/repo yet:
- Current builds intentionally keep the connector in-repo as an optional attached subsystem.
- Fix: review
GET /openclaw/connector/extraction-contractor ADR-0003 for the current no-split recommendation and the seam blockers that still need to be versioned first.
-
Feishu callback buttons fail with signature or stale-action errors:
- Callback route is not using the same bound app secret, request arrived too late, or the button payload was replayed.
- Fix: verify binding diagnostics, public callback route, connector clock, and that the same action is not being resent by proxy/retry middleware.
-
Feishu long-connection messages work but card actions do nothing:
OPENCLAW_CONNECTOR_FEISHU_CALLBACK_PATHis not exposed publicly, or the callback URL is not routed to the connector bind host/port.- Fix: expose the callback route over HTTPS even when
OPENCLAW_CONNECTOR_FEISHU_MODE=websocket.
-
Feishu
/runaction becomes approval instead of executing immediately:- Callback actor is untrusted under current allowlist/policy mapping.
- Fix: add the user/chat to
OPENCLAW_CONNECTOR_FEISHU_ALLOWED_USERSor_ALLOWED_CHATS, or keep the approval downgrade as the intended posture.
-
Feishu callback returns a bounded code such as
callback_rejectedorevent_rejected:- This is expected on current builds; callback wrappers intentionally avoid echoing raw exception detail to the caller.
- Fix: inspect connector logs and installation/binding diagnostics for the redacted failure context.