Microsoft Teams event trigger - The Microsoft Teams event trigger enables you to automate tasks based on the events that occur in Microsoft Teams chat or channels. The event trigger listens for specific events that occur in the Microsoft Teams and starts the downstream actions when the events occur.

Automation 360

The Microsoft Teams event trigger enables you to automate tasks based on the events that occur in Microsoft Teams chat or channels. The event trigger listens for specific events that occur in the Microsoft Teams and starts the downstream actions when the events occur.

Overview

The Microsoft Teams event 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 event 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 event 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 event 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 event 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.

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.

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.

Settings

The following settings are available for Microsoft Teams event triggers:

Screenshot of settings panel for Chat option in Microsoft Teams trigger
Note: Currently, the Refresh button is unavailable on Chat, Teams, and Channels modals.
Control Room OAuth connection
Specifies the OAuth connection to connect and authenticate the automation session. Use the Pick option, and follow the prompts in the Pick an OAuth connection modal to select the OAuth connection. For more information about configuring an OAuth connection, see Create OAuth connection.
Chat
Specifies the chat-based trigger configuration. 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
Specifies chat events to subscribe. You can select one or more events from the following options:
  • When a chat message is added
  • When a chat message is updated
  • When a chat message is deleted
Chat name
Specifies the chat name. You can enter the chat name manually or use the Get chat names button to select a chat using the Chat modal.
Filter
Specifies the keywords to filter the messages.
Teams & Channel
Specifies the teams or channel-based trigger configuration. You can define the configuration based on a team chat or a team membership change.
Team chat
Specifies the team chat-based trigger configuration. This configuration is based on the messages posted on a Teams change. 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
Specifies chat events to subscribe. You can select one or more events from the following options:
  • When a chat message is added
  • When a chat message is updated
  • When a chat message is deleted
Team name
Specifies the team name in which the channel is available. You enter the team name directly or use the Select Team name button to select the team using the Teams modal.
Channel name
Specifies the channel name in which the chat is available. You enter the channel name directly or use the Select Channel name button to select the team using the Channels modal.
Filter
Specifies the keywords to filter the messages.
Team membership
Specifies the team membership-based trigger configuration. This configuration is based on the team membership changes in a Team. The following settings are available for this option:

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

Member Options
Specifies team membership events to subscribe. You can select one or more events from the following options:
  • When a new team member is added
  • When a team member is updated
  • When a team member is removed
Team name
Specifies the name of the team in which the membership changes occur. You enter the team name directly or use the Select Team name button to select the team using the Teams modal.
Certificate
Specifies the Microsoft Azure certificate for authenticating the connection and encrypting the data. Use one of the following options
  • 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. Entering the certificate contents in insecure field exposes the certificate.
Response
Specifies the variables to store the response data. The trigger saves the response data in a key-value pair format and you can use this data in downstream actions within the session. You can use one of the following options:
  • Multiple variables: Create and specify individual variables to store specific response data.

    Use the Add variable mapping option to specify the key and corresponding variable type to store the specific response data.

  • Record: Create and specify a record variable to store the entire 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.