Share via


Add an agent flow to an agent as a tool

Although agent flows can be used effectively on their own, they can also be added to agents as actions to create larger agent-based automation scenarios relatively easily. To add an agent flow to an agent as a tool, it must satisfy the following criteria:

  • Have the When an agent calls the flow trigger and a Respond to the agent action.
  • 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 Copilot action to continue to run up to the flow run duration limit of 30 days.

For simplicity, this article assumes you have already created an agent flow configured to work with an agent. If you haven't, see Create an agent flow for more details.

You can add an existing agent flow to an agent at either the agent level or the topic level.

Add an agent flow to an agent as an agent-level action

When you add an agent flow to an agent, it can be triggered by the agent orchestrator directly.

To add an agent flow to an agent as an agent-level action:

  1. In Copilot Studio, select Agents, and then select the agent that you want to add an agent flow to.

  2. Select the Tools tab, and then select Add a tool. The Add tool pane appears.

  3. To list the agent flows that are available as actions, select Flow.

    If the flow you want to add isn't listed, make sure that it has the Run a flow from Copilot trigger and a Respond to Copilot action. If it doesn't, it can't be added as an action to an agent.

  4. Select the agent flow.

  5. Modify the flow configuration as needed. For example, you can update the description to help your agent understand the flow's purpose.

  6. Select Add action.

The agent flow should appear in the agent's list of actions.

Add an agent flow to a topic as a topic-level action

When you add an existing agent flow to a topic, it only becomes available to that topic.

To add an agent flow to a topic as a topic-level action:

  1. In Copilot Studio, select Agents, and then select the agent that you want to add an agent flow to.

  2. Select the Topics tab, and then select the topic that you want to add an agent flow to.

  3. Select the Add node icon below any node, and select Add a tool.

  4. Select the agent flow you want to add. A new Action node appears in the topic.