Newer Version Available

This content describes an older version of this product. View Latest

AgentWork

Represents a work assignment that’s been routed to an agent. This object is available in API version 32.0 and later.

Supported Calls

create(), delete(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), undelete(), update(), upsert()

Special Access Rules

To access this object, Omni-Channel must be enabled.

Fields

Field Details
AcceptDateTime
Type
dateTime
Properties
Filter, Nillable, Sort
Description
Indicates when the work item was accepted.
ActiveTime
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The amount of time an agent actively worked on the work item. Tracks when the item is open and in focus in the agent’s console. If After Conversation Work is in use, ActiveTime ends when the AfterConversationActualTime period ends or the agent closes the work item, whichever occurs first.

ActiveTime is tracked only for work that is routed using the tab-based capacity model.

Note

AcwExtensionCount
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The number of times that an agent extended the After Conversation Work (ACW) timer. This field is available in API version 55.0 and later.
AcwExtensionDuration
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The length of time (in seconds) that the After Conversation Work (ACW) timer was extended each time that the agent extended the timer. This field is available in API version 55.0 and later.

To find the total extension duration, multiply this field by AcwExtensionCount or use AfterConversationActualTime.

AfterConversationActualTime
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The number of seconds an agent spent on After Conversation Work (ACW) after customer contact ended. This field is available in API version 52.0 and later.
AgentCapacityWhenDeclined
Type
double
Properties
Filter, Nillable, Sort
Description
The agent’s capacity when declining work, either explicitly or through push timeout.
AssignedDateTime
Type
dateTime
Properties
Filter, Nillable, Sort
Description
Indicates when the work item was assigned to an agent. This field is a calculated field.
BotId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort
Description
The ID of the Einstein Bot that performed the work. This field only applies to Enhanced Bots. This is a relationship field. This field is available in API version 52.0 and later.
Relationship Name
Bot
Relationship Type
Lookup
Refers To
BotDefinition
CancelDateTime
Type
dateTime
Properties
Filter, Nillable, Sort
Description
Indicates when the work item was canceled.
CapacityModel
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
Indicates the capacity model used to determine agent capacity. Valid values are StatusBased and TabBased. This field is available in API version 50.0 and later.

A work item consumes agent capacity only if it was first assigned to the agent by Omni-Channel using queues or skills.

Note

CapacityPercentage
Type
percent
Properties
Create, Filter, Nillable, Sort
Description
The percentage of an agent’s capacity for work items that’s consumed by a specific type of work item from this service channel.

When an agent’s combined work items reach 100%, the agent doesn’t receive new work items until there’s enough open capacity for more work. For example, if you give phone calls a capacity percentage of 100, an agent on a call doesn’t receive new work items until the call ends.

CapacityWeight
Type
double
Properties
Create, Filter, Nillable, Sort
Description
The amount of an agent’s capacity for work items that’s consumed by a work item from this service channel.

For example, if cases are assigned a capacity weight of 2, an agent with a capacity of 6 can accept up to 3 cases before the agent is at capacity and can’t receive new work items.

CloseDateTime
Type
dateTime
Properties
Filter, Nillable, Sort
Description
Indicates when the work item was closed.
DeclineDateTime
Type
dateTime
Properties
Filter, Nillable, Sort
Description
Date and time when the agent declined this record.
DeclineReason
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The provided reason for why an agent declined the work request.
HandleTime
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The amount of time an agent had the work item open. Calculated by CloseDateTimeAcceptedDateTime. If After Conversation Work is in use, HandleTime ends when the AfterConversationActualTime period ends or the agent closes the work item, whichever occurs first.
IsOwnerChangeInitiated
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether a work item owner change triggered the direct assignment of the work item to the agent. The default value is false. Status-Based Capacity Model has to be turned on to use this field. This field is available in API version 50.0 and later.
IsPreferredUserRequired
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether a work item stays with the preferred user even when the user isn’t available. The default value is false. This field is available in API version 50.0 and later.
IsStatusChangeInitiated
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether a work item status change triggered the direct assignment of the work item to the agent. The default value is false. Status-Based Capacity Model has to be turned on to use this field. This field is available in API version 50.0 and later.
Name
Type
string
Properties
Autonumber, Defaulted on create, Filter, idLookup, Sort
Description
An automatically generated ID number that identifies the record.
OriginalGroupId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The ID of the queue that the work assignment was originally routed to. This field is a relationship field.
Relationship Name
OriginalGroup
Relationship Type
Lookup
Refers To
Group
OriginalQueueId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The ID of the queue that the work assignment was originally routed to. Due to API changes, OriginalQueueId is no longer recommended. Use OriginalGroupId instead.
OwnerId
Type
reference
Properties
Create, Defaulted on create, Filter, Group, Sort, Update
Description
The ID of the owner of the AgentWork. This field is a polymorphic relationship field. This field is available in API version 50.0 and later.
Relationship Name
Owner
Relationship Type
Lookup
Refers To
Group, User
PendingServiceRoutingId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort
Description
The ID of the PendingServiceRouting from which the AgentWork was created. This field is a relationship field. This field is available in API version 50.0 and later.
Relationship Name
PendingServiceRouting
Relationship Type
Lookup
Refers To
PendingServiceRouting
PreferredUserId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The ID of the preferred user to handle the work. This field is a relationship field. This field is available in API v46.0 and later.
Relationship Name
PreferredUser
Relationship Type
Lookup
Refers To
User
PushTimeout
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The time limit set for an agent to respond to an item before it’s pushed to another agent. The time limit is measured in seconds. This field is available in API version 36.0 and later.
Effective API version 57.0, for inbound Voice calls, this field represents the time limit set for an agent to respond to a call before it’s declined. The value must be between 0 and 20. The value is capped at 20, so any number greater than that is treated as 20 seconds. This applies to the following telephony models:
  • Service Cloud Voice with Amazon Connect
  • Service Cloud Voice with Partner Telephony from Amazon Connect
PushTimeoutDateTime
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The date and time (in UTC) when the push timeout event occurred. This field is available in API version 36.0 and later.
RequestDateTime
Type
dateTime
Properties
Filter, Nillable, Sort
Description
Indicates when the work was requested.
RoutingModel
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
Determines how incoming work items are routed to agents assigned to a service channel. Possible values are:
  • ExternalRouting
  • LeastActive
  • MostAvailable
RoutingPriority
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The order in which work items from the queue that are associated with the routing configuration are routed to agents.
RoutingType
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The type of Omni-Channel routing. Possible values are:
  • QueueBased
  • SkillsBased
SecondaryRoutingPriority
Type
int
Properties
Filter, Group, Nillable, Sort
Description
Indicates the secondary routing priority.
ServiceChannelId
Type
reference
Properties
Create, Filter, Group, Sort
Description
The ID of the service channel that’s associated with the work assignment. This field is a relationship field.
Relationship Name
ServiceChannel
Relationship Type
Lookup
Refers To
ServiceChannel
ShouldSkipCapacityCheck
Type
boolean
Properties
Create, Defaulted on create, Filter, Group, Sort
Description
Indicates whether to skip checking an agent’s available capacity (true) or not (false) when an externally routed work item is created. This field is used when agents can simultaneously handle work from both Omni-Channel queues and queues using external routing.
When true, the receiving agent can exceed their set capacity to accept the item, but they don’t receive more Omni-Channel routed work. When false, the receiving agent can’t exceed their set capacity and must have enough open capacity to accept the item.
The default value is false.
SpeedToAnswer
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The amount of time between when the work was requested and when an agent accepted it.
Status
Type
picklist
Properties
Filter, Group, Restricted picklist, Sort
Description
The working status of the work item. Valid values are:
  • Assigned – The item is assigned to the agent but hasn’t been opened.
  • Canceled – The item no longer needs to be routed. For example: a chat visitor cancels their Omni-Channel routed chat request before it reaches an agent.
  • Closed – The item is closed.
  • Declined – The item was assigned to the agent but the agent explicitly declined it.
  • DeclinedOnPushTimeout – The item was declined because push time-out is enabled and the item request timed out with the agent.
  • Opened – The agent opened the item.
  • Transferred–The item was transferred from an agent to another agent, queue, or skill.
  • Unavailable – The item was assigned to the agent but the agent became unavailable (went offline or lost connection).
UserId
Type
reference
Properties
Create, Filter, Group, Sort
Description
The ID of the user that the work item was assigned to. This field is a relationship field.
Relationship Name
User
Relationship Type
Lookup
Refers To
User
WorkItemId
Type
reference
Properties
Create, Filter, Group, Sort
Description
The ID of the object that’s routed to the agent through Omni-Channel.
This field is a polymorphic relationship field.
Relationship Name
WorkItem
Relationship Type
Lookup
Refers To
Custom objects and these standard objects: Case, Account, Lead,Contact, Activity, Opportunity, CustomEntityData, SocialPost, Order, ContactRequest, LiveChatTranscript, MessagingSession, VoiceCall, PersonTraining, SwarmMember, Incident, Claim, ClaimRecovery, ClaimCoverage, PaymentRequest, Referral

Usage

AgentWork records can only be deleted if they have the status Closed, Declined, or Unavailable. They can’t be deleted if their status is Assigned or Opened because they’re active in Omni-Channel.

When AgentWork records are created, they have the status Assigned. After a record is created, it’s automatically pushed to the assigned agent.

While the metadata for AgentWork indicates support for upsert() and update(), these calls aren’t used with AgentWork because none of its fields can be updated.

Apex triggers are supported with AgentWork.

Associated Objects

This object has the following associated objects. Unless noted, they’re available in the same API version as this object.

AgentWorkOwnerSharingRule
Sharing rules are available for the object.
AgentWorkShare
Sharing is available for the object.