#1 You can use below search query for aggregation status
name:“Aggregate Source Account Failed”
name:“Aggregate Source Account Passed”
#2 You can configure workflow with trigger as “Account Aggregation Completed” to identify failure and then via HTTP action you can trigger another aggregation
The test connections are not logged, and will thus not be found through any reports. To find the aggregation events - simply query events and filter on the operation and status columns. For full reference on the searchable fields in Events, see Searchable Fields.
You can setup a workflow with the event trigger “Account Aggregation Completed”. Referenced here Account Aggregation Completed
For checking source connections to target systems, you can use system notification emails - Configuring System Health Notifications - SailPoint Identity Services. If this is configured, SailPoint sends email notification when a source has been in an error state for 15 minutes. Once the source has been healthy again for 5 minutes, you’ll receive another notification.
For capturing Aggregation failures and thus automating aggregation after that:
Setup a workflow with trigger “Account Aggregation Completed”.
Capture the result of the trigger and compare if it is not success or not using “Compare String” operator.
If aggregation is not successful: you can send an email notification using “Send Email” action to notify admin about the failure. In continuation, as the next step in the workflow you can re-trigger aggregation on the source using this API - import-accounts | SailPoint Developer Community in HTTP Request action in workflows.
If aggregation is successful: you may choose to send out an email notification on that and end the workflow.
You can write a script in any language of your choice to call this API for each sourceId reading from a csv file or stored directly in your code as a list