Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Workforce Management Real-Time Adherence


The Workforce Management Real-Time Adherence Feed (WFM RTA Feed) is designed for partners to monitor and report on the activity of agents within a Flex contact center. Events from this feed can be used to generate a real-time snapshot of agent status.

TaskRouter events model the core activity of the agents within a Flex application. The RTA Feed interprets and reformats these TaskRouter events so that they can be used to monitor real-time adherence. Each event contains a JSON-formatted message to represent the status of an agent.

Events from the RTA Feed are sent securely as HTTPS requests to a registered URL. Please note that unencrypted HTTP protocol is no longer supported.

(warning)

Warning

A busy Flex application will generate a large volume of events at a frequent rate. Keep this in mind when considering how your application will scale.


Event Trigger

event-trigger page anchor

Each event represents the real-time status of an agent. The status of an agent is the combination of their activity and any tasks they are handling. The tasks that agents are handling are represented as reservations because this is binding between the task and the agent. These entities are the same as what you would see if you subscribed to the TaskRouter Events Feed.

Example Event:


_44
{
_44
"product": "Flex",
_44
"object": "WFMWorkerChange",
_44
"version": 1,
_44
"records": [
_44
{
_44
"worker": {
_44
"sid": "WKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"activity_sid": "WAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"activity_name": "Available",
_44
"date_activity_updated": "2021-06-06T11:06:10.268Z"
_44
},
_44
"channels": [
_44
{
_44
"reservations": [
_44
{
_44
"sid": "WRxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"status": "created",
_44
"workflow_sid": "WWxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"task_sid": "WTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"task_queue_sid": "WQxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"task_assignment_status": "reserved",
_44
"date_created": "2021-06-06T11:09:09.240Z",
_44
"date_updated": "2021-06-06T11:09:09.240Z",
_44
"date_reservation_status_updated": "2021-06-06T11:09:09.240Z",
_44
"direction": "inbound"
_44
}
_44
],
_44
"worker_channel_sid": null,
_44
"task_channel_sid": "TCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"task_channel_name": "voice",
_44
"available": 1,
_44
"available_capacity": 0,
_44
"capacity": 1,
_44
"date_capacity_updated": null
_44
}
_44
],
_44
"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"workspace_sid": "WSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"last_processed_event_sid": "EVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"date_last_processed_event": "2021-06-06T11:09:09.240Z"
_44
}
_44
]
_44
}

With the TaskRouter Events Feed, every single action and update within Flex generates a new event: a task is created, an agent changes their status, a task is routed to an agent, a task is completed, etc. The details contained within that event are specific to whatever happened, and they don't contain any other context. For example, a task.completed event will tell you which agent finished a task, but it won't tell you how many additional tasks that agent might still be handling.

In comparison, an event from the RTA Feed tells you everything you need to know about a single agent. An event is triggered whenever something about an agent changes. For example, an event would be triggered when an agent receives or finishes a task. However, no events would be triggered when a task is created but hasn't yet been assigned anywhere.

If multiple changes happen simultaneously, the RTA Feed sends a single event with the latest information following the simultaneous updates. This means that the RTA Feed may not provide the exact timestamp of all the changes within Flex. Sometimes, short-lived changes are collated with subsequent events instead of being sent as individual events. If you need an accurate timestamp of all changes, use TaskRouter Events.

TaskRouter events that trigger an RTA Feed update

taskrouter-events-that-trigger-an-rta-feed-update page anchor

These TaskRouter events may trigger an update to the RTA Feed:

  • worker.created → a new worker was created
  • worker.deleted → a worker was deleted
  • worker.capacity.update → the capacity setting for a worker was updated
  • worker.activity.update → a worker's activity was updated
  • reservation.created → a new reservation has been created for a worker (i.e., a task was assigned)
  • reservation.accepted → a reservation was accepted by a worker
  • reservation.canceled → a reservation was canceled
  • reservation.rescinded → a reservation was rescinded
  • reservation.rejected → a reservation was rejected
  • reservation.timeout → a reservation timed out
  • reservation.wrapup → a reservation moved into wrap-up

Our documentation on the Lifecycle of a Task provides more detail on these task states and assignment.


An event will take the following form:


_10
{
_10
"product": "Flex",
_10
"object": "WFMWorkerChange",
_10
"version": 1,
_10
"records": [
_10
<recordObject1>,
_10
<recordObject2>,
_10
...
_10
]
_10
}

This is the standard wrapper for the event. product, object, and version will be the same for each event you receive.

records will contain a list of event records, documented below. Most fields that are documented below may return null values. This often happens when the RTA Feed is processing events for an agent it hasn't seen before. Over time as the agent triggers more events, there will be fewer null values. When designing a system to process these records, you should ensure that you respond appropriately to null values.

Each record represents the status of a particular agent. a recordObject will take the following form:


_12
{
_12
"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_12
"workspace_sid": "WSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_12
"last_processed_event_sid": "EVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_12
"date_last_processed_event": "2021-06-06T11:09:09.240Z",
_12
"worker": <workerObject>,
_12
"channels": [
_12
<channelObject1>,
_12
<channelObject2>,
_12
...
_12
]
_12
}

  • account_sid - The AccountSid for the Flex application generating events
  • workspace_sid - The TaskRouter Workspace containing the Flex activity
  • last_processed_event_sid - A unique identifier for the RTA feed record
  • date_last_processed_event - A timestamp for when the event data was generated
  • worker - An object that describes which TaskRouter Worker this record relates to
  • channels - An array of channelObjects , each communicating whether the agent is handling tasks on a particular channel. If channels is null , this means the agent has no active tasks.

The workerObject describes which TaskRouter Worker this RTA feed record relates to.


_10
{
_10
"sid": "WKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_10
"activity_sid": "WAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_10
"activity_name": "Available",
_10
"date_activity_updated": "2021-06-06T11:06:10.268Z"
_10
}

  • sid - The TaskRouter WorkerSid associated with this agent
  • activity_sid - The TaskRouter ActivitySid for the agent's current activity
  • activity_name - The friendly name for the agent's current activity. Common values are "Offline", "Available", and "Unavailable". Each Flex application may customize this list to include custom values.
  • date_activity_update - A timestamp for when the agent switched into their current activity

The tasks an agent is handling are segmented by the channel of the task, like "voice" or "sms". Each channelObject represents one channel. It's possible for the channels array to be null and not contain any channelObjects. This situation may happen when the RTA Feed processes the first event for a new agent, and this event does not contain any channel information. If channels is null, then it should be interpreted that the agent has no active tasks.


_14
{
_14
"worker_channel_sid": "WCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_14
"task_channel_sid": "TCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_14
"task_channel_name": "voice",
_14
"available": 1,
_14
"available_capacity": 100,
_14
"capacity": 1,
_14
"date_capacity_updated": "2021-06-06T11:06:10.268Z",
_14
"reservations": [
_14
<reservationObject1>,
_14
<reservationObject2>,
_14
...
_14
]
_14
}

  • worker_channel_sid - The TaskRouter WorkerChannelSid which identifies the resource. The WorkerChannel is the entity that maps an agent's capacity and availability for a particular TaskChannel.
  • task_channel_sid - The TaskRouter TaskChannelSid for this channel
  • task_channel_name - The friendly name of this channel. Common values are "voice", "chat", and "sms". Each Flex application may customize this list to include custom values.
  • available - Whether the worker will receive tasks of this channel type. 1 indicates they will. 0 indicates they won't.
  • available_capacity - The current percentage of capacity the TaskChannel has available. Can be a number between 0 and 100 . A value of 0 indicates that TaskChannel has no capacity available and a value of 100 means the Worker is available to receive any Tasks of this TaskChannel type.
  • capacity - The number of tasks of this channel that the agent is configured to handle simultaneously. TaskRouter will not create any reservations after the assigned Tasks for the Worker reaches the value.
  • date_capacity_updated - A timestamp for when the agent's configured capacity was last updated for this channel
  • reservations - An array of reservationObjects , each communicating the state and details of individual tasks the agent is handling. If reservations is null , this means the agent has no active tasks on this channel.

Each active task that an agent is handling is represented as a reservation. Details on reservations can be found in our TaskRouter documentation. It is common for the reservations array to be null. This means that the agent is not handling any tasks on that particular channel.


_12
{
_12
"sid": "WRxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_12
"status": "created",
_12
"workflow_sid": "WWxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_12
"task_sid": "WTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_12
"task_queue_sid": "WQxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_12
"task_assignment_status": "reserved",
_12
"date_created": "2021-06-06T11:09:09.240Z",
_12
"date_updated": "2021-06-06T11:09:09.240Z",
_12
"date_reservation_status_updated": "2021-06-06T11:09:09.240Z",
_12
"direction": "inbound"
_12
}

  • sid - The unique identifier for the TaskRouter Reservation
  • status - The status of the agent's reservation. Possible values are accepted, canceled, completed, pending, rejected, rescinded, timeout, wrapping. Details on these statuses are in our Reservation documentation .
  • workflow_sid - The TaskRouter WorkflowSid for the workflow that routed this particular task
  • task_sid - The TaskSid associated with this task
  • task_queue_sid - A unique identifier for the TaskRouter TaskQueue that the task is part of
  • task_assignment_status - The status of the task. Possible values are pending, reserved, assigned, canceled, wrapping, and completed. Details on these statuses are in our Task Lifecycle documentation.
  • date_created - The timestamp for when this reservation was created. This indicates the amount of time that the task has been assigned to this agent.
  • date_updated - The timestamp for the last time the reservation's status was updated
  • date_reservation_status_updated - The timestamp for the last time the reservation's status was updated
  • direction - The direction of the task. inbound or outbound .

Agent is offline and not handling any tasks

agent-is-offline-and-not-handling-any-tasks page anchor

_20
{
_20
"product": "Flex",
_20
"object": "WFMWorkerChange",
_20
"version": 1,
_20
"records": [
_20
{
_20
"worker": {
_20
"sid": "WKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_20
"activity_sid": "WAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_20
"activity_name": "Offline",
_20
"date_activity_updated": "2021-06-06T10:51:19.778Z"
_20
},
_20
"channels": null,
_20
"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_20
"workspace_sid": "WSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_20
"last_processed_event_sid": "EVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_20
"date_last_processed_event": "2021-06-06T10:52:04.383Z"
_20
}
_20
]
_20
}

Agent is Available and handling one voice call

agent-is-available-and-handling-one-voice-call page anchor

_44
{
_44
"product": "Flex",
_44
"object": "WFMWorkerChange",
_44
"version": 1,
_44
"records": [
_44
{
_44
"worker": {
_44
"sid": "WKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"activity_sid": "WAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"activity_name": "Available",
_44
"date_activity_updated": "2021-06-06T11:06:10.268Z"
_44
},
_44
"channels": [
_44
{
_44
"reservations": [
_44
{
_44
"sid": "WRxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"status": "accepted",
_44
"workflow_sid": "WWxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"task_sid": "WTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"task_queue_sid": "WQxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"task_assignment_status": "assigned",
_44
"date_created": "2021-06-06T11:09:09.240Z",
_44
"date_updated": "2021-06-06T11:10:00.561Z",
_44
"date_reservation_status_updated": "2021-06-06T11:10:00.561Z",
_44
"direction": "inbound"
_44
}
_44
],
_44
"worker_channel_sid": null,
_44
"task_channel_sid": "TCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"task_channel_name": "voice",
_44
"available": 1,
_44
"available_capacity": 0,
_44
"capacity": 1,
_44
"date_capacity_updated": null
_44
}
_44
],
_44
"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"workspace_sid": "WSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"last_processed_event_sid": "EVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_44
"date_last_processed_event": "2021-06-06T11:10:00.561Z"
_44
}
_44
]
_44
}

Agent is Available and multitasking

agent-is-available-and-multitasking page anchor

_65
{
_65
"product": "Flex",
_65
"object": "WFMWorkerChange",
_65
"version": 1,
_65
"records": [
_65
{
_65
"worker": {
_65
"sid": "WKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"activity_sid": "WAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"activity_name": "Available",
_65
"date_activity_updated": "2021-06-06T11:06:10.268Z"
_65
},
_65
"channels": [
_65
{
_65
"reservations": [
_65
{
_65
"sid": "WRxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"status": "accepted",
_65
"workflow_sid": "WWxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"task_sid": "WTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"task_queue_sid": "WQxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"task_assignment_status": "assigned",
_65
"date_created": "2021-06-06T12:26:09.602Z",
_65
"date_updated": "2021-06-06T12:26:18.104Z",
_65
"date_reservation_status_updated": "2021-06-06T12:26:18.104Z"
_65
}
_65
],
_65
"worker_channel_sid": null,
_65
"task_channel_sid": "TCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"task_channel_name": "voice",
_65
"available": 1,
_65
"available_capacity": 0,
_65
"capacity": 1,
_65
"date_capacity_updated": null
_65
},
_65
{
_65
"reservations": [
_65
{
_65
"sid": "WRxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"status": "accepted",
_65
"workflow_sid": "WWxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"task_sid": "WTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"task_queue_sid": "WQxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"task_assignment_status": "assigned",
_65
"date_created": "2021-06-06T11:44:31.924Z",
_65
"date_updated": "2021-06-06T11:44:42.262Z",
_65
"date_reservation_status_updated": "2021-06-06T11:44:42.262Z"
_65
}
_65
],
_65
"worker_channel_sid": null,
_65
"task_channel_sid": "TCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"task_channel_name": "chat",
_65
"available": 1,
_65
"available_capacity": 75,
_65
"capacity": 4,
_65
"date_capacity_updated": null
_65
}
_65
],
_65
"account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"workspace_sid": "WSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"last_processed_event_sid": "EVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_65
"date_last_processed_event": "2021-06-06T12:26:18.104Z"
_65
}
_65
]
_65
}


Rate this page: