{"slug": "running-multiple-ai-agents-as-slack-teammates-via-openclaw", "title": "Running Multiple AI Agents as Slack Teammates via OpenClaw", "summary": "The article explains how to configure multiple AI agents as individual Slack teammates using the OpenClaw gateway, with each agent having its own Slack app, bot token, and distinct identity for independent DMs and shared channel participation. It provides step-by-step instructions for creating Slack apps, setting up Socket Mode, configuring OAuth scopes and event subscriptions, and defining account bindings to route each agent to a specific Slack bot. The setup supports centralized orchestration through a primary agent while allowing delegation to specialist agents with shared session visibility.", "body_md": "Goal: Run multiple AI agents as real Slack teammates — each with its own identity, able to DM independently or participate in shared channels — while keeping orchestration centralized through one primary agent.\nUse one Slack app/bot per agent identity. For example, if you have four agents:\nEach Slack app maps to one accountId\nin channels.slack.accounts\n, and bindings\nroute each account to its OpenClaw agent.\nThis gives each agent true individual DMs plus group-chat presence in shared channels.\nAdapt the number of bots to however many agents you have. The pattern is the same for 2 or 10.\n- Slack workspace admin rights (or the ability to create and install apps).\n- OpenClaw gateway running on a machine that stays online.\n- Existing agent IDs configured in OpenClaw (e.g.\nmain\n,agent-2\n,agent-3\n…). - For each Slack app:\n- Bot token:\nxoxb-...\n- App-level token:\nxapp-...\n(Socket Mode +connections:write\nscope)\n- Bot token:\nRepeat this for every agent you want on Slack.\n- Go to https://api.slack.com/apps.\n- Click Create New App → From scratch.\n- Give it a name (e.g.\nAlice\n) and select your workspace.\n- In the left menu, click Socket Mode.\n- Enable Socket Mode.\n- Click Generate Token and Scopes.\n- Add scope:\nconnections:write\n. - Save the generated App-Level Token (\nxapp-...\n).\n- Left menu: OAuth & Permissions.\n- Under Bot Token Scopes, add:\nchat:write\napp_mentions:read\nchannels:read\n,channels:history\ngroups:history\nim:history\n,mpim:history\nusers:read\nassistant:write\n- Click Install to Workspace (or Reinstall after scope changes).\n- Copy the Bot User OAuth Token (\nxoxb-...\n).\nIf\nassistant:write\ndoesn't appear in the scope list, go to App Settings → Agents & AI Apps, enable it, then return to OAuth & Permissions.\n- Left menu: Event Subscriptions → enable events.\n- Subscribe to bot events:\napp_mention\nmessage.channels\nmessage.groups\nmessage.im\nmessage.mpim\n- Left menu: App Home → enable Messages Tab (required for DMs to work).\nOptional events (enable if your agents need reactions, pins, or file handling):\nreaction_added\n,reaction_removed\npin_added\n,pin_removed\nmember_joined_channel\n,member_left_channel\nOptional scopes (same context):\nreactions:read\n,reactions:write\npins:read\n,pins:write\nfiles:read\n,files:write\ncommands\nIn Slack, in each channel where the bot should participate:\n/invite @Alice\nBefore configuring all bots, test with one. Patch your config:\n{\n\"channels\": {\n\"slack\": {\n\"enabled\": true,\n\"mode\": \"socket\",\n\"botToken\": \"xoxb-YOUR-FIRST-BOT-TOKEN\",\n\"appToken\": \"xapp-YOUR-FIRST-APP-TOKEN\",\n\"groupPolicy\": \"allowlist\",\n\"streaming\": false,\n\"replyToMode\": \"all\",\n\"channels\": {\n\"C_YOUR_CHANNEL_ID\": {\n\"allow\": true,\n\"requireMention\": false\n}\n}\n}\n}\n}\nRestart and validate:\nopenclaw gateway restart\nopenclaw status\nopenclaw doctor --non-interactive\nExpected: Slack ON/OK\n.\nOnce one bot is stable, expand to multiple accounts:\n{\n\"channels\": {\n\"slack\": {\n\"enabled\": true,\n\"mode\": \"socket\",\n\"dmPolicy\": \"pairing\",\n\"groupPolicy\": \"allowlist\",\n\"streaming\": false,\n\"replyToMode\": \"all\",\n\"channels\": {\n\"C_YOUR_TEAM_CHANNEL_ID\": {\n\"allow\": true,\n\"requireMention\": true\n}\n},\n\"accounts\": {\n\"alice\": { \"name\": \"Alice\", \"botToken\": \"xoxb-...\", \"appToken\": \"xapp-...\" },\n\"bob\": { \"name\": \"Bob\", \"botToken\": \"xoxb-...\", \"appToken\": \"xapp-...\" },\n\"carla\": { \"name\": \"Carla\", \"botToken\": \"xoxb-...\", \"appToken\": \"xapp-...\" },\n\"dave\": { \"name\": \"Dave\", \"botToken\": \"xoxb-...\", \"appToken\": \"xapp-...\" }\n}\n}\n}\n}\nUse channel IDs (\nC_...\n), not channel names (#general\n). Names causemissing_scope\nwarnings and can break routing.\n{\n\"bindings\": [\n{ \"agentId\": \"main\", \"match\": { \"channel\": \"slack\", \"accountId\": \"alice\" } },\n{ \"agentId\": \"agent-2\", \"match\": { \"channel\": \"slack\", \"accountId\": \"bob\" } },\n{ \"agentId\": \"agent-3\", \"match\": { \"channel\": \"slack\", \"accountId\": \"carla\" } },\n{ \"agentId\": \"agent-4\", \"match\": { \"channel\": \"slack\", \"accountId\": \"dave\" } }\n]\n}\nThis lets the primary agent delegate to specialists and lets them share session visibility:\n{\n\"tools\": {\n\"agentToAgent\": {\n\"enabled\": true,\n\"allow\": [\"main\", \"agent-2\", \"agent-3\", \"agent-4\"]\n},\n\"sessions\": {\n\"visibility\": \"all\"\n}\n},\n\"agents\": {\n\"list\": [\n{\n\"id\": \"main\",\n\"subagents\": {\n\"allowAgents\": [\"agent-2\", \"agent-3\", \"agent-4\"]\n}\n}\n]\n}\n}\nRestart:\nopenclaw gateway restart\nIf you want agents to hand off context within the same Slack thread — e.g. agent-3 analyzes data, then agent-2 continues the conversation referencing that output — add this:\n{\n\"channels\": {\n\"slack\": {\n\"historyLimit\": 80,\n\"thread\": {\n\"historyScope\": \"thread\",\n\"inheritParent\": true,\n\"initialHistoryLimit\": 50\n},\n\"channels\": {\n\"C_YOUR_TEAM_CHANNEL_ID\": {\n\"allow\": true,\n\"requireMention\": true,\n\"allowBots\": true\n}\n}\n}\n}\n}\nallowBots: true\n— lets each agent consume other bots' messages as context.requireMention: true\n— prevents bot loops (each bot only responds when explicitly tagged).thread.*\n+historyLimit\n— keeps full continuity inside a Slack thread.\nDM any bot directly in Slack. Context is isolated per agent/session.\nPut all bots in one channel with requireMention: true\n. Call each one explicitly:\n@Alice summarize the thread above\n@Bob critique this positioning copy\n@Carla pull the numbers for last week\n@Dave propose implementation steps\nYou don't need to copy-paste between agents. Keep everything in the same Slack thread:\n- Tag one agent with the first ask:\n@Carla analyze these metrics and summarize the key signal.\n- Wait for the reply.\n- In the same thread, tag the next agent:\n@Bob use Carla's analysis above and propose the communication angle.\nWith allowBots\nand thread history configured, the second agent sees the first agent's output as context automatically.\nUse your primary agent (main\n) as a coordinator:\n- Ask it in DM or channel.\n- It delegates to specialists via\nsessions_spawn(agentId=...)\n. - It returns one synthesized answer.\nThis keeps the channel clean while using specialist depth under the hood.\nNote: the very first message after setup can occasionally produce a duplicate reply. This is a known edge case and typically doesn't recur.\nAfter full setup:\nopenclaw channels status --probe\nopenclaw doctor\n- DM each bot individually and confirm it replies.\n- In the team channel, mention each bot once and confirm routing.\n- Test thread handoff: ask one bot, then tag another in the same thread.\n- Test orchestration: ask the primary agent to delegate a task to a specialist.", "url": "https://wpnews.pro/news/running-multiple-ai-agents-as-slack-teammates-via-openclaw", "canonical_source": "https://gist.github.com/rafaelquintanilha/9ca5ae6173cd0682026754cfefe26d3f", "published_at": "2026-02-24 19:05:06+00:00", "updated_at": "2026-05-24 00:35:20.501882+00:00", "lang": "en", "topics": ["artificial-intelligence", "developer-tools", "enterprise-software", "products"], "entities": ["OpenClaw", "Slack"], "alternates": {"html": "https://wpnews.pro/news/running-multiple-ai-agents-as-slack-teammates-via-openclaw", "markdown": "https://wpnews.pro/news/running-multiple-ai-agents-as-slack-teammates-via-openclaw.md", "text": "https://wpnews.pro/news/running-multiple-ai-agents-as-slack-teammates-via-openclaw.txt", "jsonld": "https://wpnews.pro/news/running-multiple-ai-agents-as-slack-teammates-via-openclaw.jsonld"}}