Blog Post

Microsoft Teams Blog
2 MIN READ

How to implement proactive notifications in Microsoft Teams using Power Automate or Azure Logic App

Alexis Kinzelin's avatar
Jan 17, 2023

Proactive notifications, such as sending updates or announcements to specific users or groups via Teams chat, are an important feature for many applications. However, sending messages to a large audience can be a bit more complex compared to sending an email. One solution is to use a Power Automate flow, or Azure Logic App, with the Teams connector "Post a message in chat of channel" to loop through a list of users. However, this approach may hit the connector's throttling limit of 300 calls per 3600 seconds if the audience is too large.


To overcome this, here are three options for sending proactive messages from Power Automate or Azure Logic App:


Option 1 - Power Automate + Power Virtual Agent

The first option for sending proactive notifications is to use a Power Virtual Agent (PVA) bot deployed in Teams as the sender. This approach allows users to receive notifications with your PVA app's dedicated name and logo, rather than from Power Automate. This option is easy to implement and runs solely on the Power Platform, but it still has the same throttling limit of 300 messages per hour.


Reference: Notify bot users in Power Virtual Agents for Teams with proactive messages and cards

Pros: SaaS | no-code | good when number of users is low

 


Option 2 - Power Automate (or Azure Logic App) + Azure Bot Service API

A second option for sending proactive notifications is to utilize the Azure Bot Service API. This method uses the HTTP connector and POST method in Power Automate, which allows for a much higher throttling limit. However, like the other options, users will only receive these notifications if they have your Teams application installed with the bot capability enabled. To implement this option, I recommend reading the article by Cristiano Almeida Gonçalves, which provides detailed configuration steps. According to performance tests, this method can send up to ~15,000 messages per hour.


Reference: Sending Large Number of Proactive Teams Messages with Azure Logic Apps
Pros: PaaS | low-code | low-cost (pay-as-you-go) | simple to implement | good for small to medium size tenants (up to 20-30K users)

 


Option 3 - Power Automate (or Azure Logic App) + Company Communicator

The third and last option for sending proactive notifications to large audiences is to use the open-source Company Communicator application. This application is designed for communication with audiences of up to several 100,000 users, and includes a UI for admins to compose messages and track success and failure events. Additionally, the application has been updated to expose an API that can be called from a Power Automate flow with a single HTTP async call. This allows the process to run for a long period of time, without the need for additional complexity in the Power Automate flow to manage loops, retries, timeouts and failures. For more information on the solution, check out Adonis Latham's GitHub repository. Based on performance tests, this method can send up to ~50,000 messages per hour.


Reference: Company Communicator API deployment guide on GitHub
Pros: support large audience (up to millions of users) | best performance | built-in report on successes & fails

Updated Jan 17, 2023
Version 1.0

2 Comments

  • Thank you for your comment - This option with Power Virtual Agent is best suited for projects that already use PVA as a bot and want to implement proactive notification in addition to responding to user's questions. Also, users will receive notifications coming from your PVA bot, in a dedicated 1:1 chat in Teams.

    An alternative option is to use the same connector "Post message in a chat or channel" but with a "Flow bot" instead - Users will receive a proactive notification coming from Power Automate, on-behalf of the owner of the Power Automate flow that initiated the message.

    Send a message in Teams using Power Automate - Power Automate | Microsoft Learn

  • cbruscato-trg's avatar
    cbruscato-trg
    Copper Contributor

    Am I reading this right, that the first option which is for small teams; requires the use of a Power Virtual Agent that starts at $200\month - to send company announcements? That seems really out of touch with the problem it solves.