ServiceChannel defines a channel of work handled by Omni-Channel, such as cases, chats, or leads. It associates an object type with channel-specific capacity, acceptance, secondary routing priority, and conversation wrap-up behavior. Omni-Channel must be enabled in the org for this metadata type to be available.
The channel definition is separate from the org-specific ServiceChannel record ID used by routing actions. It is also separate from an agent's presence status: deploying a channel does not establish that an agent is currently available to receive its work.
Key Elements
| Element | What the Element Controls |
|---|---|
label |
Required. The service channel's display label. |
relatedEntityType |
Required. The object type associated with the channel, such as Case. |
capacityModel |
When work releases an agent's capacity. Allowed values are STATUS_BASED and TAB_BASED. |
statusField |
The field used to track work status for status-based capacity routing. Interpret it together with serviceChannelStatusFieldMappings. |
serviceChannelStatusFieldMappings |
Maps business record field values to capacity-routing classifications. Each entry contains type and value. Allowed type values are IN_PROGRESS, PAUSED, and COMPLETED. |
isInterruptible |
Whether work consumes interruptible capacity instead of primary capacity. Defaults to false; available only when Interruptible Capacity is enabled. |
secondaryRoutingPriorityField |
The standard field name or custom field ID used for secondary routing priority. A custom field reference is not necessarily a developer name. |
serviceChannelFieldPriorities |
A collection Salesforce marks as required. Each entry maps a value of secondaryRoutingPriorityField to an integer priority; both entry fields are required. |
hasAfterConvoWorkTimer |
Enables the After Conversation Work (ACW) timer for Messaging or Voice channels. Defaults to false. When true, requires afterConvoWorkMaxTime. |
afterConvoWorkMaxTime |
The initial ACW allowance, from 10 through 3600 seconds. Salesforce's field table uses a conflicting spelling, afterConvoMaxTime; see Documentation Inconsistencies. |
hasAcwExtensionEnabled |
Allows agents to extend ACW time for Messaging or Voice channels. Defaults to false. Requires the timer to be enabled and both extension duration and count to be configured. |
acwExtensionDuration |
The maximum time for each ACW extension, from 10 through 3600 seconds. Required when hasAcwExtensionEnabled is true. |
maxExtensions |
The maximum number of ACW extensions, from 1 through 10. Required when hasAcwExtensionEnabled is true. |
hasAutoAcceptEnabled |
Makes work items open automatically in the agent's workspace without manual acceptance. |
interactionComponent |
Identifies the CustomApplicationComponent to open in the console footer when an agent accepts work from this channel. |
Behavior and Constraints
Capacity depends on the routing model
With capacityModel=STATUS_BASED, work remains assigned and counts against the agent's capacity until it is completed or reassigned to another agent. Closing the work tab does not by itself release that capacity. With capacityModel=TAB_BASED, closing the work tab in the service console releases capacity.
For status-based routing, statusField selects the business record field, and serviceChannelStatusFieldMappings classifies its values as IN_PROGRESS, PAUSED, or COMPLETED. These classifications describe work status for capacity routing, not secondary routing priority.
Two settings override capacity checks rather than simply enabling stricter checks:
-
doesCheckCapOnOwnerChange: whentrue, the override keeps reassigned work assigned to the specified agent. -
doesCheckCapOnStatusChange: whentrue, the override reassigns reopened work to a specific agent.
Both settings default to false. Separately, isInterruptible selects which capacity pool the work consumes; it requires the Interruptible Capacity feature.
Secondary priority uses a separate mapping
secondaryRoutingPriorityField selects the field used for secondary routing priority. serviceChannelFieldPriorities then maps that field's values to integer priorities. Its entries contain priority and value, not the type and value pair used for status mappings.
The value in a secondary-priority mapping refers to secondaryRoutingPriorityField. It does not automatically refer to statusField, even when a channel uses a status field for both purposes. Changes to either selected field or its relevant values affect how the corresponding mappings are interpreted.
Conversation wrap-up settings have dependent requirements
After Conversation Work (ACW) is the time allowed for wrap-up after a conversation. These settings apply only to Messaging or Voice channels:
- Set
hasAfterConvoWorkTimer=trueto configure the timer, and supplyafterConvoWorkMaxTimefrom 10 through 3600 seconds. - Enable
hasAcwExtensionEnabledonly when the timer is enabled. SupplyacwExtensionDurationfrom 10 through 3600 seconds andmaxExtensionsfrom 1 through 10.
The initial allowance, duration of each extension, and number of extensions are separate controls. Enabling extensions alone does not supply the required duration or count.
Acceptance and presence are different controls
hasAutoAcceptEnabled removes the need for manual acceptance. doesMinimizeWidgetOnAccept controls whether the Omni-Channel widget minimizes when the agent accepts work. interactionComponent selects the custom console component opened in the footer on acceptance.
ServicePresenceStatus associates presence statuses with service channels. That association alone does not establish which users can select a status or whether an agent is currently available.
Deployment and Retrieval
ServiceChannel components use the .serviceChannel suffix and reside in the serviceChannels folder. The type inherits fullName from the base Metadata type. A package.xml manifest can select components under the type name ServiceChannel, and the type supports the * wildcard for members.
The target org must have Omni-Channel enabled. Check the associated object and field references as part of a cross-org deployment: relatedEntityType selects the object, while secondaryRoutingPriorityField accepts a standard field name or a custom field ID. Do not assume that a custom field ID is a portable developer-name reference.
Keep three layers separate when diagnosing routing after deployment:
- The
ServiceChannelmetadata definition. - The runtime channel record and its org-specific ID.
- The channel inputs stored by a routing consumer, such as a Flow Route Work action.
A Route Work failure can involve the consumer's stored channel inputs even when the channel definition exists. Likewise, an AgentWork creation failure can involve live agent presence rather than a missing channel. The conditional reports below describe both cases.
Apex test setup also differs from metadata deployment. An Apex Data Manipulation Language (DML) insert attempts to create a runtime record; it is not a Metadata API deployment. The reported test restriction below does not establish a restriction on deploying ServiceChannel metadata.
Relationships
The channel connects an object and its routing fields to acceptance behavior. Presence-status metadata points back to the channel through channel entries within channels.
References
-
CustomApplicationComponent:interactionComponent. -
CustomObject:relatedEntityType. -
CustomField:secondaryRoutingPriorityField,statusField, on the associated object.
Referenced By
-
ServicePresenceStatus:channel, withinchannels.
Documentation Inconsistencies
ACW duration has conflicting element spellings. The exposed element name is afterConvoWorkMaxTime, and Salesforce's description of hasAfterConvoWorkTimer uses that spelling. Salesforce's field table instead labels the duration afterConvoMaxTime. These are conflicting spellings, not documented interchangeable elements.
The mapping helper documentation combines two different structures. Salesforce's ServiceChannelFieldPriority description mixes priority and work-status fields and gives two meanings for value. Keep the collections distinct: serviceChannelFieldPriorities entries contain priority and value; serviceChannelStatusFieldMappings entries contain type and value. The former maps the secondary-priority field, while the latter maps the status field.
Reported Issues
-
Route Work can fail after cross-org deployment even when the channel exists. An April 2025 report attributed a
serviceChannel is nullfailure to an org-specificserviceChannelIdstored alongsideserviceChannelLabelandserviceChannelDevNamein the Flow action. Participants reported resolving their cases by reselecting the channel and routing target. One participant instead reported querying the runtimeServiceChannelbyDeveloperNameand supplying the query results to the three inputs. That participant warned that selecting the channel again in Flow Builder required reapplying the XML workaround. This is a conditional Flow-reference issue, not a requirement to rewrite every routing Flow. See the Route Work deployment discussion. -
An existing channel does not rule out an agent-availability problem. A 2020 report associated the
AgentWorkerror "The agent's status is not associated with the channel for this work" with the selected agent being Offline or Busy. The report makes live presence relevant to diagnosis instead of treating the error solely as a missingServiceChanneldefinition. See the AgentWork presence report. -
Creating a channel through Apex DML in a test was reported as disallowed. A 2021 answer discussing a
PendingServiceRoutingtest failure with a missing validServiceChannelIdreported "DML operation Insert not allowed on ServiceChannel" when attempting to create the channel in the test. This does not establish a generalSeeAllDatarequirement or a Metadata API deployment restriction. See the PendingServiceRouting test discussion.
Common Questions
Why does work still consume capacity after the agent closes its tab?
Check capacityModel. With STATUS_BASED, work continues to count against capacity until completed or reassigned to another agent. Interpret statusField with serviceChannelStatusFieldMappings. Closing the tab releases capacity under TAB_BASED.
Where are ServiceChannel files stored, and can I retrieve all of them?
Components reside in serviceChannels with the .serviceChannel suffix. Use ServiceChannel as the manifest type name; wildcard members are supported. Omni-Channel must be enabled for the type to be available.
Why does Route Work report that serviceChannel is null after deployment?
A community report linked this failure to an org-specific channel ID retained in the Flow action. Inspect the action's channel inputs as well as the channel definition. Participants reported that reselecting the channel and routing target resolved their cases.
What fields are required to enable ACW extensions?
For a Messaging or Voice channel, enable hasAfterConvoWorkTimer and configure the initial ACW allowance. Then set hasAcwExtensionEnabled=true, acwExtensionDuration from 10 through 3600 seconds, and maxExtensions from 1 through 10. The duration element has the documentation spelling conflict described above.
Are status mappings the same as secondary routing priorities?
No. serviceChannelStatusFieldMappings maps status-field values to IN_PROGRESS, PAUSED, or COMPLETED. serviceChannelFieldPriorities maps values of secondaryRoutingPriorityField to integer priorities.