When you build an agent in Copilot Studio, answering questions is just the beginning. To make your agent truly useful, you can add automations that perform tasks for the user. These automations are powered by agent flows, which connect your agent to Power Automate. In this post, we’ll explore what agent flows are, why you should use them, and how to run them from a topic.

Screenshot of Copilot Studio interface showcasing the process of submitting a new asset request, with flow design elements and Power Automate inputs.

What is an agent flow?

An agent flow is a Power Automate flow designed to work with Copilot Studio agents. It allows your agent to trigger actions in other systems, such as creating a record, sending an email, or updating a database. This connection to Power Automate means you can integrate your agent with hundreds of services using connectors. Some examples include:

  • Logging a support ticket in Dynamics 365 or Dataverse
  • Creating a new row in an Excel file
  • Sending a confirmation email after a process is complete

Running from a topic vs from agent instructions

There are two ways to trigger an automation:

1. From a topic
The automation runs as part of a specific conversation flow. Use this when the action is tied to a particular scenario. For example, if a user says, “I need to request a device,” the topic for requesting a device can call the automation directly.

Screenshot of Copilot Studio interface displaying an action node for a new asset request, with fields for user input and outputs.

    2. From agent instructions
    The automation is available globally, so the agent can use it whenever relevant. This is useful for actions that apply across multiple topics, such as sending an email or updating a record.

    Screenshot of the Copilot Studio interface displaying the Customer Care Assistant overview, including instructions for responding to customer queries and a highlighted section for manager approval.

    See here for how to add an agent flow to your instructions. (Coming Soon)

    To summarise, use topics for structured processes or when the automation depends on information gathered in that topic. Use agent instructions for actions that should be accessible in multiple contexts.

    How to add the flow to your topic

    First, build the agent flow. Here is an example of an agent flow you can try to build: Copilot Studio: Build an agent flow that can read and write to Excel – Rishona Elijah. To run an automation from a topic, you use the Action node in Copilot Studio.

    1. Open your topic in Copilot Studio.

    2. Add a new node to the conversation, in the stage of the conversation where the flow should run (e.g. once key questions have been asked) .

    Screenshot of Copilot Studio interface showing the 'New Asset Request' topic with an editable description and a question node asking for asset details.

    3. Select Add a tool and select your agent flow from the list. Create a new agent flow if you have not built it yet.

    Screenshot of Copilot Studio interface showing the 'Add a tool' section for a Customer Care Assistant agent, with options to submit a new asset request and other basic tools.

    4. Map the topic variables to the flow inputs. Click onnext to the input. This will allow you to search for the variable. Custom refers to any variable you manually created from conversations with the agent.

    Screenshot of a user interface in Copilot Studio, showing the process of selecting Power Automate inputs for an asset request, including fields for UserName and AssetDescription.

    To find variables relating to the logged in user, click on the System tab and search for User. You will find variables such as the user’s email and display name.

    Screenshot of the Copilot Studio interface showing the inputs and outputs for adding a new asset request, including variable selection options.

    5. Your agent flow is now connected to your topic. Save your topic. Any outputs from your flow will be available to use throughout the conversation by clicking the {x} symbol in a node.

    Screenshot of a Copilot Studio interface showing an agent flow creation with outputs labeled as TicketNumber and AssetDescription.

    3 thoughts on “Run automations from an agent topic in Copilot Studio

    Leave a comment