web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Call a Teams Chatbot v...
Copilot Studio
Answered

Call a Teams Chatbot via a Power Automate Flow

(0) ShareShare
ReportReport
Posted on by 7

Hi.

I created a chatbot using Power Virtual Agents and added it to a Teams channel. When someone posts a message on the Teams channel, I want to reply to that message using Power Automate. This Power Automate message should be able to @mention and call the chatbot. Is there a way to accomplish this?

 

Thanks in advance. 

  • Verified answer
    Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at

    Hi @Himashi,

     

    First of all great question, very interesting scenario 🙂

     

    You could use the Graph API and the Reply to a message in a channel method. In that request you can reply with an at-mention to the bot and add a topic trigger text.

     

    Below is a short example.

     

    1. Add a When a new channel message is added trigger action

     

    whenanewchannelmessageisadded02.png

     

    2. Add a Send an HTTP request action (Office 365 Groups Connector)

     

    Use the following URI & the POST method

    https://graph.microsoft.com/v1.0/teams/@{triggerOutputs()?['body/channelIdentity']['teamId']}/channels/@{triggerOutputs()?['body/channelIdentity']['channelId']}/messages/@{triggerOutputs()?['body/id']}/replies

     

    Use the json below for the body.

    Replace the variables with your values for the topic trigger phrase, bot name & bot app id.

    {
     "body": {
     "contentType": "html",
     "content": "<div><div><at id=\"0\">@{variables('BotName')}</at> @{variables('PVATopicTrigger')}</div></div>"
     },
     "mentions": [
     {
     "id": 0,
     "mentionText": "@{variables('BotName')}",
     "mentioned": {
     "device": null,
     "user": null,
     "conversation": null,
     "tag": null,
     "application": {
     "id": "@{variables('BotAppId')}",
     "displayName": "@{variables('BotName')}",
     "applicationIdentityType": "bot"
     }
     }
     }
     ]
    }

     

    atmentionbotviagraphapi.png

     

    Btw, I have also written a blog about this approach with a bit more details:

    https://www.expiscornovus.com/2022/06/10/mention-a-bot-with-a-flow/

     

  • Himashi Profile Picture
    7 on at

    @Expiscornovus Great and detailed solution. Thank you very much! 

  • ryeee Profile Picture
    3 on at

    @Expiscornovus 
    Thanks for the solution presented. However, it appears that this is not working as of this writing.
    I read your vlog and tried replicating the flow but was getting this error message.
    URI path is not a valid Graph endpoint, path is neither absolute nor relative or resource/object is not supported for this connector.
    I tested the uri through graph explorer and it works but does not with the http connecter in powerautomate.

  • Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at

    Hi @ryeee,

     

    The action has changed and is now limited to only the groups resource. In this example we are not using that type of resource, that's why you are getting that error. You can replace this action by a HTTP action instead.

     

    That action is however part of a premium connecter and you would also need to register an app in Entra Id for the Oath authentication.

  • bruna_rs Profile Picture
    2 on at

    @Expiscornovus Could you please post this last solution?

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Copilot Studio

#1
Mohsin Ali Profile Picture

Mohsin Ali 505

#2
M Bilal Khan Profile Picture

M Bilal Khan 277

#3
11manish Profile Picture

11manish 241 Super User 2026 Season 2

Last 30 days Overall leaderboard