Please refer to the following steps to delete the old versions of each file in the SharePoint library:
Step 1: Add Get files(properties only) action to get files in the list.
Step 2: Add Send an HTTP request to SharePoint
Method: GET
Uri: _api/web/GetFolderByServerRelativeUrl('Dynamic content of Folder Path')/Files('Dynamic content of File name with extension')/Versions
Step 3: Parse JSON, put the body of the previous action into the Content of Parse JSON action, then click the button "Use sample payload" to generate schema to paste the following schema:
{
"type": "object",
"properties": {
"d": {
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"type": "object",
"properties": {
"__metadata": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"uri": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"CreatedBy": {
"type": "object",
"properties": {
"__deferred": {
"type": "object",
"properties": {
"uri": {
"type": "string"
}
}
}
}
},
"CheckInComment": {
"type": "string"
},
"Created": {
"type": "string"
},
"ID": {
"type": "integer"
},
"IsCurrentVersion": {
"type": "boolean"
},
"Length": {
"type": "string"
},
"Size": {
"type": "integer"
},
"Url": {
"type": "string"
},
"VersionLabel": {
"type": "string"
}
},
"required": [
"__metadata",
"CreatedBy",
"CheckInComment",
"Created",
"ID",
"IsCurrentVersion",
"Length",
"Size",
"Url",
"VersionLabel"
]
}
}
}
}
}
}

Step 4: Create the other Send an Http request to SharePoint:
Method: DELETE
Uri: _api/web/GetFolderByServerRelativeUrl('Dynamic content of Folder Path')/Files('Dynamic content of File name with extension')/Versions(ID from the previous action)
Please have a try, I hope it can help you.
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.