building-contact-center-kpis-agentwork
Installation
SKILL.md
Contact-Center KPIs from the AgentWork Object
What this skill is for
Reliable per-conversation KPIs — Speed to Answer (ASA), Abandoned, Accepted by a genuine human — on VoiceCall and MessagingSession. The timing truth lives on AgentWork (Omni-Channel's routable-work record), so the KPIs are stamped by a record-triggered flow on AgentWork that writes back to the parent conversation. The single hard part is telling a real human accept apart from a bot/ASA/Omni accept — get that wrong and every escalated conversation looks "answered by a human instantly."
Conversation escalates / routes → AgentWork row created & accepted
AgentWork(after save) → is this a genuine HUMAN acceptor? (UserType=Standard AND Profile != Einstein Agent User)
yes → stamp parent.Accepted_By_Human_Timestamp__c = AgentWork.AcceptDateTime
Escalation flow (separate) → stamped parent.Entered_Queue_Timestamp__c at handoff
Abandonment flow (separate) → conversation ended, still queue-owned, never human-accepted → Abandoned__c = true
Speed_To_Answer_Seconds__c = (Accepted_By_Human - Entered_Queue) formula