Get processing time for Business Process steps and records
To get the processing time for the steps and records of a particular Business Process, see the query below. Don't forget to change the Business Process UUID inside it.
select
bp.title as bp_title
, r.rootRunUUID as bp_instance_uuid
, r.uuid as step_uuid
, r.id as step_id
, r.title as stepTitle
, r.executingType as step_executingType
, r.status as step_status
, r.startDate as step_startDate
, r.endDate as step_endDate
, TIMESTAMPDIFF(SECOND,r.startDate,r.endDate) as step_duration
, ah.id as hit_id
, ah.creationTime as hit_creationTime
, ah.completionDate as hit_completionDate
, TIMESTAMPDIFF(SECOND, ah.creationTime,ah.completionDate) as hit_life_duration
, aha.id as assignment_id
, aha.acceptTime as assignment_acceptTime
, aha.submitTime as assignment_submitTime
, TIMESTAMPDIFF(SECOND,aha.acceptTime, aha.submitTime) as assignment_duration
, mcs.id as source_id
, mcs.name as source_name
, mcs.threadCount
, (INSTR(mc.content, '<selenium')) > 0 as rpa_step_flag
, (INSTR(r.title, 'OCR')) > 0 as ocr_step_flag
, (INSTR(r.title, 'Extract')) > 0 as extract_step_flag
, (INSTR(r.title, 'Pre-process image')) > 0 as convert_step_flag
from Run r
join Campaign bp on bp.id = r.campaign_id
join CampaignMap cm on r.campaignMap_id = cm.id
join Campaign c on c.id = cm.campaign
join MACHINE_CONFIG mc on mc.id = c.machineConfigId
join AwsHit ah on ah.run_id = r.id
left join AwsHitAssignment aha on aha.hit_id = ah.id
left join MachineCampaignSource mcs on mcs.id = mc.source_id
where
r.rootRunUUID in ('f8c779c5-36af-4c51-95c6-0b11c99b83a4')
-- replace with real BP UUID
AND r.status<>'DELETED'
AND r.status<>'DRAFT'