Imagine a virtual agent that doesn’t just sit quietly in Teams, waiting for you to ask questions. Instead, it takes the initiative! Did you know your agents can send proactive messages? No more waiting for users to reach out. Now, you can give them a friendly nudge whenever needed.
Take my “Little Transition Helper” agent, for example. It’s now up and running and it sends reminder about how many days are left until outbound marketing retires.
So let’s stress out outbound users a little bit 😉
Prepare the flow to send proactive messages
We’ll start by setting up a scheduled flow that runs every day at 8:00 AM. Why 8 AM? Because there’s no better way to kickstart your day than with a timely reminder from your proactive agent!
Next, we’ll add a Compose action to calculate the remaining days until 30 June 2025—the official end of outbound marketing (I hope this isn’t news to you!). Use the expression below in the Compose step to get the countdown.
div(sub(ticks('2025-06-30T00:00:00Z'), ticks(utcNow())), 864000000000)
In the next step we identify all the marketing users in your system. In my case, all marketing users are part of a “Marketing Team.” To retrieve these users, use the List rows step to fetch the members of the Marketing Team.
Your flow should look like this now:
Here’s an example of the FetchXML query you can use (please either exchange the GUID with yours or even better, make the fetch more flexible than in my example or send it to a Teams team):
Send proactive messages via agent
The last step of this flow finally sents the message. Choose the step Post message in a chat or channel with following inputs:
- Post As: Power Virtual Agents
- Post In: Chat with bot
- Bot: Choose your agent here
- Recipient: emailaddress or domainname from the users fetched above
- Message: Be creative but polite 😉
There are also a few advanced options that you can configure:
- Label as notification: determines if the message will display “Notification via” before the copilot’s name.
- If chat is active: how the copilot behaves when the recipient is already engaged in a conversation
- Send: The copilot sends the proactive message as usual, even if the recipient is in an active chat.
- Don’t Send and Succeed: The copilot skips sending the message when the recipient is engaged in a conversation. The flow run will succeed, returning a status code of 300.
- Don’t Send and Fail: The copilot does not send the message, and the flow run is marked as failed if the recipient is in an active conversation.
- If bot not installed: handles cases where the recipient hasn’t added the copilot to their Microsoft Teams.
- Fail: The flow run will be marked as failed if the recipient hasn’t installed the copilot.
- Succeed with Status Code: The flow run will be marked as succeeded, even though the recipient won’t receive the message. A status code of 100 will be returned to indicate this scenario.
Things to consider
When it comes to proactive messaging, Teams is just the beginning. One of my favorite features? Sending adaptive cards! They let you share information and even collect responses directly from your users. The choice is yours.
But before you dive in, here are a few tips I’ve learned along the way:
- Proactive messages are only sent to users that have the agent installed. If they have uninstalled or blocked the agent, the message will not go through.
- Proactive messages aren’t logged in conversation transcripts or Analytics sessions.
- If you send the message to multiple users think about the Power Automate limits. Avoid errors from throttling limits by reducing parallelism or splitting your recipient list into smaller groups.
Summary
As you can tell, I’m having a bit of fun experimenting with agents—and discovering plenty of useful tricks along the way to prepare for the exciting future of Copilot Studio.
And by setting up a simple flow in Power Automate, you can nudge your team into action and keep them informed—on time, every time. Just remember to keep your agent installed, be mindful of Power Automate’s limits, and unleash your creativity when creating proactive messages.
Have fun exploring, and happy agent building!
References: Microsoft Learn Documentation
***Please be aware: The content is accurate at the time of creation. It may be that Microsoft has made changes in the meantime.***
Check out the FAQ section of my blog as well: Short questions with quick answers! Go to FAQs