Forum Discussion
How to identify all Dormant || Inactive Copilot Studio Agents and purge them automatically ?
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.