WARNING: This document has been automatically Deferred after 12 months of inactivity in its previous Experimental state. Implementation of the protocol described herein is not recommended for production systems. However, exploratory implementations are encouraged to resume the standards process.
The protocol defined herein enables users to contact a representative of an organization or workgroup without knowing the address of a particular member of that organization or workgroup. This functionality is similar to an 'email alias' with the addition of queuing pending communication requests and quality of service negotiation to accommodate the real-time nature of IM/chat. Although this protocol is generic enough to handle many use cases, specific features have been added that make it particularly suitable for customer support environments.
This protocol addresses the need of starting a private XMPP conversation with a qualified member of a workgroup. In a standard XMPP exchange of messages, users either connect directly to another user for a one on one conversation, or connect to a chat room for a conversation between many people. The current protocols do not allow users to initiate a private conversation with any person playing a particular role in an organization or workgroup.
For example, a customer has a question and needs to talk to a support representative. The conversation is private and therefore cannot be conducted in a well-known chat room. Using the workgroup protocol, the user requests a chat with firstname.lastname@example.org. The chat request is put into a queue and the server routes the chat request to individual support representatives in the email@example.com workgroup. The support representative can accept or reject the chat request. Once the request is accepted, the conversation takes place through standard XMPP messaging protocols.
The namespace governing this protocol is "http://jabber.org/protocol/workgroup". This namespace relies on the <iq/> element for execution, and uses the <presence/> element for announcing status updates.
This protocol depends on Service Discovery (XEP-0030)  for reporting and announcing available workgroup services. However, support for service discovery is entirely optional and workgroup services may be made known through other means (e.g. web pages or word of mouth .
The end result of a workgroup interaction is to negotiate and route a user and workgroup member (a.k.a. agent) to an appropriate chat room for a chat conversation using the multi-user chat (MUC) protocol. However, multi-user chat essentially 'takes over' when the workgroup protocol successfully completes so there is no overlap between the two protocols. It is RECOMMENDED that groupchat implementations support basic groupchat (a.k.a. Groupchat 1.0) for maximum client compatibility.
The workgroup protocol involves three distinct participants that fill the following roles:
User - The user requests a private conversation with a member of a workgroup.
Service - The workgroup service receives and sends messages using the workgroup address. The workgroup address represents a general contact address which allows users to find workgroup members to talk to without the need to know any particular workgroup member's individual address. The workgroup service manages the interactions between users and agents.
Agent - The agent is a member of the workgroup and can carry out conversations with users on behalf of their workgroup organization or company.
In the examples shown throughout this document, the user address <firstname.lastname@example.org/home>, the service address is <email@example.com>, and the agent addresses are <firstname.lastname@example.org/work> and <email@example.com/work>.
Note: A service MAY contain several queues to help organize, route and handle incoming user chat requests. Implementations supporting multiple queues in a workgroup will respond differently to requests, and send different status information for each queue. Workgroup queues are identified by a unique resource name: e.g. firstname.lastname@example.org/platinum-plan or email@example.com/xmpp-products. Implementations should gracefully handle services with only one queue (using firstname.lastname@example.org) or multiple queues. Users should only be aware of one workgroup (users should never see workgroup queue resource names).
Each participant is responsible for certain behaviors in the workgroup protocol.
Know the status of the workgroup queue before requesting a conversation. This information allows users to see if the workgroup is available, and how long a wait they may have before a chat is initiated.
Know the status of their request while in the request queue.
Be able to cancel a chat request at any time.
Workgroup agents should:
Know the status of the workgroup queue(s).
Be able to accept or reject chat requests.
Indicate their availability for handling workgroup chats.
The workgroup service:
Controls the workgroup request queue(s).
Manages the updating of queue status information.
Determines how users are queued and how queue requests are routed to workgroup
members. The queue routing algorithm is beyond the scope of this document and left to
implementers (simple round-robin, priority based, rules based, etc).
Maintains its presence, indicating the availability of the workgroup service.
The workgroup protocol consists of several XMPP packet exchanges that occur during the
lifetime of the protocol. These packet exchanges change the state of the relationship
between user, agent and service.
Users join the workgroup queue to wait for a chat with an agent. Once they have joined the queue, they may receive zero or more status updates from the workgroup service informing them of their status in the queue. Users have the option to cancel their chat request at any time.
When an agent is ready to chat with the user, the user MUST be sent a standard XMPP groupchat invitation to a chat room. Receipt of the invitation indicates that the user is no longer in the queue and that they should join the chat room using the standard XMPP groupchat protocol in order to converse with an agent. Groupchat is used because it offers several advantages in workgroup conversations including:
Allowing more than one agent to join the conversation (useful for bringing in experts to join the conversation).
Allowing managers to monitor conversations for quality of service.
Creating a simple way of determining what is in a 'conversation' for logging and gathering other statistical information about the conversation.
Allowing a convenient mechanism for bringing 'chatbot' services into the conversation (e.g. answering FAQs).
The user's states and packet exchanges that cause state transitions are shown below:
This section describes the packet exchange allowing users to join a workgroup service queue. This protocol MUST be supported by compliant implementations.
The user sends a join request to the workgroup service in order to join the workgroup queue.
The workgroup service may either accept or reject the request. A user session (e.g. email@example.com/home)
may have only one active join request. Subsequent, simultaneous joins MUST result in an error.
Some workgroups require that the user submit certain information before the user is allowed to join.
In these cases, the workgroup MUST reject the initial join request with a <not-acceptable/> error. The user should then
use the Data Forms protocol within iq-join-queue to obtain a form, and submit it to join
The request may contain application-specific metadata to help the service determine queuing of the user or Data Forms data when submitting form information (definition of such data is out of scope for this document). In addition, the <join-queue> element MAY contain a standard <queue-notifications/> element, which indicates that the user would like to receive user status updates about their state in the queue.
A successful join results in a success response:
If the user indicated interest in their queue status information, the supported status updates MUST be sent by the server. Compliant implementations do not have to support any status update types. Status updates requested by the user and supported by the server MUST be pushed to the user by the service until the user departs or is invited to a chat room.
The user is not authorized to join the queue. A determination of who has permission to join a queue is left to implementations.
The address the user requests a chat with does not exist or is not a workgroup. Compliant workgroup service implementations MUST NOT return this error if the requested address is a valid workgroup.
The user must submit valid form data before joining the queue. Note that this error is sent when the user tries to join, or if the user submits form data that is not filled out correctly.
The user has already joined the queue.
The workgroup is valid but not accepting new join-queue requests.
The following protocol flows show an example of a user successfully joining a workgroup queue for firstname.lastname@example.org.
The following XML is another example where metadata is sent by the user to assist the workgroup server in queuing and routing (naturally, the custom namespace that qualifies the <crm/> element in this example would be defined outside the context of this specification).
Finally an example of a required form submission before a user is allowed to the workgroup queue for email@example.com. The data form in this example is trivial; please see XEP-0004 for a complete data form example. The example begins as normal, but the workgroup returns a <not-acceptable/> error.
The <not-acceptable/> error indicates that a data form is required. The user requests the required data form from the workgroup.
After presenting the form to the user and gathering the form data, the user submits the form data to the workgroup and the workgroup accepts it. The user is now in the queue.
This section describes the packet exchange allowing users to depart a workgroup service queue, or for a workgroup service to remove a user from the workgroup queue. This protocol MUST be supported by compliant implementations.
The user no longer wishes to be in the queue and issues a depart queue command.
The service notifies the user that they have been removed from the workgroup queue.
In the typical case, the sender is the user departing the queue. However, it is possible for other users (system administrators for example) to request that another user be removed from the queue. In this case, the jid of the user who is departing is included in the depart request:
It is expected that implementations will determine who is allowed to remove other users from the queue based on an implementation specific permissions model. These administrator depart requests may result in <not-authorized/> errors (see error section). A user removing their own queue entry MUST NOT receive unauthorized errors (the workgroup service MUST NOT prevent a user from departing the queue).
The sender of the depart request receives a successful result packet:
And the user who is departing receives a depart message (the user may not have been the sender of the request):
The user will not be in the queue after a response is received unless the error response code is <not-authorized/>.
This section describes the packet exchange for updating users on their queue status. This protocol MAY
be supported by compliant implementations.
The workgroup service pushes updates to the user as their queue status changes. Furthermore, the user may request their queue status at any time.
22.214.171.124 User Status Updates
User status updates are contained in a <queue-status/> element that updates the user on their queue position and estimated time. The position contained in a <position> sub-element is a non-negative integer indicating the number of queue entries that must be routed to an agent before the user is routed to an agent. A position of 0 (zero) indicates the user is currently being routed. Clients may use this information to display the current queue position to the user.
The queue time status is contained in a <time/> sub-element that updates the user with the estimated time until they will be routed to an agent. The time is a non-negative integer indicating the estimated number of seconds remaining before being routed. Services should send this update at regular intervals. We recommend every 15 seconds, but the best solution will depend on application dependent factors and the service may decide to send updates at any interval or never (relying on the client to request the information). User clients should assume the estimated time counts down at a rate of one per second between status updates. Clients may use this information to display the running estimated time to the user.
This section describes the packet exchange for inviting a queued user to a chat room for conversation with an agent. This protocol MUST be supported by compliant implementations.
The server sends an invitation to the user to begin their conversation with an agent, structured according to the format defined in XEP-0045. The 'from' attribute of the <invite/> element MUST be set to the JID of the workgroup. The invitation indicates that the user is no longer in the workgroup queue. The user MUST NOT receive any more user queue status updates once they receive an invitation.
126.96.36.199 Error Conditions
There are no defined error conditions for user invitations.
An invitation from the server on behalf of the firstname.lastname@example.org workgroup:
Agents join a workgroup to indicate they are capable of handling conversations with users. Agent membership in the workgroup is expected to be a long term, persistent relationship similar to roster membership. For example, a customer support agent may join the email@example.com workgroup when they begin working at example.com and will only depart when they leave that position. The wide variety of relationships, processes and permissions associated with joining and leaving workgroups lies outside the scope of this document.
Once an agent has joined a workgroup they will receive workgroup status updates to inform them of the status of other members of the workgroup. Agents are responsible for updating the workgroup service with their presence so the service can intelligently route chat requests to the 'best' agent. Workgroup agent presence uses standard XMPP presence packets with optional metadata to help routing of chat requests to agents. Some metadata will be standard and defined later in this document. It is expected that other deployment specific metadata will also be needed to make routing decisions.
The general agent workgroup state diagram is shown below:
Once an agent has joined a workgroup and is available, the agent will receive offers to chat with users by the workgroup service. Chat offers will be made to the agent and the agent has the opportunity to accept or reject each offer. The workgroup service may also revoke an offer. For example, a service may revoke chat offers if the offer is not responded to within a certain period of time to ensure fast responses to user chat requests.
Once an offer has been accepted, the agent must wait for a standard groupchat invitation from the workgroup service. The workgroup service may revoke the offer at this stage of the protocol as well. This enables workgroup services to send offers to several agents in parallel, and choose the 'best' agent that accepts. A diagram showing the agent workgroup sub-states and transitions is shown below:
This section describes the packet exchange allowing agents to update a workgroup with their current presence. This protocol MUST be supported by compliant implementations.
The agent must inform the workgroup of its presence by sending it a directed (not broadcast) presence update packet. Agent presence updates use standard XMPP presence with optional metadata. However, there must always be an agent-status workgroup sub-element in the presence packet to indicate that the presence update relates to agent workgroup presence. Agent workgroup presence is designed to allow a separation between the agent's normal XMPP presence (server-managed via rosters) and their presence with the workgroup.
Agent presence updates use standard XMPP presence packets and should contain the normal sub elements as needed (e.g. <show/>, <status/>, etc) and can be of type='unavailable' to indicate the agent is not available for workgroup routing or for receiving workgroup agent updates. The standard XMPP show states have specific meaning within the context of the workgroup protocol:
chat - Indicates the agent is available to chat (is idle and ready to handle more conversations).
away - The agent is busy (possibly with other chats). The agent may still be able to handle other chats but an offer rejection is likely.
xa - The agent is physically away from their terminal and should not have a chat routed to them.
dnd - The agent is busy and should not be disturbed. However, special case, or extreme urgency chats may still be offered to the agent although offer rejection or offer timeouts are highly likely.
Agents MAY also embed metadata to help the workgroup service route chat requests, using the <max-chats> element, which specifies the maximum number of chats the agent can handle. If a presence is sent to the workgroup that does not contain the max-chats value, the "default setting" will be assumed. The value of the default setting for an agent is up to an implementation. 
188.8.131.52 Error Conditions
There are no defined error conditions for presence updates.
An agent (alice) becomes available to the workgroup firstname.lastname@example.org.
<time> - The average time in seconds that a user is in the queue before they are routed to an agent for handling.
<status> - The status of the queue. Queues may be active (requests are being routed and handled by agents) but not accepting new requests for handling. Typical reasons for this state include the queue is shutting down but finishing processing users in the queue, or because the queue has too many requests and should not accept more request until the existing requests are handled. The status field MUST contain one of the following values:
open - the queue is active and accepting new chat requests
active - the queue is active but NOT accepting new chat requests
closed - the queue is NOT active and NOT accepting new chat requests
The <notify-queue-details/> element updates the agent with details of the workgroup queue. All fields are optional:
An update may contain one or more <user> entries (one per user in the queue). The defined sub-elements of <user> are:
<position> - The user's zero-based position in the queue.
<time> - Estimated time in seconds remaining before the user is routed to an agent.
<join-time> - The datetime when the user joined the queue (MUST conform to the DateTime profile defined in XEP-0082).
184.108.40.206 Error Conditions
There are no defined error conditions for workgroup queue status updates.
An agent receives an update from workgroup email@example.com.
This section describes the packet exchange used to update agents on the status of other agents in the workgroup. This protocol MAY be supported by compliant implementations.
The workgroup service pushes presence updates to the agent as the presence of other agents changes. This will only occur after an agent has requested to receive other agents' information. The server will continue to send presence updates until the agent sends an unavailable presence to the server. This protocol is similar to the standard XMPP roster workflow.
To receive presence updates for other agents in the workgroup, the agent sends an agent info request to the workgroup:
The workgroup will then reply with a list of all agents in the workgroup (excluding the agent making the request):
The server will then push presence packets for other agents as their presence changes. All fields in the <agent-status> child stanza are optional, but an <agent-status> child stanza must be present:
The defined sub-elements of <agent-status> are:
<current-chats> - The number of conversations currently being handled by the agent.
<max-chats> - The maximum number of simultaneous conversations the agent can handle.
220.127.116.11 Error Conditions
There are no defined error conditions for agent status updates.
This section describes the packet exchange involved in a service offering a chat to an agent. This protocol MUST be supported by compliant implementations.
The agent is offered a chat with a user. A successful offer results in the agent owning the offer, but does not mean it has accepted the chat. Accepting an offer is handled by the Agent Accept protocol. The separation between offer and acceptance is made so that agents may receive offers while engaged in other activities (busy with other chats) and accept them at a later time.
Application specific metadata will normally be added as a sub-element of <offer> to help agents decide whether to accept or not (formats for which are out of scope for this document). An optional <timeout> sub-element may be included indicating the amount of time the offer stands before the service will revoke it.
The agent may respond only with a successful result.
18.104.22.168 Error Conditions
There are no defined error conditions for an offer response.
An agent is offered a chat with a user. The offer will be revoked in 30 seconds.
The following is a more typical offer containing metadata about the user. The offer will be revoked in 30 seconds.
This section describes the packet exchange involved in a service revoking an offer to an agent to chat to a user. This protocol MUST be supported by compliant implementations.
The service revokes an earlier offer to chat to a user. Offer revocations typically occur when the original offer times out, or a better agent was found to handle the chat. Note that offer revocations may occur anytime after an offer has been made, and before an invitation is sent (see agent state diagram). In other words, even though an agent has accepted an offer to chat, the agent may still receive an offer revocation (e.g. a better agent was found to handle the chat).
The reason element may optionally contain free form text explaining the reason the offer was revoked.
The agent may respond only with a successful result.
22.214.171.124 Error Conditions
There are no defined error conditions for an offer response.
This section describes the packet exchange inviting an agent to a chat room for conversation with a user. This protocol MUST be supported by compliant implementations.
The server sends an invitation to the agent to begin their conversation with the user, structured according to the format defined in XEP-0045. The 'from' attribute of the <invite/> element MUST be set to the JID of the workgroup.
In order to match invitations to offers, all invitations SHOULD include metadata in the <offer/> element, with the JID of the user specified via the 'jid' attribute. The typical metadata fragment would appear as:
126.96.36.199 Error Conditions
There are no defined error conditions for agent invitations.
An invitation from the server on behalf of the firstname.lastname@example.org workgroup:
Service Discovery support is optional for Workgroup compliant implementations. Workgroup services that do support Service Discovery MUST:
Use the <identity> category='collaboration'.
Use the <identity> type='workgroup'.
Use the <feature> var='http://jabber.org/protocol/workgroup'.
An example of discovery browsing is included. Notice how probing starts at the server (example.com) revealing the workgroup service by its JID (workgroup.example.com) and a simple, human friendly name ("Example.com Live Assistant"). It is only during the discovery probing of the service that it is identified as a workgroup using the <identity> and <feature> tags. Finally individual workgroups (support and sales) can be discovered on the Workgroup service. When individual workgroups are probed, the <identity> and <feature> tags are again presented to identify them as workgroups along with (optional) associated metadata.
A workgroup is a normal XMPP messaging node and MUST maintain its own presence. It is recommended that a workgroup be able to respond to arbitrary chat messages sent to it (preferably by responding with instructions on how to join the queue). Other users may subscribe to the workgroup service's presence using standard XMPP presence-subscribe and presence-unsubscribe protocols. The workgroup service's presence can be used to determine the workgroup's status without joining the workgroup as a user or agent. For example, a website server-side component can subscribe to the workgroup presence and indicate on web pages whether a workgroup is available to offer live chat to website visitors.
If workgroup goes offline, all queued users SHOULD be notified using the appropriate workgroup presence, status, and depart protocols.
An implementation MAY support anonymous login by users, which makes it easier to deploy such a system on a website.
Generally, client authors only need to implement the "user" portion of this document so that clients can contact workgroups. Implementing the "agent" portion of the document is generally left to specialized clients for agents.
Coordination of groupchat and workgroup services is beyond the scope of this document. It is RECOMMENDED that implementations use or create standard mechanisms to allow workgroups and groupchat services to interact.
Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.
Disclaimer of Warranty
## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##
Limitation of Liability
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.
This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).
The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
5. The max-chats value sent from agent to workgroup service is a 'hint' or recommended value. The workgroup service is not obliged to accept this value. The actual max-chats value for the agent will be sent to the agent via the next Agent Status Update. This allows administrators to constrain agent behavior in order to enforce company policy, quality assurance, etc.
7. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
8. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.