#Running two separate MS Teams bots with different agent identities β€” possible?

1 messages Β· Page 1 of 1 (latest)

gritty olive
#

I have two companies on the same M365 tenant. I've set up separate Azure Bots for each with their own App IDs and Teams manifests. I want employees at each company to DM their respective bot and get a different agent personality/workspace.

Currently msteams only supports one appId/appPassword in the config. Routing bindings work great for channel messages (I can route by team ID to different agents), but DMs always go to the one configured bot.

Is there a way to:

  1. Configure two msteams bot identities in one OpenClaw instance? (like Telegram's accounts pattern)
  2. Or route DMs to different agents based on the bot App ID that received them?

Setup: OpenClaw 2026.4.15, single gateway

Workaround I'm considering: Running a second OpenClaw instance on a separate machine for the second bot. But if there's a native multi-bot solution, I'd prefer one instance.

Thanks!

shrewd muskBOT
compact estuaryBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> βœ… Mark Solution

shrewd muskBOT
torpid swanBOT
#

Let me verify the actual docs path and then I’ll check the Teams adapter code directly.

#

Short answer: not in one OpenClaw instance today.

I checked the current docs/source for 2026.4.x:

  1. Two Teams bot identities in one instance?
    No. channels.msteams is still a single bot credential surface (appId, appPassword, tenantId), unlike channels that have accounts. The Teams setup code also hard-resolves to the single default account.

  2. Route DMs by the bot App ID that received them?
    Also no. The routing matcher supports things like channel, accountId, peer, teamId, etc., but not Teams bot App ID / recipient bot ID. For Teams DMs, the route is resolved off the sender/conversation, not β€œwhich Azure Bot identity got it”.

So your current understanding is right: channel/team routing works, but DM separation by bot identity does not with one Teams provider.

Best workaround

You do not need a second machine. A second OpenClaw gateway/profile on the same host is the cleanest supported workaround:

  • one profile/gateway per Teams bot
  • separate config/state/workspace
#
  • separate port/public webhook URL
  • each Teams manifest points to its own gateway /api/messages

Docs:

So, practically:

  • Company A bot β†’ OpenClaw profile A β†’ agent/workspace A
  • Company B bot β†’ OpenClaw profile B β†’ agent/workspace B

If you want, I can sketch the exact two-profile config layout for this setup. Also, this sounds like a legit feature request: msteams.accounts + DM routing by inbound bot identity. If you file it, use GitHub issues: https://github.com/openclaw/openclaw/issues

If this fixed it, please right-click the solution message β†’ Apps β†’ βœ… Mark Solution so Answer Overflow indexes it.