Workflow versions

Workflows in EBS are versioned. To have an overview of what versions are (still) active in your environment you can run below query.

To cleanup old workflows that are done, you can run the concurrent program "Purge Obsolete Workflow Runtime Data" (short name: FNDWFPR). Depending on the parameters it will only cleanup "done" workflows.

select wfa.item_type,
       wfa.name,
       count(*),
       wfa.version,
       wfa.begin_date,
       (select distinct display_name
          from wf_activities_tl
         where item_type = wfa.item_type
           and name = wfa.name
           and language = 'NL') display_act
, (sum(case when itm.end_date is null then 1 else 0 end))count_open
, (sum(case when itm.end_date is null then 0 else 1 end))count_closed
  from wf_activities wfa, wf_items itm
 where itm.item_type = '&item_type'
-- and itm.item_Type not in 
-- ('APINVAPR','CREATEPO','IEXSTFFM','IEXSTRY','POAPPRV','WFERROR')
   and name in
       (select root_activity from wf_items where item_type = wfa.item_type)
   and type = 'PROCESS'
   and itm.item_type = wfa.item_type
   and root_activity = wfa.name
   and root_activity_version = wfa.version
 group by wfa.item_type, wfa.version, wfa.begin_date, wfa.name
 order by item_type,name, version asc, begin_date asc;

To get an overview of what workflows you are using you can run the following query.

select it.name, itv.display_name
  from wf_item_types it
  join wf_item_types_vl itv
    on it.name = itv.name
 where exists (select 1 from wf_items i where i.item_type = it.name)
 order by name;