How to Add Power Automate Actions to AI-Enabled Copilot Studio Agents.

As I continue learning about Copilot Studio, I’m documenting my findings. In this article, I’ll explain how to add Power Automate actions to our previously created agent.

スポンサーリンク

Actions

Actions (formerly known as plugins) are used to register “functionalities” to your agent.

The following can be registered as actions:

  • Connectors/Custom Connectors
  • Power Automate
  • AI Builder Prompts
  • Skills (Azure Bot Framework)
As an example of a Power Automate action, we’ll implement functionality to retrieve a specified user’s schedule in an agent with generative AI enabled.
Note: As of December 26, 2024, setting the agent’s language to “English” is required to enable “Use AI in conversation.”
Screenshot showing agent settings with AI conversation enabled

Implementation

First, open your agent with generative AI enabled and click [Add action].
Screenshot showing how to add an action in Copilot Studio
Then select [New Power Automate flow] from [Add action].
Screenshot showing Power Automate flow selection
This opens the Power Automate editor, displaying a flow with a trigger that can be called from Copilot and an action to return responses to Copilot. Since we’re adding an action to retrieve a specified user’s schedule, click [Add input] in the trigger,
Screenshot showing trigger input configuration
Add the following parameters. Since agents with generative AI enabled can read parameter descriptions and automatically set arguments when calling actions, it’s important to write detailed descriptions for each parameter.
Note: While we’ve kept the descriptions simple for this example, for better accuracy, consider either providing more detailed descriptions or carefully designing the parameters.

  • mail: Email address of the user whose schedule you want to retrieve
  • start: Start date for schedule retrieval (yyyy-MM-dd)
  • end: End date for schedule retrieval (yyyy-MM-dd)

Screenshot showing parameter configuration

Next, add an action to retrieve the specified user’s schedule.
Note: Since this API is not the main focus, we’ll skip the detailed explanation. It retrieves appointments for the specified user within the given start and end dates.
Screenshot showing calendar retrieval action configuration
Then, parse the JSON results from the schedule retrieval action,
Screenshot showing JSON parsing configuration
And return the parsed results to Copilot.
Note: While best practice would be to return only the minimum necessary information for the function, for this example, we’ll pass all values to Copilot.
Screenshot showing response configuration
Give it an appropriate name, click [Save] → [Publish], then close this screen.
Note: In a production environment, you would perform unit testing of the flow at this point.
Screenshot showing save and publish options
Return to the Copilot screen and click [Refresh],
Screenshot showing refresh button in Copilot
Select the flow we just created.
Screenshot showing flow selection
Carefully describe when the agent (generative AI) should use this functionality, verify that the parameters and outputs are properly reflected, then complete the implementation by clicking [Add action].
Note: This is fundamentally similar to GPT models’ “Tools” (formerly Function calling).
Screenshot showing action description and configuration

Testing (Creating Connections)

Add some sample appointments to another user’s calendar.
Screenshot showing calendar appointments
When asking Copilot about the user’s schedule, you’ll see a message about adding (updating) a connection. Click [Connect],
Screenshot showing connection prompt
Go to [Manage connections], click [Connect], and set it to [Connected].
Screenshot showing connection management
Screenshot showing connected status
When asking the same question again, the agent will respond with the user’s schedule.
Screenshot showing schedule response
Issues like UTC time display and “Busy” status in schedules could be due to various factors:

  • Insufficient agent instructions (suboptimal system prompt)
  • Unfiltered response content (raw API results)
  • Inadequate response descriptions

In a production environment, these aspects should be properly designed and configured for better accuracy.
Screenshot showing response format issues

While we manually entered email addresses to specify users in this example, since we’re using AI, it would be more convenient to retrieve schedules using Japanese user names.

Related Articles

コメント

Copied title and URL