Calling Business Process Flow (Power Automate) using Copilot Studio

Introduction

In this article, we will focus on creating how we can call business processes using copilot. In this case, we will call it a Power Automate flow.

In the previous blog, we took input from users like “From Location”, “To Location” and “Booking Date” Using these inputs, we call a flow and pass inputs for flight booking.

The challenge here is how we can pass user input from Copilot to Power Automate.

Step 1. Create a business process flow

To create a business process flow in Microsoft, we need to call it the Power Automate flow. To connect Copilot with business process flow, we need to create Power Automate flow using Copilot, not directly from Power Automate.

Click on the + button and then select “Call an action” and click on Create a flow.

Power Automate

It will take you to Power Automate flow, where you can see the top name Run a flow from Copilot. Rename it with the appropriate name because that name will be visible in Copilot when you select flow to run this flow. I will name it “Find an Air India flight”.

Copilot

Here, you will have to box one “Run a flow from Copilot” and another one “Respond to Copilot”.

These names clearly show you the importance of these boxes in this flow. The first block will start the flow, and the last box will take the output from this flow and pass it to the copilot, which means the challenge we were facing of input and output.

Step 2. Receiving Inputs

“Run a flow from copilot” is a trigger point that will receive inputs from the copilot and pass in the current flow. To do this process, click on this box. It will open a popup for adding inputs where you can add an input box along with type. In our case, we will add three inputs here.

Parameter

Step 3. Assign to a variable

After receiving these inputs, we can hold these inputs in a variable to use further in flow. For that we will create three parameters and set values in those. In the example image I did for “FromLocation”, similarly you can do “To Location” and “Booking Date”.

Booking Date

We named this variable “varFromLocation” and typecast it as a string, and in the value section, take “FromLocation” from the first step.

Step 4. Calling API

After setting up the variable, the next step is to call the API for real-time data. Whether it's your business API or a third-party API, both can be called the same way. Click the "+" button, select the “HTTP” connector, choose "HTTP request," and enter all the required data as shown here.

API

Setup output in a variable, which I add in " varFlightNumber” which will hold the output from the HTTP call.

Step 5. Passing response to copilot

Once we complete the business process and get the output that we can share with the user, we need to pass it copilot, which we can achieve using setting up response. In the same way, as we set up the input variable, we will set the response in the “Respond to copilot” box.

Flight Number

Now, you can save, publish, and test this flow. If everything is fine you can connect this flow to copilot.

Conclusion

In this article, we focus on creating a Power Automate flow to complete various business processes. We also connect this flow with Copilot to trigger automation using an AI chatbot agent.