Four reasons why Advanced Work Assignment (AWA) is not working the way you expect Advanced Work Assignment (AWA) can be intimidating. At first glance, it seems like it will solve a common problem you have: I need to route work autonomously to serve a need. In practice, it's not as simple as installing & it working the way you felt you were promised. This article is to help explain common problems you may run into, why you're experiencing that problem & empower you with the knowledge to fix it for your use case. Here are reasons why AWA isn't working the way you hoped. Immediately below is a quick reference: document = record on table which a Service Channel is configured i.e. out-of-the-box comes with a "Chat" Service Channel. The document for this Service Channel are records on interaction table. AWA agent = user on sys_user table AWA performs the routing, AWA agent is just a user who is receiving a Work Item via AWA 1. AWA isn't creating Work Items AWA doesn't create Work Items when you expect it to. This is the 1st step of AWA so if this doesn't happen, it will never get assigned. What is a Work Item? It's a record on awa_work_item table. This is a wrapper record that AWA creates when a document(record on table) matches for a given Service Channel(awa_service_channel). Think of it as an envelope for a package(your incident, interaction, sn_customserservice_case, sn_hr_core_case record) you're sending & the envelope is required for the shipping partner(in this case, AWA) to route your package. How do Work Items get created? Simply put, Service Channel condition + Queue condition match document. How does the instance monitor documents for Work Item creation? sys_rw_action table. This is the table for Record Watchers, a product built on our web socket framework AMB(Asynchronous Message Bus). AMB is reused in other areas of the platform, it's the reason you see someone looking at the same record as you, that's the same web socket at work. This table has 2 types of records designated for AWA: awa-eligibility-responder & awa-workload-responder. We'll discuss awa-eligibility-responder for now & awa-workload-responder later. awa-eligibility-responder This is responsible for monitoring which documents match a Service Channel Once a Service Channel is matched, AWA tries to find a Queue condition match in that Service ChannelIt will keep trying 10 minutes from the last update to the record For example, if your Work Item wasn't created because the Queue condition wasn't set properly, you can update any field on the record & AWA will try again10 minutes is the default, togglable via com.glide.awa.routinglookback System Property Context field is JSON that contains the sys_id of the awa_service_channel record in questionCondition field is the Work item routing condition + Sys ID [ is not ] NULL Sys ID [ is not ] NULL is the same as Sys ID [ is not empty ] Only focus on the record where Table field = document table, which is the table which the Service Channel is configured for How to verify when a Work Item is created? You can view this on awa_work_item table. Document ID field is the sys_id of the document. 2. AWA isn't assigning Work Items Now that the Work Item is created, for some reason, the same Work Item doesn't get assigned. Why aren't Work Items getting assigned? AWA requires 2 things to assign to an agent: Eligible agent(s)Available agent(s) What is a eligible agent? A user that is in the group the Queue is configured for. This starts with the Eligibility Pool(awa_eligibility_pool) record where the group mapping is there. So it's Queue(awa_queue) » Eligibility Pool(awa_eligibility_pool) » Group(sys_user_group) » Group Members(sys_user_grmember). How can I verify which agents are eligible? Navigating through the tables immediately above, you can find which sys_user_grmember records where the User is active. Of that group of users, those are eligible to receive assignment when in Available status. What is a available agent? A user whose status is Available on the Agent inbox page. Agent inbox page is configured in CSM(Customer Service Management), SOW(Service Operations Workspace) & HR(Human Resources) Agent workspaces by default, see the inbox icon on the left sidebar. When an agent updates their status, it modifies a corresponding awa_agent_presence record where this can be monitored. How can I verify which agents were Available & when? awa_agent_presence_history table. It logs every change to an AWA agent's presence. The way I figure out who was available when is by using this criteria Created [ on ] _EXPECTED_WORK_ITEM_ASSIGNMENT_DAY_ _EXPECTED_WORK_ITEM_ASSIGNMENT_DAY_: This will be whatever day you expected the Work Item to be assigned Created [ at or before ] _EXPECTED_WORK_ITEM_ASSIGNMENT_DATE_ _EXPECTED_WORK_ITEM_ASSIGNMENT_DATE_: This will be the exact time that Work Item assignment should have happenedAWA does this to get all of the presence state changes for all agents before assignment to see who was in Available status Available Channels [ contains ] _AWA_SERVICE_CHANNEL_IN_QUESTION_ OR Available Channels [ is empty ] _AWA_SERVICE_CHANNEL_IN_QUESTION_: This is the Service Channel mapped to the Queue where the Work Item was createdWhen a record on this table has no value in Available Channels(is empty), that presence state can't receive assignment 1st half of the OR will show us when they were Available, 2nd half will show when they weren't Add Sort » Created [ a-z ] Sort each presence state change chronologically to know the last status of each agent before assignment Group by » Agent Bucket each agent for readability How can I combine the eligible & available agents in 1 spot? Take the group(s) that were eligible for assignment & combine it with the awa_agent_presence_history query above. Based on your configuration & the assignment outcome, you may need to get the awa_queue record you expected to have the Work Item created. Once you have that, you need to traverse through each eligibility pool record to get all applicable groups. Reminder that the traversing path is Queue(awa_queue) » Eligibility Pool(awa_eligibility_pool) » Group(sys_user_group) » Group Members(sys_user_grmember). There's a background script below to help get these agents. In the applicableGroups variable, put the sys_user_group sys_id of each group that corresponds to awa_eligibility_pool for that Queue at the time of expected assignment. var applicableGroups = [ '_SYS_USER_GROUP_SYS_ID_1_', // '_SYS_USER_GROUP_SYS_ID_2_', // '_SYS_USER_GROUP_SYS_ID_3_' ]; var getApplicableAWAAgents = new GlideAggregate('sys_user_grmember'); getApplicableAWAAgents.addQuery('group', 'IN', applicableGroups.join()); getApplicableAWAAgents.groupBy('user'); getApplicableAWAAgents.query(); var applicableAWAAgents = []; while (getApplicableAWAAgents.next()) applicableAWAAgents.push(getApplicableAWAAgents.getValue('user')); gs.print( '\n\n'+ '--- » Applicable AWA agent sys_ids « ---\n\n'+ 'Copy & paste these into Agent [ is one of ] filter on awa_agent_presence_history)\n\n'+ applicableAWAAgents.join('\n') ); Follow the instructions in the output so your awa_agent_presence_history query only filters through eligible agents for the AWA Queue in question. 3. AWA assigned to agent A instead of agent B This goes into AWA capacity/workload & AWA eligibility. Workload = Capacity in Use on awa_agent_capacity table. Eligibility means "is the agent part of the group mapped to the Queue where the Work Item was created?" As soon as the Work Item has been created, AWA will try to assign it to an eligible & available agent. Eligibility is determined by your awa_eligibility_pool record configured on the awa_queue record where the Work Item was created from. Remember, the Work Item needed a Queue to be created, this Queue needs a awa_eligibility_pool record mapped to it. awa_eligibility_pool has reference fields to awa_assignment_rule & sys_user_group tables to determine how assignment is configured. awa_eligibility_pool Time after Work Item creation that it can be assigned This is usually set to 0 so that Work Items are assigned as soon as possible https://www.servicenow.com/docs/r/conversational-interfaces/advanced-work-assignment/awa-specify-assignment-eligibility.html awa_assignment_rule Which order AWA will decide to assign available agentshttps://www.servicenow.com/docs/r/servicenow-platform/advanced-work-assignment/awa-assignment-rules.html sys_user_group Which users are able to receive the Work Item in question Work items from all service channels are considered for assignment one at a time, with the consideration order being determined first by queue (lower-ordered queues first), and then by work item sort order within the queue. If group queue priorities vary between groups and queues, the unassigned items of each queue may be looped through multiple times, with a progressively more inclusive of groups considered each time, so that each group is most likely to be assigned items from its most-prioritized queues.For each particular work item as it is being considered, the following criteria are used, in the order below, to pick a top agent from each eligibility pool once those without capacity / skills / etc are filtered out: Last reassignable rejection (agents who have not already rejected the item are first to be considered)Highest group queue priority (agents belonging to a group with a higher group queue priority for the item's queue are considered earlier)Highest affinity order (agents determined to have a higher affinity score for an item)Most affinity matching count (agents who matched the most affinity rules for an item )Least skill level gap (agents with a lower difference between their own skill levels and the skill levels assigned to the item will be considered earlier)Time in shift (agents with the most or least time left in shift, depending on the configuration)These last two are evaluated depending on the Assignment rule's "Assign by" settings: Agents with higher capacityagents who have been assigned an item less recently After a top agent is chosen from each eligibility pool, the criteria below are again used as a tiebreaker between those agents: Last reassignable rejection (agents who have not already rejected the item are first to be considered)Highest group queue priority (agents belonging to a group with a higher group queue priority for the item's queue are considered earlier)Highest affinity order (agents determined to have a higher affinity score for an item)Most affinity matching count (agents who matched the most affinity rules for an item )Least skill level gap (agents with a lower difference between their own skill levels and the skill levels assigned to the item will be considered earlier) 4. AWA is assigning beyond configured agent's capacity How does AWA calculate capacity? This goes back to awa-workload-responder. See section "How does the instance monitor documents for Work Item creation?" awa-workload-responder This is responsible for calculating capacity for agentsCondition field is Utilization condition on Service Channel in question(see Context field) + Assigned to [ is not ] NULL Assigned to [ is not ] NULL is the same as Assigned to [ is not empty ] Context field applies the same as awa-eligibility-responder. It's JSON containing the sys_id of the Service Channel in questionThere should be 2 records per Service Channel: 1 for awa_work_item & 1 for the configured Service Channel table awa_work_item: When a Work Item is offered to an agent, it's status is changed to Pending Accept This is only if you have auto-accept unchecked, togglable on the Assignment ruleWhen this happens, AWA monitors records that match this query to know when to timeout the Work Item if it wasn't accepted in time(also configured on the Assignment rule) configured Service Channel table, we'll use interaction as an example This monitors records on this table to calculate capacityRecords matching this query are counted by AWA via Assigned to field value This counter is how AWA calculates an agent's capacity You're probably wondering, "if we have a table for history of agent presence in awa_agent_presence_history, why don't we have the same for agent capacity?" This type of table doesn't come out-of-the-box because AWA needs to be as performant as possible. It's doing a lot under the hood so it caches as much as possible. Even if this was built, it wouldn't be a true measure of what capacity was calculated as in that moment & thus it hasn't been implemented. How can I check if an agent was truthfully assigned beyond configured capacity? This is very hard to answer. There are a lot of reasons something can be configured improperly than properly, Murphy's law is definitely in play here. Here are reasons you may find an AWA agent with higher Capacity in Use than Max Capacity on awa_agent_capacity and/or awa_agent_universal_capacity: Manual assignment See section about awa-workload-responder discussuing capacity being tracked by a Service Channel's Utilization condition. This is agnostic to who assigned it, meaning, a user can manually assign a document that increases their capacity in the same way AWA assignment increases capacity.AWA is designed to respect capacity so that it doesn't assign beyond Max Capacity on awa_agent_capacity for the agent in question Duplicate Service Channel conditions awa_document_size table is responsible for calculating Work Item Size field value on awa_work_item Capacity in Use on awa_agent_capacity will increase by Work Item Size field value when assigned to an agentIt doesn't care about AWA Queues. It only cares about the Service Channel, the document & Size field values based on the Service Channel configuration Work Item Sizing(awa_work_item_sizing) records are associated to Service Channels & determine when a document should have different Work Item Size than Default work item size field on Service Channel Why does this matter? A Work Item can be created, assigned & then become ineligible for a Service Channel when configured improperly. i.e. State = New on Service Channel but when it's assigned, it automatically changes State = Work In ProgressWhen this happens, the Work Item is still assigned but corresponding awa_document_size has Assigned to field value cleared Since AWA uses awa_document_size table to calculate capacity along with awa-workload-responder, it can cause stale capacity readsWhen stale capacity reads happen, Work Items are assigned unexpectedly