Microsoft Teams
Microsoft Teams is how a running workflow talks to people. An agent can post a card that asks a question, wait for the answer, and then continue.
Teams is the only chat service Anthara works with. There is no Slack integration.
Anthara uses two separate things in Teams:
| Teams bot | Teams connection | |
|---|---|---|
| What it is | A bot registered for the whole deployment | Your own sign-in to Microsoft |
| Who sets it up | Whoever installs Anthara | Each person, on the Connections page |
| Used for | Posting cards to a channel and receiving the answers | Sending chat messages as you, and proving who you are on approval cards |
The Teams bot
Section titled “The Teams bot”The bot is configured when Anthara is installed, with these settings:
| Setting | Meaning |
|---|---|
TEAMS_BOT_APP_ID |
The bot’s application ID. |
TEAMS_BOT_TENANT_ID |
The Microsoft tenant the bot belongs to. |
TEAMS_BOT_APP_PASSWORD |
The bot’s client secret. |
Teams sends card answers to the API route /teams/webhook. On a standard install the address is https://<your-domain>/api/teams/webhook. Set it as the bot’s messaging endpoint.
The Teams connection
Section titled “The Teams connection”A connection is your own sign-in to Microsoft through an OAuth app. To create one, see Connections.
Anthara asks Microsoft for these permissions:
| Permission | Why |
|---|---|
openid, profile, User.Read |
Identify you. |
Team.ReadBasic.All, Channel.ReadBasic.All |
List your teams and channels. |
ChatMessage.Send, Chat.ReadWrite |
Send and read chat messages. |
Files.ReadWrite.All |
Read and write files. |
OnlineMeetings.Read, OnlineMeetingTranscript.Read.All |
Read meetings and their transcripts. |
offline_access |
Stay connected without asking you to sign in again. |
In a workflow, a connection named Microsoft Teams reaches the agent as the environment variable MICROSOFT_TEAMS_ACCESS_TOKEN.
Ask a question with a card
Section titled “Ask a question with a card”Mark an ai_task step as interactive. The agent can then post a card and wait.
- name: confirm-scope type: ai_task config: interactive: true teams_channel_id: '19:replace-with-your-channel-id@thread.v2' teams_service_url: 'https://smba.trafficmanager.net/teams/' prompt: | Ask the team whether story {{inputs.issueKey}} is in scope for this sprint. Use the ask_with_card tool. Wait for the answer, then report it.| Key | Meaning |
|---|---|
interactive |
Set to true to give the agent the card tools. |
teams_channel_id |
The Teams channel that receives the card. |
teams_service_url |
The Bot Framework service address for your Teams region. |
card_title, card_description |
Optional. Text shown for the card in the run view. |
An interactive agent has two card tools:
| Tool | What it does |
|---|---|
ask_with_card |
Posts a card with one to five questions and waits for the answer. A question is a choice list or a free-text box. |
notify_card |
Posts a card with a title and a description. It asks nothing and does not wait. |
What happens while a card waits
Section titled “What happens while a card waits”- The agent calls
ask_with_card. The card appears in the channel with a Submit Response button. - The worker saves its session and stops. The run shows the status Collaboration Loop.
- Someone answers the card. The card is updated in place.
- Anthara starts a new worker. It continues the same session with the answers.
A waiting run uses no worker. A scheduled workflow keeps starting new runs while an older run waits on a card.
If the agent finishes a turn after an answer without posting another card, Anthara posts a recovery card that offers to retry or stop.
Who can answer
Section titled “Who can answer”| Card | Who can answer | Time limit |
|---|---|---|
A card from ask_with_card |
Anyone who can see the card in the channel. The first answer is used. | None |
| A fix-approval card | An Anthara admin who has connected Microsoft Teams on the Connections page | 24 hours |
A fix-approval card comes from a step that sets review_fixes: true. It asks an admin to approve changes to your AI Coding Standards. Anthara checks who clicked, and refuses anyone who is not a connected admin.
Send a chat message
Section titled “Send a chat message”A send_message step with the microsoft_teams provider posts a message to a Teams chat. It posts as the person whose connection the run uses.
- name: tell-the-team type: send_message provider: microsoft_teams connection: Microsoft Teams config: chatId: '19:replace-with-your-chat-id@thread.v2' message: 'The nightly readiness check finished.'config.chatId is required.
For more on cards, see Teams cards.