AgentWork
Represents a work assignment that’s been routed to an agent. If the work is transferred to another agent, a new AgentWork record is created.
Introduced in API version 30.0.
create(), delete(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), undelete(), update(), upsert()
- To access this object, Omni-Channel must be enabled.
- Type: datetime
- Properties: Filter, Nillable, Sort
- Introduced: API version 65.0
- Type: datetime
- Properties: Filter, Nillable, Sort
- Introduced: API version 34.0
- Description: Indicates when the work item was accepted.
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 37.0
- Description: The amount of time an agent is actively working on a work item in their console. Active time is tracked only for tasks routed using the tab-based capacity model. It’s tracked only when the work tab is open and in focus in the console. If the agent switches console tabs, the time spent on the other tabs isn’t counted. Active time continues to count if you switch to a new browser tab or window. Active time stops when the agent closes the work item or the after conversation work time ends, whichever happens first.
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 56.0
- Description: The number of times that an agent extended the After Conversation Work (ACW) timer.
-
Type: int
-
Properties: Filter, Group, Nillable, Sort
-
Introduced: API version 56.0
-
Description:
The length of time (in seconds) that the After Conversation Work (ACW) timer was extended each time that the agent extended the timer.
To find the total extension duration, multiply this field by
AcwExtensionCountor useAfterConversationActualTime.
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 51.0
- Description: The number of seconds an agent spent on After Conversation Work (ACW) after customer contact ended.
- Type: double
- Properties: Filter, Nillable, Sort
- Introduced: API version 34.0
- Description: The agent’s capacity when declining work, either explicitly or through push timeout.
- Type: double
- Properties: Filter, Nillable, Sort
- Introduced: API version 58.0
-
Type: reference
-
Properties: Create, Filter, Group, Nillable, Sort
-
Introduced: API version 67.0
-
Relationship name: AgenticWorkerReferenceObj
-
Relationship type: polymorphic
-
Refers to: AgenticCtxtDecorDefinition, AiAgent
- Type: datetime
- Properties: Filter, Nillable, Sort
- Introduced: API version 34.0
- Description: Indicates when the work item was assigned to an agent
- Type: reference
- Properties: Create, Filter, Group, Nillable, Sort
- Introduced: API version 52.0
- Description: The ID of the Enhanced Einstein Bot or AI agent that performed the work. This is a relationship field.
- Relationship name: Bot
- Relationship type: relationship
- Refers to: BotDefinition
-
Type: picklist
-
Properties: Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort
-
Introduced: API version 63.0
-
Description:
Indicates the type of bot. Valid values are:
- Bot. Refers to an Einstein bot.
- ExternalCopilot. Refers to an AI agent with whom your customers can interact.
The default value is Bot.
-
Possible values:
- Bot. Refers to an Einstein bot. — Bot. Refers to an Einstein bot.
- ExternalCopilot. Refers to an AI agent with whom your customers can interact. — ExternalCopilot. Refers to an AI agent with whom your customers can interact.
- Type: datetime
- Properties: Filter, Nillable, Sort
- Introduced: API version 37.0
- Description: Indicates when the work item was canceled.
-
Type: picklist
-
Properties: Filter, Group, Nillable, Restricted picklist, Sort
-
Introduced: API version 46.0
-
Description:
Indicates the capacity model used to determine agent capacity. Valid values are
StatusBasedandTabBased.A work item consumes agent capacity only if it was first assigned to the agent by Omni-Channel using queues or skills.
-
Type: percent
-
Properties: Create, Filter, Nillable, Sort
-
Introduced: API version 33.0
-
Description:
The percentage of an agent’s capacity that’s consumed when this work item is in progress. Valid values are from 0 to 100.
The agent can receive a new work item only if they have enough available capacity for the item. Voice calls must have a capacity percentage of
100, so an agent on a call doesn’t receive new work items until the call ends.
-
Type: double
-
Properties: Create, Filter, Nillable, Sort
-
Introduced: API version 33.0
-
Description:
The amount of an agent’s capacity that’s consumed when this work item is in progress.
For example, if cases are assigned a capacity weight of
2, an agent with a capacity of6can accept up to 3 cases before the agent is at capacity and can’t receive new work items.Voice calls must use the entire capacity weight.
- Type: datetime
- Properties: Filter, Nillable, Sort
- Introduced: API version 34.0
- Description: Indicates when the work item was closed.
- Type: datetime
- Properties: Filter, Nillable, Sort
- Introduced: API version 34.0
- Description: Date and time when the agent declined this record.
- Type: string
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 37.0
- Description: The provided reason for why an agent declined the work request.
- Type: reference
- Properties: Create, Filter, Group, Nillable, Sort
- Introduced: API version 64.0
- Description: The ID of the third-party bot that handles the work item. This is a relationship field.
- Relationship name: ExternalBot
- Relationship type: relationship
- Refers to: ExternalConversationBotDef
- Type: datetime
- Properties: Filter, Nillable, Sort
- Introduced: API version 68.0
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 37.0
- Description: The amount of time an agent had the work item open, calculated by
CloseDateTime–AcceptedDateTime. Handle time stops when the agent closes the work item or the after conversation work time ends, whichever happens first.
- Type: boolean
- Properties: Create, Defaulted on create, Filter, Group, Sort
- Introduced: API version 58.0
- Description: Indicates whether a work item consumes interruptible or primary capacity. The default value is false. when the Interruptible Capacity feature is enabled.
- Default value: false
- Type: boolean
- Properties: Defaulted on create, Filter, Group, Sort
- Introduced: API version 46.0
- 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. - Default value: false
- Type: boolean
- Properties: Defaulted on create, Filter, Group, Sort
- Introduced: API version 50.0
- Description: Indicates whether a work item stays with the preferred user even when the user isn’t available. The default value is false.
- Default value: false
- Type: boolean
- Properties: Defaulted on create, Filter, Group, Sort
- Introduced: API version 46.0
- 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.
- Default value: false
- Type: string
- Properties: Autonumber, Defaulted on create, Filter, idLookup, Sort
- Description: An automatically generated ID number that identifies the record.
- Type: reference
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 46.0
- 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: relationship
- Refers to: Group
- Type: reference
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 32.0
- Description: The ID of the queue that the work assignment was originally routed to. Due to API changes,
OriginalQueueIdis no longer recommended. UseOriginalGroupIdinstead. - Relationship name: OriginalQueue
- Relationship type: relationship
- Refers to: Queue
- Type: percent
- Properties: Create, Filter, Nillable, Sort, Update
- Introduced: API version 62.0
- Description: The percentage of an agent’s capacity that’s consumed when this work item is paused. The paused capacity feature is available with status-based capacity and Enhanced Omni-Channel only.
- Type: double
- Properties: Create, Defaulted on create, Filter, Nillable, Sort, Update
- Introduced: API version 62.0
- Description: The amount of an agent’s capacity that’s consumed when this work item is paused. The paused capacity feature is available with status-based capacity and Enhanced Omni-Channel only.
- Type: reference
- Properties: Create, Filter, Group, Nillable, Sort
- Introduced: API version 35.0
- Description: The ID of the PendingServiceRouting from which the AgentWork was created. This field is a relationship field.
- Relationship name: PendingServiceRouting
- Relationship type: relationship
- Refers to: PendingServiceRouting
- Type: reference
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 46.0
- 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: relationship
- Refers to: User
-
Type: int
-
Properties: Filter, Group, Nillable, Sort
-
Introduced: API version 36.0
-
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.
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:
- Salesforce Voice with Amazon Connect
- Salesforce Voice with Partner Telephony from Amazon Connect
- Type: datetime
- Properties: Filter, Nillable, Sort
- Introduced: API version 36.0
- Description: The date and time (in UTC) when the push timeout event occurred.
- Type: datetime
- Properties: Filter, Nillable, Sort
- Introduced: API version 34.0
- Description: Indicates when the work was requested.
- Type: picklist
- Properties: Filter, Group, Nillable, Restricted picklist, Sort
- Introduced: API version 42.0
- Description: Determines how incoming work items are routed to agents assigned to a service channel.
- Possible values:
- ExternalRouting — ExternalRouting
- LeastActive — LeastActive
- MostAvailable — MostAvailable
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 42.0
- Description: The order in which work items from the queue that are associated with the routing configuration are routed to agents.
- Type: picklist
- Properties: Filter, Group, Nillable, Restricted picklist, Sort
- Introduced: API version 42.0
- Description: The type of Omni-Channel routing.
- Possible values:
- QueueBased — QueueBased
- SkillsBased — SkillsBased
- Type: datetime
- Properties: Filter, Nillable, Sort
- Introduced: API version 67.0
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 47.0
- Description: Indicates the secondary routing priority.
- 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: relationship
- Refers to: ServiceChannel
-
Type: boolean
-
Properties: Create, Defaulted on create, Filter, Group, Sort
-
Introduced: API version 41.0
-
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. Whenfalse, the receiving agent can’t exceed their set capacity and must have enough open capacity to accept the item.The default value is
false. -
Default value: false
- Type: int
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 34.0
- Description: The amount of time between when the work was requested and when an agent accepted it.
- Type: picklist
- Properties: Filter, Group, Restricted picklist, Sort
- Description: The working status of the work item.
- Possible values:
- Assigned — Assigned — The item is assigned to the agent but hasn’t been opened.
- Canceled — 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 — Closed — The item is closed.
- Declined — Declined — The item was assigned to the agent but the agent explicitly declined it.
- DeclinedOnPushTimeout — DeclinedOnPushTimeout — The item was declined because push time-out is enabled and the item request timed out with the agent.
- Opened — Opened — The agent opened the item.
- Transferred — Transferred — The item was transferred from an agent to another agent, queue, or skill.
- Unavailable — Unavailable — The item was assigned to the agent but the agent became unavailable (went offline or lost connection).
- Type: string
- Properties: Filter, Group, Nillable, Sort
- Introduced: API version 68.0
- Type: datetime
- Properties: Filter, Nillable, Sort, Update
- Introduced: API version 65.0
- Description: The date and time by when a rep must accept a work item. Influences backlog ordering by prioritizing work items with earlier target acceptance deadlines. The field can be dynamically set using Flow for each work item during the routing process. This allows for flexible prioritization based on case urgency, customer tier, or other business rules.
- Type: reference
- Properties: Create, Filter, Group, Nillable, Sort, Update
- Introduced: API version 62.0
- Description: The user ID of the rep who reassigned the work using the Reassign action. This field is populated in reassigned AgentWork records only, not the original AgentWork record. This is a relationship field.
- Relationship name: TransferRequester
- Relationship type: relationship
- Refers to: User
- 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: relationship
- Refers to: User
-
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: polymorphic
-
Refers to: Account, ActionableListMember, Activity, ApplicationForm, ApplicationFormProduct, Case, ChangeRequest, Claim, ClaimCoverage, ClaimRecovery, Contact, ContactRequest, CustomEntityDataTemplate, FlowOrchestrationWorkItem, Incident, Lead, LiveChatTranscript, MessagingSession, Opportunity, Order, PaymentRequest, PersonTraining, Problem, Referral, ServiceRequest, SOSSession, SocialPost, SwarmMember, VoiceCall, WorkOrder
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.
This object has the following associated objects. If the API version isn’t specified, they’re available in the same API versions as this object. Otherwise, they’re available in the specified API version.
-
AgentWorkChangeEvent: Introduced in API version 63.0.