You can use the TWSearch to search by Process Name and status completed to get a list of all such instances or directly query the LSW_BPD_INSTANCE table
select distinct LBI.BPD_INSTANCE_ID as value, LBI.BPD_NAME as name from LSW_BPD_STATUS_CODES LBSC, LSW_BPD_INSTANCE LBI, LSW_PROJECT LP where LBI.EXECUTION_STATUS = LBSC.STATUS_ID and LBI.PROJECT_ID = LP.PROJECT_ID and LBI.LAST_MODIFIED_DATETIME <= (SYSDATE - ?) and LBSC.STATUS_ID IN <#=tw.local.statusIN#> and LP.SHORT_NAME IN <#=tw.local.appIN#>
Then using the built in stored procedure provided by IBM delete such instances one by one in a loop
call LSW_BPD_INSTANCE_DELETE(?)
parameter is the instanceID