I’m looking for tips and tricks for accessing a Pega REST API in a CoPilot agent as a tool. I have tried using the yaml and openapi from the service config. That didn’t “just work”. Before I dig in I wanted to poll the community to check if anyone has a how-to video or guide.
This ended up being way more complex and less reusable than I thought it would be.
My use case was that I wanted to be able create an agent that you could point at your application so it would introspect the application and return a summary of the Pega functionality that it uses.
What I found was that in order to create a tool that could connect to a Pega application I needed to create a tool and connector configured to use OAuth 1:1 for each server that the tool would connect to. As opposed to being able to get the connection information using agentic conversation and passing that information as parameters to the connector. The amount of configuration for a connector in CoPilot/power automate that isn’t reusable made the reuse of the tool not practical.
I did get the OAuth based connector working and the only real two step there was that I had to add a redirect url that was generated by power automate to the OAuth client config as an allowed redirect on the Pega env.
The other issue that I ran into is that when you get the Open API yaml file for a Pega REST service package the openapi format is 3.0.1 which is not compatible with CoPilot Studio/PowerAutomate. I ended up having to use copilot to convert the YAML that Pega generates into YAML that could be used to create the tool in CoPilot studio.