Microsoft Teams Bot Trigger icon

Microsoft Teams Bot Trigger

Triggers workflows when Teams messages are created, updated, or deleted via Microsoft Graph API subscriptions

Microsoft Teams Bot Trigger

AI-generated

Summary

Receive Teams events via Microsoft Graph API webhook subscriptions or Bot Framework activities and emit a normalized event.

Inputs

  • triggerSource (required) — Inbound transport: botActivity receives Bot Framework activities via /api/messages (no Graph subscription needed); graphSubscription receives Graph API change notifications via registered webhooks (requires Graph permissions).
  • subscriptionType (required) — When triggerSource is graphSubscription: scope of subscription. specificChannel (channel messages, FREE), specificChat (chat messages, FREE), allChats (tenant-wide chats, REQUIRES LICENSING), allChannels (tenant-wide channels, REQUIRES LICENSING). Default: specificChannel.
  • teamId (required) — ID of the team containing the channel to monitor. Shown when triggerSource is graphSubscription AND subscriptionType is specificChannel.
  • channelId (required) — ID of the channel to monitor. Shown when triggerSource is graphSubscription AND subscriptionType is specificChannel.
  • chatId (required) — ID of the chat to monitor. Shown when triggerSource is graphSubscription AND subscriptionType is specificChat.
  • changeTypes (required) — Event types to listen for when triggerSource is graphSubscription. Options: created, updated, deleted. Default: ["created"].
  • paymentModel (required) — Licensing payment model for licensed endpoints when triggerSource is graphSubscription AND subscriptionType is allChats or allChannels. Options: evaluation (free, throttling limits, NOT FOR PRODUCTION), A (seeded capacity with pay-as-you-go overages), B (per-notification billing). Default: evaluation.
  • includeResourceData (required) — When triggerSource is graphSubscription. If true, Graph sends encrypted payloads requiring certificate-based decryption. Not yet implemented — leave disabled. Enabling causes decryption failures.
  • filters (required) — Optional filters when triggerSource is graphSubscription. messageContains: only trigger if message contains this text (case insensitive). senderEmail: only trigger if message is from this user email.

Output shape

Normalized Teams event object emitted on workflow trigger. Contains trigger type, resource identifiers, change type, and optionally filtered message/sender data. Emitted immediately to satisfy Graph API webhook validation requirement (must respond within 10 seconds with plain text token).

Bot Activity path upserts conversation reference and passes activity through. Graph Subscription path parses lifecycle notifications first, validates clientState against stored subscription, applies optional text/email filters, fetches full resource data when includeResourceData is false (since decryption not implemented), normalizes event via graphNotificationParser, and emits to workflow data.

Examples

Example 1: Simple bot activity trigger

Set triggerSource to botActivity. No other parameters required. Workflow activates on incoming Bot Framework activities from the registered Teams bot.

Example 2: Graph change subscription for a specific channel

Set triggerSource to graphSubscription, subscriptionType to specificChannel, provide teamId and channelId, select desired changeTypes (e.g., ["created"]). Optional: set filters for message content or sender. Subscribe to channel message changes and trigger workflows on matching events.

Links

Discussion