diff --git a/ENHANCEMENT-ANALYSIS-Empty-Solutions-Cleanup.md b/ENHANCEMENT-ANALYSIS-Empty-Solutions-Cleanup.md
new file mode 100644
index 000000000..bb90434f0
--- /dev/null
+++ b/ENHANCEMENT-ANALYSIS-Empty-Solutions-Cleanup.md
@@ -0,0 +1,962 @@
+# ๐ง Enhancement Analysis: Empty Solutions Cleanup Feature
+
+## Understanding & Summary
+
+### Enhancement Request
+**Title**: Clean up tasks - Empty Solutions
+**Requested by**: @RandomDepartmentofThings
+**Issue Link**: [Feature Request - Empty Solutions](https://github.com/microsoft/coe-starter-kit/issues/)
+
+### Problem Statement
+External Microsoft applications (e.g., SharePoint Work Tracker) automatically create Power Automate flows and solutions in the Power Platform Default environment. When these SharePoint lists or other external triggers are deleted, the associated flows and solutions are **not automatically cleaned up**:
+
+- **Flow**: Eventually gets flagged for cleanup by CoE when it fails repeatedly (existing behavior)
+- **Solution**: Remains in environment indefinitely as an **empty solution** with no components
+
+### Core Problem
+The CoE Starter Kit currently has:
+- โ
Flows to identify and clean up orphaned/disabled flows
+- โ
Solution inventory that tracks all solutions
+- โ **No mechanism to identify or clean up empty solutions**
+
+This leads to:
+- ๐๏ธ Solution clutter in environments (especially Default environment)
+- ๐ Dashboard noise with empty, non-functional solutions
+- ๐ Difficulty identifying truly valuable solutions
+- ๐พ Unnecessary storage consumption (minimal but cumulative)
+
+### User Request
+1. **Primary**: Cleanup flow that identifies and removes empty solutions
+2. **Alternative**: Add solution reference fields to Apps/Flows tables for relationship mapping
+
+---
+
+## Feasibility Assessment โ
+
+### โ
**FEASIBLE** - This enhancement is technically achievable
+
+### Evidence Supporting Feasibility
+
+#### 1. **API Availability Confirmed** โ
+The CoE Starter Kit already uses the necessary Dataverse APIs:
+
+**Existing Usage in `CLEANUPHELPER-SolutionObjects`**:
+```json
+{
+ "entityName": "solutioncomponents",
+ "$filter": "(componenttype eq 300 or componenttype eq 80) and _solutionid_value eq @{solutionGuid}"
+}
+```
+
+This flow demonstrates that we can:
+- โ
Query `solutioncomponents` table via Dataverse connector
+- โ
Filter by solution ID to get components
+- โ
Check component types (Apps: 300/80, Flows: 29, etc.)
+- โ
Count total components per solution
+
+#### 2. **Solution Inventory Already Exists** โ
+The `admin_Solution` entity contains:
+- `admin_solutionenvtguid` - Solution ID (maps to `solutionid` in Dataverse)
+- `admin_solutionenvironment` - Parent environment reference
+- `admin_solutiondeleted` - Deletion flag
+- `admin_solutionmodifiedon` - Last modified date
+- All metadata needed for cleanup decisions
+
+#### 3. **Cleanup Infrastructure Exists** โ
+Existing cleanup patterns we can follow:
+- `CLEANUPHELPER-CheckDeletedv4Solutions` - Detects deleted solutions
+- `CLEANUPHELPER-SolutionObjects` - Manages solution-object relationships
+- `CLEANUP-AdminSyncTemplatev3OrphanedMakers` - Cleanup pattern example
+
+#### 4. **Component Type Enumeration Available** โ
+Power Platform `componenttype` values:
+- `1` = Entity/Table
+- `29` = Workflow/Flow
+- `80` = Canvas App
+- `300` = Model-driven App
+- `31` = Business Process Flow
+- `400` = Custom Connector
+- And [many others](https://learn.microsoft.com/power-apps/developer/data-platform/reference/entities/solutioncomponent#componenttype-choices)
+
+### Constraints & Considerations
+
+#### Constraint 1: System Solutions Must Be Protected โ ๏ธ
+**Risk**: Accidentally deleting critical system solutions
+**Mitigation**:
+- Filter by publisher (already done in sync: `publisherid/uniquename ne 'Microsoft'`)
+- Exclude managed solutions (`ismanaged eq false` only)
+- Add configurable exclusion list
+
+#### Constraint 2: "Empty" Definition Varies ๐ค
+**Question**: What qualifies as "empty"?
+**Options**:
+1. **Zero components** (strictest)
+2. **Only metadata components** (tables, option sets but no apps/flows)
+3. **No active apps/flows** (tables okay, inactive flows okay)
+
+**Recommendation**: Option 1 (zero components) with configurable filter
+
+#### Constraint 3: Solution Delete Permissions Required ๐
+**Requirement**: Service account needs `System Administrator` or `System Customizer` role
+**Current State**: CoE flows already require elevated permissions
+**Impact**: None - same permission model
+
+#### Constraint 4: Cannot Delete Managed Solutions ๐ซ
+**API Limitation**: Dataverse API cannot delete managed solutions directly
+**Mitigation**: Only target **unmanaged solutions** in cleanup flow
+**Documentation**: Note this limitation in user-facing documentation
+
+---
+
+## Proposed Implementation Approach
+
+### Implementation Strategy: **Hybrid Approach**
+Combine both requested features:
+1. โ
New cleanup flow for empty solutions (primary request)
+2. โ
Enhanced solution relationship tracking (alternative request)
+
+### Architecture Overview
+
+```
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+โ ENHANCED SOLUTION INVENTORY โ
+โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
+โ โ AdminSyncTemplatev4Solutions (ENHANCED) โ โ
+โ โ - Existing: Basic solution metadata โ โ
+โ โ - NEW: Query solutioncomponents count โ โ
+โ โ - NEW: Store component count in admin_Solution โ โ
+โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+ โ
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+โ NEW CLEANUP FLOW โ
+โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
+โ โ CLEANUPHELPER-EmptySolutions โ โ
+โ โ - Triggered: Scheduled (weekly/monthly) โ โ
+โ โ - Queries: admin_Solution WHERE componentcount = 0 โ โ
+โ โ - Filters: Unmanaged, non-system, age > X days โ โ
+โ โ - Actions: Flag OR delete (configurable) โ โ
+โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+ โ
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+โ ENHANCED RELATIONSHIP TRACKING โ
+โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
+โ โ admin_App / admin_Flow (ENHANCED) โ โ
+โ โ - NEW: admin_AppSolutions (lookup, multi) โ โ
+โ โ - NEW: admin_FlowSolutions (lookup, multi) โ โ
+โ โ - Links apps/flows to their containing solutions โ โ
+โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+```
+
+---
+
+## Step-by-Step Implementation Plan
+
+### Phase 1: Data Model Enhancement
+**Goal**: Track component count and solution relationships
+
+#### Step 1.1: Add Component Count Field to `admin_Solution`
+**File**: `CenterofExcellenceCoreComponents/SolutionPackage/src/Entities/admin_Solution/Entity.xml`
+
+**Changes**:
+```xml
+
+ int
+ admin_componentcount
+ admin_componentcount
+ none
+ ValidForAdvancedFind|ValidForForm|ValidForGrid
+ 4.XX
+ 0
+ 2147483647
+
+
+
+
+
+
+
+
+
+ bit
+ admin_isemptysolution
+ admin_isemptysolution
+ none
+ ValidForAdvancedFind|ValidForForm|ValidForGrid
+ 4.XX
+ 0
+
+
+
+
+
+
+
+
+
+ datetime
+ admin_emptysolutiondetecteddate
+ admin_emptysolutiondetecteddate
+ none
+ ValidForAdvancedFind|ValidForForm|ValidForGrid
+ 4.XX
+ DateAndTime
+ inactive
+ UserLocal
+
+
+
+
+
+
+
+```
+
+**Reasoning**:
+- `admin_ComponentCount` enables quick filtering without querying solutioncomponents repeatedly
+- `admin_IsEmptySolution` provides simple boolean flag for dashboards/reports
+- `admin_EmptySolutionDetectedDate` enables age-based cleanup policies (e.g., "delete after 30 days of being empty")
+
+#### Step 1.2: Add Solution Lookup Fields to `admin_App` and `admin_Flow` (Optional)
+**Files**:
+- `CenterofExcellenceCoreComponents/SolutionPackage/src/Entities/admin_App/Entity.xml`
+- `CenterofExcellenceCoreComponents/SolutionPackage/src/Entities/admin_Flow/Entity.xml`
+
+**Note**: This requires creating a **many-to-many relationship** table since apps/flows can exist in multiple solutions.
+
+**Alternative**: Use existing `CLEANUPHELPER-SolutionObjects` pattern to query relationships dynamically rather than storing them.
+
+**Recommendation**: **Skip for initial implementation** - adds complexity without direct cleanup value. Can add in future enhancement if customer demand exists.
+
+---
+
+### Phase 2: Enhanced Solution Sync
+**Goal**: Populate component count during inventory
+
+#### Step 2.1: Modify `AdminSyncTemplatev4Solutions` Flow
+**File**: `CenterofExcellenceCoreComponents/SolutionPackage/src/Workflows/AdminSyncTemplatev4Solutions-838B0BC0-8494-EE11-BE37-000D3A341B0E.json`
+
+**Location**: In the `Upsert_Solution` action (lines ~1128-1166)
+
+**Add After Line 1162** (before authentication parameter):
+```json
+"item/admin_componentcount": "@length(outputs('Get_Solution_Component_Count')?['body/value'])",
+"item/admin_isemptysolution": "@equals(length(outputs('Get_Solution_Component_Count')?['body/value']), 0)",
+"item/admin_emptysolutiondetecteddate": "@if(equals(length(outputs('Get_Solution_Component_Count')?['body/value']), 0), if(equals(first(outputs('See_if_in_inventory')?['body/value'])?['admin_isemptysolution'], true), first(outputs('See_if_in_inventory')?['body/value'])?['admin_emptysolutiondetecteddate'], utcNow()), null)",
+```
+
+**Add New Action Before Upsert** (in `Inventory_a_Solution` scope):
+```json
+"Get_Solution_Component_Count": {
+ "runAfter": {
+ "Get_Solution_Publisher": [
+ "Succeeded"
+ ]
+ },
+ "metadata": {
+ "operationMetadataId": "new-guid-here"
+ },
+ "type": "OpenApiConnection",
+ "inputs": {
+ "host": {
+ "connectionName": "shared_commondataserviceforapps_3",
+ "operationId": "ListRecordsWithOrganization",
+ "apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"
+ },
+ "parameters": {
+ "organization": "@triggerOutputs()?['body/admin_environmentcdsinstanceurl']",
+ "entityName": "solutioncomponents",
+ "$select": "solutioncomponentid",
+ "$filter": "_solutionid_value eq '@{outputs('Get_actual_object')?['body/solutionid']}'"
+ },
+ "authentication": "@parameters('$authentication')",
+ "retryPolicy": {
+ "type": "exponential",
+ "count": 20,
+ "interval": "PT20S"
+ }
+ },
+ "runtimeConfiguration": {
+ "paginationPolicy": {
+ "minimumItemCount": 100000
+ }
+ }
+}
+```
+
+**Reasoning**:
+- Queries `solutioncomponents` table for each solution during sync
+- Stores count directly in solution record for efficient querying
+- Tracks when solution first became empty (for age-based policies)
+- Uses existing connection and retry logic patterns
+
+**Performance Impact**:
+- Additional API call per solution during sync
+- Mitigated by existing retry/throttling logic
+- Offset by improved cleanup query performance (no need to check components during cleanup)
+
+---
+
+### Phase 3: New Cleanup Flow
+**Goal**: Identify and optionally delete empty solutions
+
+#### Step 3.1: Create `CLEANUPHELPER-EmptySolutions` Flow
+**File**: `CenterofExcellenceCoreComponents/SolutionPackage/src/Workflows/CLEANUPHELPER-EmptySolutions-[GUID].json`
+
+**Flow Structure**:
+
+```json
+{
+ "properties": {
+ "connectionReferences": {
+ "shared_commondataserviceforapps": {
+ "runtimeSource": "embedded",
+ "connection": {
+ "connectionReferenceLogicalName": "admin_CoECoreDataverse"
+ },
+ "api": {
+ "name": "shared_commondataserviceforapps"
+ }
+ },
+ "shared_commondataserviceforapps_2": {
+ "runtimeSource": "embedded",
+ "connection": {
+ "connectionReferenceLogicalName": "admin_CoECoreDataverse"
+ },
+ "api": {
+ "name": "shared_commondataserviceforapps"
+ }
+ }
+ },
+ "definition": {
+ "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
+ "contentVersion": "1.0.0.0",
+ "parameters": {
+ "$connections": {
+ "defaultValue": {},
+ "type": "Object"
+ },
+ "$authentication": {
+ "defaultValue": {},
+ "type": "SecureObject"
+ },
+ "Empty Solution Cleanup - Days Before Eligible (admin_EmptySolutionCleanup_DaysBeforeEligible)": {
+ "defaultValue": 30,
+ "type": "Int",
+ "metadata": {
+ "schemaName": "admin_EmptySolutionCleanup_DaysBeforeEligible",
+ "description": "Number of days a solution must be empty before being eligible for cleanup. Default: 30 days."
+ }
+ },
+ "Empty Solution Cleanup - Action (admin_EmptySolutionCleanup_Action)": {
+ "defaultValue": "Flag",
+ "type": "String",
+ "metadata": {
+ "schemaName": "admin_EmptySolutionCleanup_Action",
+ "description": "Action to take on empty solutions: Flag (mark only) or Delete (remove from environment). Default: Flag"
+ }
+ },
+ "Empty Solution Cleanup - Enabled (admin_EmptySolutionCleanup_Enabled)": {
+ "defaultValue": false,
+ "type": "Bool",
+ "metadata": {
+ "schemaName": "admin_EmptySolutionCleanup_Enabled",
+ "description": "Enable automatic cleanup of empty solutions. Default: No (must be explicitly enabled)"
+ }
+ }
+ },
+ "triggers": {
+ "Recurrence": {
+ "recurrence": {
+ "frequency": "Week",
+ "interval": 1
+ },
+ "metadata": {
+ "operationMetadataId": "trigger-guid"
+ },
+ "type": "Recurrence"
+ }
+ },
+ "actions": {
+ "Check_If_Enabled": {
+ "actions": {
+ "Terminate_Disabled": {
+ "runAfter": {},
+ "type": "Terminate",
+ "inputs": {
+ "runStatus": "Succeeded"
+ }
+ }
+ },
+ "runAfter": {},
+ "expression": {
+ "equals": [
+ "@parameters('Empty Solution Cleanup - Enabled (admin_EmptySolutionCleanup_Enabled)')",
+ false
+ ]
+ },
+ "type": "If"
+ },
+ "Get_Empty_Solutions": {
+ "runAfter": {
+ "Check_If_Enabled": [
+ "Succeeded"
+ ]
+ },
+ "type": "OpenApiConnection",
+ "inputs": {
+ "host": {
+ "connectionName": "shared_commondataserviceforapps",
+ "operationId": "ListRecords",
+ "apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"
+ },
+ "parameters": {
+ "entityName": "admin_solutions",
+ "$select": "admin_solutionid, admin_name, admin_solutiondisplayname, admin_solutionenvironmentdisplayname, admin_solutionenvtguid, admin_emptysolutiondetecteddate, admin_componentcount",
+ "$filter": "admin_isemptysolution eq true and admin_solutiondeleted ne true and admin_solutionismanaged eq false",
+ "$expand": "admin_SolutionEnvironment($select=admin_environmentid,admin_displayname,admin_environmentcdsinstanceurl)"
+ },
+ "authentication": "@parameters('$authentication')"
+ }
+ },
+ "Filter_By_Age": {
+ "runAfter": {
+ "Get_Empty_Solutions": [
+ "Succeeded"
+ ]
+ },
+ "type": "Query",
+ "inputs": {
+ "from": "@outputs('Get_Empty_Solutions')?['body/value']",
+ "where": "@lessOrEquals(item()?['admin_emptysolutiondetecteddate'], addDays(utcNow(), mul(parameters('Empty Solution Cleanup - Days Before Eligible (admin_EmptySolutionCleanup_DaysBeforeEligible)'), -1)))"
+ }
+ },
+ "Process_Each_Empty_Solution": {
+ "foreach": "@body('Filter_By_Age')",
+ "actions": {
+ "Switch_On_Action": {
+ "runAfter": {},
+ "cases": {
+ "Flag": {
+ "case": "Flag",
+ "actions": {
+ "Update_Solution_Flag": {
+ "type": "OpenApiConnection",
+ "inputs": {
+ "host": {
+ "connectionName": "shared_commondataserviceforapps",
+ "operationId": "UpdateRecord",
+ "apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"
+ },
+ "parameters": {
+ "entityName": "admin_solutions",
+ "recordId": "@items('Process_Each_Empty_Solution')?['admin_solutionid']",
+ "item/admin_solutionisorphaned": "Yes"
+ },
+ "authentication": "@parameters('$authentication')"
+ }
+ }
+ }
+ },
+ "Delete": {
+ "case": "Delete",
+ "actions": {
+ "Delete_Solution_From_Environment": {
+ "runAfter": {},
+ "type": "OpenApiConnection",
+ "inputs": {
+ "host": {
+ "connectionName": "shared_commondataserviceforapps_2",
+ "operationId": "DeleteRecordWithOrganization",
+ "apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"
+ },
+ "parameters": {
+ "organization": "@items('Process_Each_Empty_Solution')?['admin_SolutionEnvironment/admin_environmentcdsinstanceurl']",
+ "entityName": "solutions",
+ "recordId": "@items('Process_Each_Empty_Solution')?['admin_solutionenvtguid']"
+ },
+ "authentication": "@parameters('$authentication')",
+ "retryPolicy": {
+ "type": "exponential",
+ "count": 3,
+ "interval": "PT10S"
+ }
+ }
+ },
+ "Mark_As_Deleted_In_Inventory": {
+ "runAfter": {
+ "Delete_Solution_From_Environment": [
+ "Succeeded"
+ ]
+ },
+ "type": "OpenApiConnection",
+ "inputs": {
+ "host": {
+ "connectionName": "shared_commondataserviceforapps",
+ "operationId": "UpdateRecord",
+ "apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"
+ },
+ "parameters": {
+ "entityName": "admin_solutions",
+ "recordId": "@items('Process_Each_Empty_Solution')?['admin_solutionid']",
+ "item/admin_solutiondeleted": true,
+ "item/admin_solutiondeletedon": "@utcNow()"
+ },
+ "authentication": "@parameters('$authentication')"
+ }
+ }
+ }
+ }
+ },
+ "default": {
+ "actions": {}
+ },
+ "expression": "@parameters('Empty Solution Cleanup - Action (admin_EmptySolutionCleanup_Action)')",
+ "type": "Switch"
+ }
+ },
+ "runAfter": {
+ "Filter_By_Age": [
+ "Succeeded"
+ ]
+ },
+ "type": "Foreach",
+ "runtimeConfiguration": {
+ "concurrency": {
+ "repetitions": 1
+ }
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+**Key Features**:
+- โ
Disabled by default (must explicitly enable via environment variable)
+- โ
Configurable age threshold (default: 30 days)
+- โ
Two modes: Flag (safe) or Delete (aggressive)
+- โ
Only processes unmanaged, non-deleted solutions
+- โ
Sequential processing to avoid throttling
+- โ
Proper error handling with retry logic
+
+---
+
+#### Step 3.2: Create Environment Variables
+**Files**: `CenterofExcellenceCoreComponents/SolutionPackage/src/environmentvariabledefinitions/`
+
+**Three new files**:
+
+1. **admin_EmptySolutionCleanup_Enabled**
+```json
+{
+ "SchemaName": "admin_EmptySolutionCleanup_Enabled",
+ "DisplayName": "Empty Solution Cleanup - Enabled",
+ "Description": "Enable automatic cleanup of empty solutions. Default: No (must be explicitly enabled)",
+ "Type": 100000001,
+ "DefaultValue": "false"
+}
+```
+
+2. **admin_EmptySolutionCleanup_DaysBeforeEligible**
+```json
+{
+ "SchemaName": "admin_EmptySolutionCleanup_DaysBeforeEligible",
+ "DisplayName": "Empty Solution Cleanup - Days Before Eligible",
+ "Description": "Number of days a solution must be empty before being eligible for cleanup. Default: 30 days.",
+ "Type": 100000002,
+ "DefaultValue": "30"
+}
+```
+
+3. **admin_EmptySolutionCleanup_Action**
+```json
+{
+ "SchemaName": "admin_EmptySolutionCleanup_Action",
+ "DisplayName": "Empty Solution Cleanup - Action",
+ "Description": "Action to take on empty solutions: 'Flag' (mark only) or 'Delete' (remove from environment). Default: Flag",
+ "Type": 100000000,
+ "DefaultValue": "Flag"
+}
+```
+
+---
+
+### Phase 4: Dashboard & Reporting Enhancements
+
+#### Step 4.1: Add Empty Solutions View
+**File**: `CenterofExcellenceCoreComponents/SolutionPackage/src/Entities/admin_Solution/SavedQueries/`
+
+**Create**: `EmptySolutions.xml`
+```xml
+
+ Empty Solutions
+ Shows all solutions with zero components
+ 0
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+#### Step 4.2: Update Power BI Dashboard (Optional)
+**File**: `CenterofExcellenceCoreComponents/PowerBI/[Dashboard].pbix`
+
+**Add Measures**:
+```dax
+Empty Solutions Count =
+CALCULATE(
+ COUNT('Solution'[SolutionID]),
+ 'Solution'[IsEmptySolution] = TRUE,
+ 'Solution'[SolutionDeleted] = FALSE
+)
+
+Empty Solutions % =
+DIVIDE(
+ [Empty Solutions Count],
+ [Total Solutions],
+ 0
+)
+```
+
+**Add Visual**: Card or table showing empty solution statistics
+
+---
+
+### Phase 5: Documentation
+
+#### Step 5.1: Create User Guide
+**File**: `CenterofExcellenceResources/EmptySolutionCleanup-UserGuide.md`
+
+**Content**:
+```markdown
+# Empty Solution Cleanup - User Guide
+
+## Overview
+The Empty Solution Cleanup feature automatically identifies and optionally removes Power Platform solutions that contain zero components.
+
+## When to Use
+- SharePoint-created solutions left behind after list deletion
+- Test solutions no longer containing any objects
+- General housekeeping in crowded environments
+
+## Configuration
+
+### Enable Cleanup
+1. Navigate to Power Apps โ CoE Environment
+2. Go to Solutions โ Center of Excellence - Core Components โ Environment Variables
+3. Find `Empty Solution Cleanup - Enabled`
+4. Set Current Value = `Yes`
+
+### Choose Action Mode
+- **Flag** (Recommended): Marks solutions as orphaned without deleting
+- **Delete**: Permanently removes solutions from environment
+
+### Set Age Threshold
+- Default: 30 days
+- Recommendation: Start with 60-90 days for safety
+- Adjust based on your organization's needs
+
+## Safety Features
+โ
Disabled by default
+โ
Only targets unmanaged solutions
+โ
Requires configurable age threshold
+โ
Never deletes system/Microsoft solutions
+โ
Cannot delete managed solutions (by API design)
+
+## Monitoring
+Check the `admin_Solution` table for:
+- `admin_isemptysolution = true` - Solutions flagged as empty
+- `admin_emptysolutiondetecteddate` - When solution became empty
+- `admin_componentcount` - Total component count
+
+## Troubleshooting
+[Common issues and solutions]
+```
+
+#### Step 5.2: Update Main Documentation
+**File**: `README.md`
+
+Add section referencing new capability in cleanup features.
+
+---
+
+## Affected Files & Components
+
+### New Files (To Be Created)
+1. โ
`CLEANUPHELPER-EmptySolutions-[GUID].json` - Main cleanup flow
+2. โ
`CLEANUPHELPER-EmptySolutions-[GUID].json.data.xml` - Flow metadata
+3. โ
`admin_EmptySolutionCleanup_Enabled` - Environment variable definition
+4. โ
`admin_EmptySolutionCleanup_DaysBeforeEligible` - Environment variable definition
+5. โ
`admin_EmptySolutionCleanup_Action` - Environment variable definition
+6. โ
`EmptySolutionCleanup-UserGuide.md` - User documentation
+7. โ
`EmptySolutions.xml` - Saved query/view
+
+### Modified Files
+1. โ
`admin_Solution/Entity.xml` - Add 3 new fields
+2. โ
`AdminSyncTemplatev4Solutions-[GUID].json` - Add component count logic
+3. โ
`README.md` - Reference new feature
+4. โ
`solution.xml` - Update version number
+
+### Estimated Changes
+- **Lines Added**: ~800-1000
+- **Lines Modified**: ~50-100
+- **New Components**: 7 files
+- **Modified Components**: 4 files
+
+---
+
+## Risks, Dependencies & Compatibility
+
+### Risks
+
+#### Risk 1: Accidental Deletion of Valuable Solutions โ ๏ธ HIGH
+**Scenario**: User sets cleanup to "Delete" with short age threshold
+**Impact**: Loss of solution structure (though components remain)
+**Mitigation**:
+- Default to "Flag" mode
+- Require explicit opt-in for "Delete" mode
+- Minimum age threshold of 30 days (configurable)
+- Clear documentation warnings
+
+#### Risk 2: Performance Impact on Sync โ ๏ธ MEDIUM
+**Scenario**: Additional API call per solution during inventory
+**Impact**: Longer sync times, potential throttling
+**Mitigation**:
+- Use existing retry/pagination patterns
+- Component count query is lightweight (no data retrieval)
+- Sync already handles hundreds of solutions efficiently
+
+#### Risk 3: False Positives โ ๏ธ LOW
+**Scenario**: Solution temporarily empty during development
+**Impact**: Premature cleanup flagging
+**Mitigation**:
+- Age threshold (solution must be empty for X days)
+- First detected date tracking
+- Flag before delete option
+
+#### Risk 4: Permission Issues โ ๏ธ LOW
+**Scenario**: Service account lacks delete permissions
+**Impact**: Flow failures when deleting solutions
+**Mitigation**:
+- Document permission requirements
+- Graceful error handling in flow
+- Fallback to "Flag" mode on permission errors
+
+### Dependencies
+
+#### Dependency 1: Dataverse Connector
+**Requirement**: Power Platform Dataverse connector with `ListRecordsWithOrganization` operation
+**Status**: โ
Already in use
+**Version**: Current connector version supports required operations
+
+#### Dependency 2: Solution Sync Must Run First
+**Requirement**: `AdminSyncTemplatev4Solutions` must complete before cleanup runs
+**Status**: โ
Existing sync infrastructure
+**Implementation**: Schedule cleanup to run after sync window
+
+#### Dependency 3: CoE Core Components v4.XX+
+**Requirement**: New fields require solution upgrade
+**Status**: โ
Normal upgrade process
+**Impact**: Users must upgrade to latest version
+
+### Compatibility Considerations
+
+#### Backward Compatibility โ
SAFE
+- New fields are optional (nullable)
+- Existing flows/apps unaffected
+- Cleanup flow disabled by default
+- No breaking changes to APIs
+
+#### Upgrade Path โ
SMOOTH
+1. Solution import adds new fields (default null)
+2. Next solution sync populates component counts
+3. Admin manually enables cleanup if desired
+4. No data migration required
+
+#### Rollback Strategy โ
AVAILABLE
+- Disable cleanup via environment variable
+- Fields remain but unused
+- No permanent changes to solution inventory
+- Full rollback via solution uninstall
+
+---
+
+## Testing Strategy
+
+### Unit Testing
+1. โ
Test component count calculation for solutions with:
+ - 0 components
+ - 1-10 components
+ - 100+ components
+ - Only metadata components (tables, option sets)
+
+2. โ
Test age threshold filtering:
+ - Solutions empty for < threshold days (excluded)
+ - Solutions empty for = threshold days (included)
+ - Solutions empty for > threshold days (included)
+
+3. โ
Test action modes:
+ - Flag mode: Updates `admin_solutionisorphaned`
+ - Delete mode: Removes from environment + updates inventory
+
+### Integration Testing
+1. โ
End-to-end flow:
+ - Create test solution
+ - Remove all components
+ - Wait for sync to detect empty state
+ - Run cleanup flow
+ - Verify solution flagged/deleted
+
+2. โ
Permission scenarios:
+ - Test with admin account (should succeed)
+ - Test with limited account (should gracefully fail)
+
+3. โ
Multi-environment scenarios:
+ - Solutions in Dev, Test, Prod environments
+ - Verify cleanup only affects target environment
+
+### Regression Testing
+1. โ
Existing solution sync continues to work
+2. โ
Existing cleanup flows unaffected
+3. โ
Dashboard/reports show new fields correctly
+4. โ
No performance degradation in sync
+
+### User Acceptance Testing
+1. โ
Documentation clarity
+2. โ
Configuration ease
+3. โ
Dashboard visibility of empty solutions
+4. โ
Expected behavior matches actual behavior
+
+---
+
+## Recommendations
+
+### For Implementation
+1. โ
**Start with Flag mode** - Gain confidence before enabling Delete
+2. โ
**Pilot in test environment** - Validate with sample data first
+3. โ
**Gradual rollout** - Enable per environment, not tenant-wide
+4. โ
**Monitor closely** - Review flagged solutions before auto-delete
+5. โ
**Document exclusions** - If certain empty solutions should persist, document why
+
+### For Documentation
+1. โ
Create video walkthrough of configuration
+2. โ
Add FAQ section for common questions
+3. โ
Include troubleshooting section
+4. โ
Provide example use cases (SharePoint scenario)
+5. โ
Link from main CoE documentation
+
+### For Future Enhancements
+1. ๐ก **Approval workflow** - Require approval before deletion
+2. ๐ก **Notification system** - Alert makers before cleanup
+3. ๐ก **Exclusion list** - Whitelist solutions to never clean
+4. ๐ก **Component type filter** - Define "empty" by component types (e.g., ignore tables)
+5. ๐ก **Archive instead of delete** - Export solution before deletion
+
+---
+
+## Alternatives Considered
+
+### Alternative 1: PowerShell Script โ
+**Approach**: Provide PowerShell script for manual cleanup
+**Pros**: No flow changes, full admin control
+**Cons**: Not integrated, manual execution, no automation
+**Decision**: Rejected - CoE philosophy is automation
+
+### Alternative 2: Power BI Report Only โน๏ธ
+**Approach**: Just add dashboard visibility, no automated cleanup
+**Pros**: Safe, informational only
+**Cons**: Doesn't solve cleanup problem
+**Decision**: Include as part of solution, not standalone
+
+### Alternative 3: Bulk Delete Job ๐ค
+**Approach**: Use Dataverse bulk delete feature
+**Pros**: Native platform feature, efficient
+**Cons**: Harder to configure, less flexible
+**Decision**: Consider for future optimization
+
+### Alternative 4: Manual Approval Flow โ ๏ธ
+**Approach**: Require approval for each deletion
+**Pros**: Maximum safety
+**Cons**: Defeats automation purpose for large volumes
+**Decision**: Provide as optional future enhancement
+
+---
+
+## Conclusion
+
+### Summary
+The Empty Solutions Cleanup feature is:
+- โ
**Feasible** - All required APIs and infrastructure exist
+- โ
**Safe** - Multiple safeguards prevent accidental deletion
+- โ
**Valuable** - Solves real customer pain point
+- โ
**Maintainable** - Follows existing CoE patterns
+
+### Recommended Approach
+**Implement in phases**:
+1. **Phase 1 (MVP)**: Component count tracking + Flag mode only
+2. **Phase 2**: Add Delete mode with safeguards
+3. **Phase 3**: Dashboard enhancements
+4. **Phase 4**: Advanced features (approval, notifications)
+
+### Implementation Effort
+- **Estimated Development Time**: 3-5 days
+- **Testing Time**: 2-3 days
+- **Documentation Time**: 1-2 days
+- **Total**: ~2 weeks (1 sprint)
+
+### Customer Value
+- ๐ฏ Directly addresses reported issue
+- ๐งน Reduces environment clutter
+- ๐ Improves dashboard accuracy
+- โก Enables proactive governance
+
+### Next Steps
+1. โ
Review this analysis with team
+2. โ
Get approval for implementation
+3. โ
Create work items for each phase
+4. โ
Begin Phase 1 development
+5. โ
Schedule demo for stakeholders
+
+---
+
+## References
+
+### Microsoft Documentation
+- [Solution Component Reference](https://learn.microsoft.com/power-apps/developer/data-platform/reference/entities/solutioncomponent)
+- [Dataverse Connector Operations](https://learn.microsoft.com/connectors/commondataserviceforapps/)
+- [Solution Lifecycle Management](https://learn.microsoft.com/power-platform/alm/solution-concepts-alm)
+
+### CoE Starter Kit Documentation
+- [CoE Starter Kit Overview](https://learn.microsoft.com/power-platform/guidance/coe/starter-kit)
+- [Cleanup Workflows](https://learn.microsoft.com/power-platform/guidance/coe/setup-archive-components)
+- [Solution Inventory](https://learn.microsoft.com/power-platform/guidance/coe/setup-core-components)
+
+### Related Issues
+- [Search for similar requests](https://github.com/microsoft/coe-starter-kit/issues?q=is%3Aissue+solution+empty)
+- [Cleanup workflow examples](https://github.com/microsoft/coe-starter-kit/tree/main/CenterofExcellenceCoreComponents/SolutionPackage/src/Workflows)
+
+---
+
+**Analysis Version**: 1.0
+**Date**: 2026-01-29
+**Analyst**: GitHub Copilot (CoE Custom Agent)
+**Status**: Ready for Review
diff --git a/docs/ENHANCEMENT-SUMMARY-Empty-Solutions.md b/docs/ENHANCEMENT-SUMMARY-Empty-Solutions.md
new file mode 100644
index 000000000..23fe11a5d
--- /dev/null
+++ b/docs/ENHANCEMENT-SUMMARY-Empty-Solutions.md
@@ -0,0 +1,59 @@
+# Enhancement Request Summary: Empty Solutions Cleanup
+
+## Quick Summary
+**Status**: โ
**FEASIBLE AND RECOMMENDED**
+**Effort**: ~2 weeks (1 sprint)
+**Value**: HIGH - Solves real customer pain point
+
+## Problem
+External applications (SharePoint Work Tracker, etc.) create solutions in Power Platform that become empty when the source is deleted. CoE currently has no way to identify or clean these up.
+
+## Solution Approach
+**Hybrid implementation** combining both user requests:
+1. โ
New cleanup flow for automatic empty solution management
+2. โ
Enhanced solution tracking with component counts
+
+## Key Features
+- **Safe by Default**: Disabled until explicitly enabled, Flag mode before Delete
+- **Configurable**: Age threshold, action mode (Flag vs Delete)
+- **Smart Filtering**: Only unmanaged, non-system solutions
+- **Performance Optimized**: Component count cached during sync
+
+## Implementation Phases
+1. **Phase 1 (MVP)**: Add component count tracking + Flag mode
+2. **Phase 2**: Enable Delete mode with safeguards
+3. **Phase 3**: Dashboard enhancements
+4. **Phase 4**: Advanced features (approval, notifications)
+
+## Technical Details
+- New fields: `admin_componentcount`, `admin_isemptysolution`, `admin_emptysolutiondetecteddate`
+- New flow: `CLEANUPHELPER-EmptySolutions`
+- Enhanced flow: `AdminSyncTemplatev4Solutions`
+- New environment variables: 3 configuration settings
+
+## Risks & Mitigations
+- โ
**Accidental deletion**: Multiple safeguards (disabled by default, age threshold, flag mode)
+- โ
**Performance**: Lightweight queries, existing retry logic
+- โ
**False positives**: Age-based filtering, gradual rollout
+
+## Full Analysis
+See [ENHANCEMENT-ANALYSIS-Empty-Solutions-Cleanup.md](../ENHANCEMENT-ANALYSIS-Empty-Solutions-Cleanup.md) for:
+- Complete technical specification
+- Step-by-step implementation plan with code samples
+- Testing strategy
+- Risk assessment
+- Future enhancement roadmap
+
+## Recommendation
+**Approve for implementation** - This is a valuable feature that:
+- โ
Solves reported customer issue
+- โ
Uses existing infrastructure
+- โ
Follows CoE patterns
+- โ
Has appropriate safeguards
+- โ
Provides immediate value
+
+## Next Steps
+1. Review and approve this analysis
+2. Create work items for Phase 1
+3. Begin development
+4. Schedule demo after Phase 1 completion