Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
To work as an action with agents, an agent flow requires the following:
- Have the When an agent calls the flow trigger and a response action of Respond to the agent.
- Be configured to respond in real time, not asynchronously. The Asynchronous reponse toggle must be set to Off under Networking in the Respond to the agent action settings.
- Respond to the agent within the 100 second action limit. Optimize the flow logic, queries, and the amount of data returned so that a typical run is below this 100 second limit. Actions in the flow that need to run longer can be placed after the Respond to the agent action to continue to run up to the flow run duration limit of 30 days.
If you have a flow with a different trigger that you wish to use with your agent, you can change the flow to use the When an agent calls the flow trigger and Respond to the agent response action, and make sure it's in a solution in the same environment as the custom agent.
To choose the environment where your flow is stored, go to the Power Automate portal and use the environment selector at the top right.
Select My flows in the left navigation pane and search for the flow you want to modify.
Select your flow, and select Edit.
Add the agent trigger and response action
If your flow doesn't already include the required flow trigger and response action, you must add them before you can use the flow with your agent.
Select New step.
Search for Copilot and select When an agent calls the flow.
Select New step.
Search for the Copilot connector and select Respond to the agent. The response action can be used at multiple branches in the flow, but must have the same outputs at each usage.
Save and publish the flow.
Ensure response action is set to return in real time
Flows that you want to use in an agent must return values in real time, or synchronously. Flows that run in the background, or asynchronously, might cause an error when your agent tries to run them. Instead of running the flow, the agent says, "Something unexpected happened. We're looking into it. Error code: 3000."
When you create a flow from Copilot Studio, asynchronous responses are turned off by default. If you modified an existing flow that has asynchronous responses turned on, follow these steps to check the setting and ensure it's turned off:
Open your flow and find the Respond to the agent actions.
Select the Settings tab.
Set Asynchronous Response to Off, and then select Save.
Add the flow to a solution
To be available to agents, flows must be stored in a solution in the same Power Platform environment. If a flow is in a solution, a Solutions tile is visible on the flow's detail page that lists which solutions the flow is in. Flows can be added to the Default Solution for use with agents, or moved into a different solution using the below steps:
Go to Power Automate.
Go to Solutions and either select an existing solution or create a solution for your flow.
If you want to create a new solution:
Select New solution.
Give your new solution a name, select CDS Default Publisher in the Publisher field, and enter a Version number.
Select Create.
If you want to add your flow to an existing solution, select the desired solution, and select Edit.
Select Add existing > Automation > Cloud flow.
The Add existing flows panel appears.
Select your flow, and then select Add.