Read and post channel and chat messages, create channels, chats and online meetings, or just drop a message into a channel through a webhook, from any Windmill script, flow or app. Flows can also run from a /windmill command typed in Teams.
Set up in 3 steps
Connect from the Resources page
Open Resources, click Add a resource/API and pick ms_teams from the OAuth APIs list. Click Connect and sign in with your work or school Microsoft account, then name the resource and save it. Scripts act as that user, in the teams and chats they belong to.
Run your first script
Fork the send channel message script below and pick a team and channel from the dropdowns. Listing teams, channels and chats, sending and replying, creating chats and online meetings all run on a default connection.
Or post through an incoming webhook
To only post to one channel, with no sign-in: add an incoming webhook to the channel in Teams, copy its URL, and save it in a resource of type ms_teams_webhook.
Scripts
Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.
Send Chat Message
Send Channel Message
Search Messages
Reply to Channel Message
List Teams
List Team Members
List Shifts
List Message Replies
List Chats
List Chat Messages
List Channels
List Channel Messages
List Channel Members
Get Current User
Get Chat Message
Get Channel Message
Create Online Meeting
Create Chat
Create Channel
Variable expiration handler
Send a message to MS Teams channel via webhook
Send a message to Microsoft Teams via Bot Framework
Microsoft Teams approval
Interactive Microsoft Teams approval
Schedule success handler
Schedule recovery handler
Workspace or Schedule error handler
Example of responding to a Microsoft Teams command
Trigger flows from Microsoft Teams
Microsoft Teams is not only a destination. These inbound paths are supported today.
Teams commands
Type /windmill in Teams and it runs a script, with what you typed as its inputs. A workspace admin connects Teams once from Workspace settings, under the Slack / Teams tab.
Resource types
The credential shapes the scripts on this page expect — pick the one your script asks for.
ms_teams
View raw schema →| Field | Type | Required | What it is |
|---|---|---|---|
| token | string | Yes | Microsoft Graph access token. Filled in and refreshed by Windmill when you connect with OAuth. |
azure_bot
View raw schema →| Field | Type | Required | What it is |
|---|---|---|---|
| app_id | string | Yes | Microsoft App ID (Application (client) ID of the Azure Bot's App Registration) |
| app_password | string | Yes | Client secret value for the App Registration |
| tenant_id | string | No | Azure AD tenant ID. Set only when the Azure Bot is configured as Single Tenant; leave empty for Multi Tenant bots so the multi-tenant Bot Framework token endpoint is used. |
ms_teams_webhook
View raw schema →| Field | Type | Required | What it is |
|---|---|---|---|
| webhook_url | string | Yes | See https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook?tabs=dotnet for detais on how to create a webhook |
Questions
OAuth, webhook or bot?
The ms_teams OAuth connection acts as the person who signed in and can read and write across their teams and chats. A webhook only posts to the one channel it was created for, and needs no sign-in. The azure_bot resource, an app id, password and tenant, is for a registered bot that posts under its own name.
What can Windmill do with a default connection?
List your teams, channels and chats, read and send chat messages, post and reply in channels, create chats and online meetings (Team.ReadBasic.All, Channel.ReadBasic.All, ChannelMessage.Send, Chat.ReadWrite, OnlineMeetings.ReadWrite, plus User.Read and offline_access). Untick what you don't need in the connect dialog.
Why do some scripts ask for admin consent?
Microsoft requires a tenant administrator to approve a few permissions: reading channel messages (ChannelMessage.Read.All), listing channel or team members (ChannelMember.Read.All, TeamMember.Read.All), creating channels (Channel.Create) and reading Shifts (Schedule.Read.All). They are not in the default; tick them when connecting once an admin has granted them, otherwise the sign-in stops at Need admin approval.
Does it work with a personal Microsoft account?
No. Microsoft Graph only exposes Teams for work or school accounts.
There is no Connect button on my instance
Self-hosted instances need an admin to register an app in Microsoft Entra ID once and enter its client id, secret and tenant in the Microsoft Teams entry under Instance settings, OAuth. Add <your instance>/oauth/callback/ms_teams as a redirect URI on the app, plus the delegated Graph permissions you want to offer. On Enterprise Edition the same entry also runs the /windmill bot, so one app serves both.
Can a flow start when a message is posted?
Not from this connection yet. Microsoft Graph can push new messages, but through subscriptions that must be renewed every few days against a public endpoint, which no hub script does. Until Windmill supports them natively, run the list chat messages or list channel messages script on a schedule.
Who can set up the /windmill command?
A workspace admin, from Workspace settings, Slack / Teams tab. Several Windmill workspaces can share one Teams bot, but a given Team sends its commands to only one of them.
Is my webhook URL stored on the hub?
Never. It lives only in your own Windmill workspace, encrypted at rest. Anyone holding that URL can post to the channel.