Send, search, read, organize and draft email, and manage calendar events and contacts, in a Microsoft 365 or Outlook.com account from any Windmill script, flow or app.
Set up in 2 steps
Connect from the Resources page
Open Resources, click Add a resource/API and pick outlook from the OAuth APIs list. Click Connect and sign in with the Microsoft account that owns the mailbox, then name the resource and save it. The default permissions cover mail, calendar and contacts.
Run your first script
Fork the send email script below, or any mail, calendar or contact script: they all run on a default connection.
Scripts
Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.
New Email
Modify Email
Update Calendar Event
Update Contact
Send Email
Send Draft
Search People
Respond to Event
Reply to Email
Move Email to Folder
List Time Zones
Find Emails
List Folders
List Events
List Event Instances
Find Contacts
List Categories
List Calendars
List Attachments
Get Free/Busy Schedule
Get Message
Get Folder
Get Event
Get Current User
Find Meeting Times
Download Attachment
Delete Calendar Event
Create Calendar Event
Create Draft Reply
Create Draft Email
Trigger flows from Outlook
Outlook is not only a destination. These inbound paths are supported today.
New email (scheduled poll)
In a flow, add a trigger, choose Scheduled Poll, pick the New Email script and an interval. Each run emits the messages that arrived in the chosen folder since the previous one. It polls because Microsoft Graph push notifications need a subscription that is renewed every few days against a public endpoint.
Resource type
The shape of the credential every script on this page expects.
outlook
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. |
Questions
What can Windmill do with my mailbox?
By default: read, send, draft, move and modify mail, read and write calendar events, and read and write contacts, for the account you sign in with (Mail.ReadWrite, Mail.Send, Calendars.ReadWrite, Contacts.ReadWrite, plus User.Read and offline_access). Untick what you don't need in the connect dialog. Listing categories (MailboxSettings.Read), searching people (People.Read), finding meeting times (Calendars.Read.Shared) and shared mailboxes are not in the default: tick them when connecting, or reconnect an existing resource.
There is no Connect button on my instance
Self-hosted instances need an admin to register an app in Microsoft Entra ID once, then add Outlook under Instance settings, OAuth, with its client id, secret and tenant. Use common as the tenant for a multi-tenant app or personal accounts, or your tenant id for a single-tenant app. The app's redirect URI is <your instance>/oauth/callback/outlook.
Can scripts act on a shared mailbox?
Yes. Mail scripts take an optional mailbox argument, the address or id of a mailbox the connected account has been granted access to. The connection then needs the Shared variant of the permission, for example Mail.Read.Shared or Mail.Send.Shared, which is not in the default: tick it when connecting.
Does it work with a personal Outlook.com account?
Mail, calendar and contacts do, when the Entra app allows personal accounts and the tenant is set to common. Find meeting times is only available to work or school accounts.