Microsoft Teams

Communication OAuth, webhook URL, or a bot registration Windmill docs

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

1

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.

2

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.

3

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.

Submit a script →

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.

FieldTypeRequiredWhat it is
tokenstringYesMicrosoft Graph access token. Filled in and refreshed by Windmill when you connect with OAuth.
FieldTypeRequiredWhat it is
app_idstringYesMicrosoft App ID (Application (client) ID of the Azure Bot's App Registration)
app_passwordstringYesClient secret value for the App Registration
tenant_idstringNoAzure 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 →
FieldTypeRequiredWhat it is
webhook_urlstringYesSee 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.