Salesforce Approval Process Objects ProcessInstanceStep & ProcessInstanceWorkitem


Both objects ProcessInstanceStep & ProcessInstanceWorkItem are instances of process steps that are created for particular ProcessInstance. ProcessInstanceStep represents a step instance in an approval process (ProcessInstance) on which users has already acted and ProcessInstanceWorkItem represents a step instance in an approval process(ProcessInstance) on which is pending and users has to perform some action next on it. We can describe, query and retrieve the approval processes steps and workItems.

~ Query ~

SELECT CreatedById,CreatedDate,ElapsedTimeInDays,ElapsedTimeInHours,
ActorId,SystemModstamp FROM ProcessInstanceWorkitem 

SELECT ActorId,Comments,CreatedById,CreatedDate,ElapsedTimeInDays,Id, 
,StepNodeId,StepStatus,SystemModstamp FROM ProcessInstanceStep