Microsoft Teams Block
Read, write, and create messages
The Microsoft Teams block integrates Microsoft Teams messaging into your workflows using OAuth authentication. It can read messages from chats and channels and post new messages to them. Reach for it when a workflow needs to pull conversation content, notify a team, or react to incoming Teams events via a webhook trigger.
Overview
| Property | Value |
|---|---|
| Type | microsoft_teams |
| Category | tools |
| Color | #E0E0E0 |
When to Use
- Read recent messages from a one-on-one or group chat
- Post a chat message to notify a person or group
- Read messages from a specific channel within a team
- Send a channel message to broadcast updates to a team
- Pull message metadata and attachment information for downstream processing
- Start workflows from incoming Teams messages via the
microsoftteams_webhooktrigger
Configuration
Operation
Dropdown (operation) selecting what the block does. Defaults to read_chat.
| Label | ID |
|---|---|
| Read Chat Messages | read_chat |
| Write Chat Message | write_chat |
| Read Channel Messages | read_channel |
| Write Channel Message | write_channel |
Microsoft Account
Required OAuth credential (credential) connecting your Microsoft account to Teams. The connection requests the following scopes: openid, profile, email, User.Read, Chat.Read, Chat.ReadWrite, Chat.ReadBasic, Channel.ReadBasic.All, ChannelMessage.Send, ChannelMessage.Read.All, Group.Read.All, Group.ReadWrite.All, Team.ReadBasic.All, offline_access.
Select Chat (chatId)
Visible for read_chat and write_chat operations — basic mode.
File-selector that lets you pick a chat from your Microsoft account. Resolves to the chat ID used by the underlying tool.
Chat ID (manualChatId)
Visible for read_chat and write_chat operations — advanced mode.
Short text input for entering the chat ID directly when you prefer not to use the selector.
Select Team (teamId)
Visible for read_channel and write_channel operations — basic mode.
File-selector that lets you pick a team from your Microsoft account.
Team ID (manualTeamId)
Visible for read_channel and write_channel operations — advanced mode.
Short text input for entering the team ID directly.
Select Channel (channelId)
Visible for read_channel and write_channel operations — basic mode.
File-selector that lets you pick a channel within the selected team.
Channel ID (manualChannelId)
Visible for read_channel and write_channel operations — advanced mode.
Short text input for entering the channel ID directly.
Message (content)
Required for write_chat and write_channel operations.
Long-text input for the message body to send to the chat or channel.
Trigger Configuration (triggerConfig)
Configures the microsoftteams_webhook trigger so the block can start workflows from incoming Microsoft Teams events.
Inputs & Outputs
Inputs
operation(string) — Operation to perform (read_chat,write_chat,read_channel, orwrite_channel)credential(string) — Microsoft Teams OAuth access tokenmessageId(string) — Message identifierchatId(string) — Chat identifier (from the selector)manualChatId(string) — Manual chat identifier (advanced mode)channelId(string) — Channel identifier (from the selector)manualChannelId(string) — Manual channel identifier (advanced mode)teamId(string) — Team identifier (from the selector)manualTeamId(string) — Manual team identifier (advanced mode)content(string) — Message content to send (write operations)
Outputs
Read operation outputs:
content(string) — Formatted message content from the chat or channelmetadata(json) — Message metadata with full detailsmessageCount(number) — Number of messages retrievedmessages(json) — Array of message objectstotalAttachments(number) — Total number of attachments across all messagesattachmentTypes(json) — Array of unique attachment content types found
Write operation outputs:
updatedContent(boolean) — Whether content was successfully sentmessageId(string) — ID of the created/sent messagecreatedTime(string) — Timestamp when the message was createdurl(string) — Web URL to the message
Individual message field outputs (from read operations):
sender(string) — Message sender display namemessageTimestamp(string) — Individual message timestampmessageType(string) — Type of message (e.g.message,systemEventMessage)
Trigger (webhook) outputs:
type(string) — Type of Teams message eventid(string) — Unique message identifiertimestamp(string) — Message timestamplocalTimestamp(string) — Local timestamp of the messageserviceUrl(string) — Microsoft Teams service URLchannelId(string) — Teams channel ID where the event occurredfrom_id(string) — User ID who sent the messagefrom_name(string) — Username who sent the messageconversation_id(string) — Conversation/thread IDtext(string) — Message text content
Tools
- Read Microsoft Teams Chat (
microsoft_teams_read_chat) — Fetches the 50 most recent messages from a Teams chat viaGET /chats/{chatId}/messages. Returns formatted text, message objects, sender names, timestamps, and attachment statistics. - Write to Microsoft Teams Chat (
microsoft_teams_write_chat) — Posts a new text message to a Teams chat viaPOST /chats/{chatId}/messages. Returns the new message ID, creation time, and web URL. - Read Microsoft Teams Channel (
microsoft_teams_read_channel) — Fetches messages from a Teams channel viaGET /teams/{teamId}/channels/{channelId}/messages. Returns formatted text, message objects, sender names, timestamps, and attachment statistics. - Write to Microsoft Teams Channel (
microsoft_teams_write_channel) — Posts a new text message to a Teams channel viaPOST /teams/{teamId}/channels/{channelId}/messages. Returns the new message ID, creation time, and web URL.
YAML Example
microsoft_teams_1:
type: microsoft_teams
name: "Microsoft Teams"
inputs:
operation: "write_channel"
credential: "{{credentials.microsoft-teams}}"
teamId: "your-team-id"
channelId: "your-channel-id"
content: "{{start.input}}"
connections:
outgoing:
- target: next-block-id