Using Proactive Messaging when calling RPA Processes from Power Virtual Agents
    • Dark
      Light
    • PDF

    Using Proactive Messaging when calling RPA Processes from Power Virtual Agents

    • Dark
      Light
    • PDF

    Article summary

    A popular pattern that you do see with RPA vendors is the inclusion of chatbots in RPA architectures. A chatbot provides a user interface that can be used to kick off various RPA processes. However, we have an issue. Chatbots are, generally, not designed to be long running. Chatbots should be responsive, otherwise you leave users with a poor experience if they are just waiting for a chatbot to complete a job.

    By default, a Power Virtual Agents (PVA) chatbot will timeout after 2 minutes of inactivity when calling a Power Automate cloud flow. This is typical behavior when we think about HTTP request-response scenarios. Much like you wouldn’t want to wait more than a few seconds for web page to load and certainly not 2 minutes, you wouldn’t want that in a chatbot experience either.

    The underlying technical implementation of a PVA trigger is an HTTP trigger. When PVA makes this request to Power Automate, the chat client is blocking as it is waiting for a response. At this point, the user is not sure if there is an unhandled error or if the process is just taking a long time when there isn’t a timely response. Regardless, this isn’t a great experience. The following diagram illustrates the problem that we have.

    2-Without Proactive Messaging

    However, with the update to the Power Automate Microsoft Teams – Post a message in chat or channel action, we can send messages back to our chatbot, provided it is hosted in Microsoft Teams.

    Note: Please check out the following Serverless Tip for more information on the Microsoft Teams – Post a message in chat or channel action.

    From an RPA perspective, what we can do is send a response immediately after our PVA request is received. We can send status message like “Your request has been received, it is being processed now”. At this point, we can kick off our downstream RPA process. If we want, we can send status messages every so often so that the user knows their job/process is still being worked on. This is possible by using a parallel branch inside of Power Automate. Once our RPA process has completed, we can then send out a final message indicating that the RPA process is now complete and share any additional information as well.

    3-With Proactive Messaging

    To simulate this behavior, we can create a Power Automate Desktop flow that includes a Display message box that will close after 150 seconds (2.5 minutes).
    1-PAD

    Within our cloud flow, we will model it based upon the description earlier in this post. The result is that we won’t be blocking the PVA client, but we can continue to send updates through the Post message in a chat or channel action.

    4-flow design

    Testing

    Below is a video of the experience that we can expect when we use this approach. To avoid you waiting 2.5 minutes for process to complete, I have edited the video so you can get a sense of how messages will get pushed from power Automate to the chat session.

    5-testing

    Conclusion

    In this post, we discussed how we can use that new Proactive Messaging feature found in Power Automate/Power Virtual Agents to enable long running RPA processes, without having our client time out. In the example, we discussed a 2.5 minute duration, but this approach for long running processes that can take hours.

    If you would like to see this content in video format, please check out the following YouTube video: Using Proactive Messaging when calling Power Automate RPA processes from Power Virtual Agents.


    Was this article helpful?

    ESC

    Eddy AI, facilitating knowledge discovery through conversational intelligence