The Microsoft Teams web triggers enable you to automate tasks based on the events that occur in Microsoft Teams chat or channels. The web triggers listen for specific events that occur in the Microsoft Teams. Once the events occur, the trigger starts the configured actions.

Overview

The Microsoft Teams web triggers enable you to create triggers based on events such as direct chat messages, group chat messages, and channel membership changes in Microsoft Teams. You can use the triggers to trigger workflows as soon as the event occurs in Microsoft Teams, reducing the manual monitoring and response time for critical communication. The options available in the Microsoft Teams web triggers enable you to create trigger-based automations for use cases such as ticket assignment, extracting information from any chat messages, and starting an email thread to notify the stakeholders.

The latency between the event occurring in a Microsoft Teams application and the trigger initiating the automation based on the event is less than 30 seconds. If the event delivery to the session fails, the trigger retries to fetch the event automatically.

The Microsoft Teams web triggers have the option of using keywords to filter messages. The Filter option enables you to configure the trigger for use cases where the automation must be triggered based on specific keywords. This option limits the event responses to the messages that contain the specified keywords.

The trigger captures the event response payload information from the Microsoft server in a structured JSON format. This payload includes the authentication information that allows the data to be validated. You can view the response payload in the Audit log page as key-value pairs. You can use this key-value pair information as inputs for the subsequent actions within the session.

Authentication

The Microsoft Teams web triggers use OAuth to authenticate the connection to the Microsoft 365 account. Set up the OAuth connection with the parameters applicable for Microsoft Entra for Microsoft Teams. For more information about setting up OAuth connections, see Create OAuth connection.

Microsoft Teams web triggers use Microsoft Azure certificates to authenticate the Microsoft account subscription and decrypt the incoming data from the Microsoft servers. Log in to your Microsoft Azure portal and create a certificate. For more information on creating certificates in the Microsoft Azure portal, see Certificate creation methods in the Microsoft Learn portal. For more information on managing certificates, see Managing encryption keys.

Ensure that you add the created certificate in the Credential Vault. Do the following to add the certificate data to the Credential Vault:

  1. Open the certificate file in any text editor.
  2. Copy the entire contents of the certificate file.
  3. Log in to the Control Room as an administrator.
  4. Go to Manage > Credentials and click Create credential.
  5. Enter an appropriate Credential name and Description for the credential.
  6. Enter an appropriate name in Attribute name in the Attributes section.
  7. Select Standard and paste the certificate content in the Value field in the Input section of the Attributes.
  8. Click Create credential to save the certificate data in the Credential Vault.

Supported events

The following events are supported in both individual and teams chat trigger configuration:

Events Description
When a chat message is added When a new message arrives.
When a chat message is updated When an existing chat message is edited.
When a chat message is deleted When an existing chat message is deleted.

The following events are supported in team membership trigger configuration:

Events Description
When a new team member is added When Team Owners add a new member to the selected team.
When a team member is updated When Team Owners edit existing team member details.
When a team member is removed When Team Owners remove a team member from the selected team.

Prerequisites

Ensure that the following prerequisites are met:

  • A Bot Creator or Citizen Developer license.
  • EVENT TRIGGERS and View my bots permissions.
  • Check in and Check out permission on the folders in which the automation is located.
  • An active OAuth connection for the Microsoft 365 account.
  • A Microsoft Azure certificate.

Settings

The following settings are available for Microsoft Teams web triggers:

Screenshot of settings panel for Chat option in Microsoft Teams trigger

Control Room OAuth connection
Use the Pick option, and follow the prompts in the Pick an OAuth connection modal to select the OAuth connection. The OAuth authenticates the connection between Control Room and Microsoft 365 account.
Chat
Use this option to configure the trigger based on individual chats. The chat name works on the basis of the email id of the chat recipient and not the display name of the recipient.
  • Listen to event: Specify the event type that the trigger must listen to.
  • Chat name: Enter the chat name. You can also use the Get chat names button to select a chat using the Chat modal.
  • Filter: Enable the check box and enter the keywords to filter the messages.
Teams & Channel
Team chat: Use the Team chat option to configure the trigger based on messages posted on a Teams channel. The following settings are available for this option:

Screenshot of settings panel for Team Chat option in Microsoft Teams trigger

  • Choose one or more events: Specify one or more event types that the trigger must listen to.
  • Team name: Enter the team name. You can also use the Select Team name button to select the team using the Teams modal.
  • Channel name: Enter the channel name. You can also use the Select Channel name to select the team using the Channels modal.
  • Filter: Enable the check box and enter the keywords to filter the messages.
Team membership: Use the Team membership option to configure the trigger based on the membership changes within a team. The following settings are available for this option:

Screenshot of settings panel for Team membership option in Microsoft Teams trigger

  • Member Options: Specify one or more event types that the trigger must listen to.
  • Team name: Enter the team name. You can also use the Select Team name button to select the team using the Teams modal.
Certificate
Use the Certificate option to select the certificate for authentication and encryption.
  • Credential: Use the Choose option and follow the prompts in the Pick a credential modal to select the Microsoft Azure certificate saved in the Credential Vault.
  • Insecure string: Use the Insecure string option to enter the content of the certificate file directly in the input field.
Response
Use the Response option to save the trigger response data in a Record variable. You can either create a new variable or select an existing variable to store this response data.

Reading trigger response data in Audit log

The trigger response data contains all the information of the event record in which a change occurred. This response data is stored in key-value pair format. You can extract this data and use it as inputs for other actions within the automation. Once the bot finishes running, the trigger data information is logged as Bot run by trigger event type in the Audit log.