Forum Discussion
How to identify all Dormant || Inactive Copilot Studio Agents and purge them automatically ?
I have a specific request from business user. He wants to set up the configurable threshold value to identify the inactive copilot studio agents and automate the process of reaching user to validate the use case and send response to the admins, if admins satisfies he pushes button to continue living the agent, if he is not satisfied, he will push button to initiate purge and let user know it is getting purged. I know this has to be custom built solution, which platform/api has all the information about dormant copilot studio agents ? A365 API gives all agent information but it doesn't have attributes to identify the dormant agent. Appreciate your help and thoughts on this. Thanks
2 Replies
- NathanReedIron Contributor
You’ll need to combine agent inventory with usage telemetry. An inventory API can tell you an agent exists, but its last-modified date isn’t a reliable indication of whether anyone is using it.
For Copilot Studio, start with:
- Dataverse in each environment: the Bot (bot) table provides agent records and ownership information.
- Copilot Studio analytics / conversation transcripts: use recorded sessions to calculate the last observed activity. Transcripts are stored in Dataverse when enabled, but retention and collection settings affect coverage.
- Application Insights, if configured: useful for keeping usage telemetry over a longer period.
Treat agents without sufficient telemetry as “usage unknown,” not automatically inactive. Otherwise, a logging gap could lead to deleting a working agent.
Power Automate + Dataverse is a reasonable platform for your workflow: scheduled inactivity check → owner justification → admin approval → retain or delete → notify the owner. Store the threshold and decisions in a separate table, including a “retain until” date so approved agents aren’t flagged again immediately.
For deletion, validate the supported Copilot Studio/Dataverse operation in a test environment first. Solution-managed agents and dependencies can require different handling. Recheck activity immediately before deletion, and don’t treat an unanswered owner request as approval to purge.
Seems not, to my understanding, there is no built‑in attribute for inactivity. You may try to build a custom solution using Copilot Studio Inactivity triggers and the Copilot Studio Agent APIs, then layer your own threshold logic and workflow automation.
https://learn.microsoft.com/en-us/microsoft-copilot-studio/authoring-triggers