Integration of microsoft teams with uipath workflow

Hi Team,
I want to trigger my RPA workflow when a specific user posts a message in a Microsoft Teams group chat with some more functions

Currently, I am using the “Chat message posted” trigger, which starts the workflow for any message. However, my requirement is more specific:

->The workflow should trigger only when a particular user sends a message.
->The bot should first respond with:
Hey @user, please confirm if you want to proceed for the email ID
If the user replies with “Yes”, only then should the bot proceed with executing the workflow.
After execution of workflow bot replies → Hey @user, processed successfully for the email id
Could you please help me on how to implement this behavior?

1 Like

Hello @Swarit_Goyal ,

There is no option for now to trigger based on the sender, but you can try below workarounds:

  1. In the workflow, add condition at start to check the sender and decide whether to proceed or end the process
  2. Create trigger with Chat Message Posted and create another process associated with this trigger, that process will then check seder and start the required process.

To implement this specific logic, you need to combine the Microsoft Teams Integration Service with conditional branching and the Wait for External Event pattern. Since the “Chat message posted” trigger is broad, the filtering must happen immediately after the trigger starts.

1. The Trigger Filter

You cannot natively restrict the trigger to one user in the activity settings, so the first step in your workflow must be a filter.

  • Trigger: Use the Chat Message Posted (Integration Service) trigger.
  • Step 1 (Filter): Add an If activity.
    • Condition: MessageData.From.User.Email.Equals("specific.user@company.com")
    • Note: Using Email is more reliable than Display Name.
  • Else Branch: Leave empty or add a Terminate Workflow so the bot ignores other users.

2. The Confirmation Loop

To handle the “Yes” confirmation without keeping a robot “busy” (consuming a license) while waiting for the user to type, you should use UiPath Orchestrator Persistence.

A. Initial Response:

Inside the “Then” branch of your filter:

  • Use Send Chat Message: “Hey @user, please confirm if you want to proceed for the email ID.”
  • Store the MessageId or ConversationId to ensure you are replying to the right thread.

B. The Wait Logic:

There are two ways to handle the “Yes”:

  1. Synchronous (Simple): Use a Wait for Download / Wait for Element style logic with a loop that checks for new messages every 30 seconds. (Uses 1 Robot License the whole time).
  2. Asynchronous (Professional): Use Wait for External Event. The workflow “suspends” in Orchestrator (freeing the license) and wakes back up only when the Integration Service detects a new message in that chat.

3. Step-by-Step Execution Logic

Step Activity Configuration
1 If senderEmail = "target@domain.com"
2 Send Chat Message Text: “Hey @user, please confirm…”
3 Wait for Message Use the Get Chat Messages activity in a loop or a “Wait for Event” activity.
4 If (Confirmation) LastMessageText.ToLower.Contains("yes")
5 Invoke Workflow [Your Main Business Logic Here]
6 Send Chat Message Text: “Hey @user, processed successfully…”

Here from.user.email
Email is not the member of user

@Swarit_Goyal

If its a group chat I dont think you have a way to get the posted username

after the trigger even to find out if it is right user or not you might need to use Activities - List All Chat Messages and then find the user details and then you can respond as well with anything you need using the chat ID you get from the trigger

cheers