Skip to content

[Feature]: Support multiple Microsoft Teams bot accounts in one gateway #72876

Description

@SimSef

Summary

Allow the Microsoft Teams channel to define multiple bot/app accounts, similar to Discord accounts, so one OpenClaw gateway can route different Teams apps to different agents.

Problem to solve

The current Microsoft Teams channel appears to support only one top-level channels.msteams config. This makes it hard to run multiple Teams-facing agents from one OpenClaw gateway.

Discord supports multiple accounts and bindings, for example separate bot accounts for Forge, Boardkeeper, CRM, etc. I would like the same pattern for Teams:

  • main <- msteams accountId=forge
  • boardkeeper <- msteams accountId=boardkeeper

Without multi-account Teams support, each Teams bot/app may require a separate gateway instance, webhook port, reverse proxy path, and deployment lifecycle, even when all agents already live in the same OpenClaw gateway.

Proposed solution

Add first-class multi-account support to the Microsoft Teams channel, mirroring the existing Discord account model.

Desired config shape could be something like:

channels: {
  msteams: {
    enabled: true,
    accounts: {
      forge: {
        appId: "...",
        appPassword: "...",
        tenantId: "...",
        webhook: { port: 3978, path: "/api/messages/forge" },
        dmPolicy: "allowlist",
        allowFrom: ["<aad-object-id>"]
      },
      boardkeeper: {
        appId: "...",
        appPassword: "...",
        tenantId: "...",
        webhook: { port: 3978, path: "/api/messages/boardkeeper" },
        dmPolicy: "allowlist",
        allowFrom: ["<aad-object-id>"]
      }
    }
  }
}


### Alternatives considered


**Alternatives considered**
```md
Run one OpenClaw gateway instance per Teams bot/app.

This works in theory, but it is heavier operationally: each Teams-facing agent needs its own gateway process, webhook port/path, reverse proxy rule, service config, health checks, secrets, and deployment lifecycle.

Use one Teams bot/app as a shared hub and route by conversation.

This is simpler at the infrastructure layer, but weaker when each agent should appear as a distinct Teams app/bot identity. It also makes permissions, install flow, branding, and deterministic agent routing less clear.

Manually swap the single `channels.msteams` config between apps.

This is only useful for testing. It cannot support multiple live Teams agents at the same time.


### Impact

Affected users/systems/channels:
- Teams users who want multiple OpenClaw agents exposed as separate Teams apps/bots
- Deployments that already use multiple Discord accounts/agents and want parity on Teams
- Single-gateway OpenClaw deployments with several agent personas

Severity:
- Blocks the intended Teams hub workflow when multiple agents need separate Teams identities.

Frequency:
- Always, for any deployment that needs more than one Teams bot/app connected to one gateway.

Consequence:
- Requires extra gateway instances or config swapping.
- Adds reverse proxy, service, port, secret, and deployment overhead.
- Makes Teams less ergonomic than Discord for multi-agent OpenClaw setups.


### Evidence/examples

Current Discord setup supports multiple accounts and bindings:

```text
main <- discord accountId=forge
boardkeeper <- discord accountId=boardkeeper
crm <- discord accountId=crm
radar <- discord accountId=radar


### Additional information

This should remain backward-compatible with the current single-account Teams config.

A migration path could treat existing `channels.msteams.appId/appPassword/tenantId/webhook` as the implicit `default` account, while allowing new deployments to opt into `channels.msteams.accounts`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions