Skip to content

Teams Webhook

Teams Webhook starts a flow when something happens in Microsoft Teams: a message is posted in a channel, a message arrives in a chat, a new channel is created or a member is added to a team.

When you register the flow, NappAI asks Microsoft to notify it of those changes using your credential, so you don’t need to paste any address into Teams. Each notification runs the flow with the details of the message or the change.

When to use it

  • You want an AI agent to answer the questions your team posts in a support channel.
  • You need to log every request that arrives in a Teams channel in a spreadsheet.
  • You want to welcome every new person who joins a team automatically.
  • You want an alert in another tool every time someone messages you in a chat.

Configuration

You need a Microsoft Teams credential, which connects by signing in with your Microsoft account. See Credentials.

FieldWhat it does
Credential (required)The Microsoft Teams credential of the account you want to watch. Choosing it loads your teams, channels and chats.
EventWhat starts the flow. See Events. By default, On new channel message.
Team (required)The team being watched. Only teams you belong to are listed. Changing it reloads the list of channels. Used in On new channel, On new channel message and On new team member.
Channel (required)The channel watched for new messages. Only in On new channel message.
Chat (required)One or more chats being watched. One-to-one chats show the other person’s name, and group chats show their topic or members. Only in On new chat message.
Ignore Own MessagesWhen on, messages you send from that account are ignored. This keeps the flow from being triggered by its own replies. On by default.
DataTest field. It lets you try the flow with a sample notification without waiting for a real one. Leave it empty in normal use.

Events

EventWhat starts the flow
On new channelA new channel is created in the chosen team.
On new channel messageA message is posted in the chosen channel.
On new chat messageA message arrives in one of the chosen chats.
On any chat messageA message arrives in any of your chats, including chats created later. In this case NappAI checks your chats every short while instead of waiting for Microsoft’s notification.
On new team memberSomeone is added to the chosen team.

Turning on the webhook

The flow only receives notifications while it is registered:

  1. Save the flow and publish a version. A published version of the flow is required. See Versions and publishing.
  2. In the node’s settings panel, click Consume.
  3. In the panel that opens, click Register Webhook. The status changes to Synced.

If you later change the event, the team, the channel or the chats, the status shows Out of sync: register it again. From the same panel you can Unregister Webhook.

Output

The Data output contains the notification received: the type of change, the identifiers of the team, channel, chat or message depending on the event and, for a message, its content, the sender’s name and the date. If several notifications arrive at once, they all come out together. If every message received is yours and Ignore Own Messages is on, the flow does not continue.

Connect it to an AI agent to read and answer the message, or to Channel Messages or Chat Messages to reply in Teams.

Example

A company’s internal support team wants to answer the common questions in the IT Help channel automatically.

  1. Add Teams Webhook and choose the support account’s Microsoft Teams credential.
  2. In Event, choose On new channel message; in Team, the IT team; and in Channel, IT Help.
  3. Keep Ignore Own Messages on.
  4. Connect the Data output to an agent that knows the usual answers, and then to Channel Messages with the Reply Message operation.
  5. Publish the flow, click Consume and then Register Webhook.

Good practices

  • Keep Ignore Own Messages on if the flow writes in the same channel or chat it watches. Otherwise it will keep replying to its own replies.
  • Use On any chat message only if you really need all your chats: the flow will run with every message you receive.