If you’re new to agent flows, this post will help you get started. I’ll share more about agent flows in upcoming posts.

Creating a Topic

When we add a Topic to our agent in Copilot Studio, we get a blank Trigger and Message step. Then all we need to do is adding our agent flow that we will develop shortly. You can do this by selecting Add a tool and then New Agent flow.

Adding an agent flow to our agent
Adding an agent flow to our agent

This will now add an action step to our topic.

Our flow added to the action.
Our flow added to the action.

To do agent flow

I’m going to use Microsoft To Do as a base for my example Agent flow.

My agent flow will have the following steps. The first and last step will both be added when you create your agent flow to your topic.

Then in between those initially created steps we add a List to-do’s by folder. Then a Compose step which takes the title , due date and status of the To Do Tasks. Remember you don’t need to add the For each step. The for each will be added as soon as you add Title to the Compose action.

Our example agent flow to collect Todo tasks.
Our example agent flow to collect Todo tasks.

For the Compose 1 action I’m adding the following expression

outputs('Compose_1')

The above will give us an array of lines with task details.

To return data from your agent flow to your agent, can be done in a similar way as we are used to with cloud flows.

Respond to our agent with data
Respond to our agent with data

Attaching existing agent flows to your agent

There are two ways to connect you Agent Flow to your Copilot Agent. We already looked at adding a new agent using the Add Agent flow, however if you have an existing flow you might want to use the existing flows as shown below. This immediately shows the issue that the default names of the Agent flows is Untitled. When you create an Agent flow make sure that you give your flows a name.

Add existing agent flows to our agent
Add existing agent flows to our agent

You can name the flows by clicking on the name of the Agent flow.

Rename an agent flow
Rename an agent flow

Take the output from an agent flow

Now that we have an agent flow generating our output, we can update our Agent’s Topic to display the data.

Update the topic to return data from our agent flow
Update the topic to return data from our agent flow

Testing your Agent flow

We can now test our Agent flow by for example typing Show all my tasks in Todo.

testing an agent flow
testing an agent flow

This will now give us the expected result. How about if we only want to display the incomplete tasks? We can simply adjust our ask to Show all incomplete tasks. This will now filter the data for us without us having to adjust the agent flow.

testing an agent flow and get the agent to filter the data returned by the agent flow
testing an agent flow and get the agent to filter the data returned by the agent flow

Discover more from SharePains

Subscribe to get the latest posts sent to your email.

Related Posts

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.