Genesys Cloud - Main

 View Only

Sign Up

Expand all | Collapse all

Messaging - How Check If Agent Logged into Queue before sending to Queue?

  Thread closed by the administrator, not accepting new replies.
  • 1.  Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-27-2025 22:58
    Edited by Nick Horman 05-27-2025 22:59
    No replies, thread closed.

    Hi,

    I'm creating my first Messenger Flow in Architect. 

    I don't want to send a customer to a Queue if no agents are logged in and available to reply to the Message.

    Before sending to a Queue, how can I check (via a decision) if an Agent is logged into t/Active wihthin the Queue?

    Or is this done within the 'In Queue' flow design?

    Thanks!


    #ArchitectureandDesign

    ------------------------------
    Nick Horman
    Genesys Cloud Admin
    ------------------------------



  • 2.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-28-2025 07:48
    No replies, thread closed.

    Hello Nick, 

    This is done with during the in queue flow design. You might want to take a look at the task actions and see if you can build out some logic to see if any agents are on queue for the message or transfer to a queue where agents are. 



    ------------------------------
    Cameron
    Online Community Manager/Moderator
    ------------------------------



  • 3.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-28-2025 17:59
    Edited by Nick Horman 05-28-2025 17:59
    No replies, thread closed.

    Hey Cameron, thanks for the suggestion! 


    ------------------------------
    Nick Horman
    Genesys Cloud Admin
    ------------------------------



  • 4.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-28-2025 13:06
    No replies, thread closed.

    Hi Nick,

    Off the top of my head, you should be able to implement some logic within the flow to check for on queue members based on queueID. Then have routing options based on this?

    I have built similar logic for voice calls for our business - if you'd like I can try mock up the logic for a message flow to see if it looks right and share it with you tomorrow?



    ------------------------------
    Dale Wylie
    GCX-GCP
    Unified Communications Engineer
    ------------------------------



  • 5.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-28-2025 18:01
    No replies, thread closed.

    Hi Dale, 

    This sounds really dood!  With my lack of API knowledge, a solution like this would possibly be less complicated....

    Would very much appreciate if you have time to mock something up.

    Cheers!



    ------------------------------
    Nick Horman
    Genesys Cloud Admin
    ------------------------------



  • 6.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?
    Best Answer

    Posted 05-29-2025 05:47
    No replies, thread closed.

    Good morning Nick,

    As everyone is mentioning, you will have to use a Data Action. I will try talk you through it the best I can in steps below. Ill include some screenshots to supplement my attempt at being helpful! 

    • First, you need to create a "Data Action" using "Genesys Cloud Data Actions" and name it something relevant. i.e "GET Availability by QueueID" (Admin > Integrations > Actions - Then "Add Action" from the top right.)
    Once created, go into the newly created Data Action. You will have two tabs at the top: "Summary" and "Setup" - You don't need to do anything in Summary, so click "Setup".
    Here you will need to create the contract... You will see "Input Contract" and "Output Contract":
    • Within the "Input Contract" you should enter a title. I just entered the word "Input" as the title. The "Type" should remain as "object".
    • Under the Title box, press "Add Property" and Title is "queueId" be sure to change the "Type" to "string"
    • Now in the "Output Contract" I titled it "Results" again, leaving the "Type" as "object"
    • Under this Title box, again, press "Add Property" and Title is " Count" - You should set the "Type" to "integer" here.
    Now down the left, you should click "Configuration" - This is where we setup the API:
    • HTTP Method should be: POST
    • Request URL Template: /api/v2/analytics/queues/observations/query
    • You need to add two headers, in the first "Key" enter: Content-Type
    • In the "Value" field next to it, enter: application/json
    • Add a second header using the button below, in the "Key" enter: UserAgent
    • In the "Value" field next to it, enter: PureCloudIntegrations/1.0
    • Skip the "Execution Timeout"
    • In the request Body Template:
      • {
         "filter": {
          "type": "or",
          "predicates": [
           {
            "type": "dimension",
            "dimension": "queueId",
            "operator": "matches",
            "value": "${input.queueId}"
           }
          ]
         },
         "metrics": [
          "oOnQueueUsers"
         ]
        }
    • In the Response:
      • {
          "translationMap": {
            "totalArray": "$.results[0].data[?(@.metric=='oOnQueueUsers')].stats.count"
          },
          "translationMapDefaults": {
            "totalArray": "[]"
          },
          "successTemplate": "{\"Count\":${successTemplateUtils.firstFromArray(\"${totalArray}\",\"0\")}}"
        }
    That should be the Data Action finished! You can now click "Test" from the left hand side. You should see a field named whatever you named the Input Contract (In this case: queueId) - Find a queue ID to test with, paste the ID in the field and click "Run Test" - You should get an "Output" with the Result. We named the output "Count" in the contract and it will return an integer based on the amount of people "On Queue"
    Once confirmed, make sure you click the "Save & Publish" button at the bottom. Once published you will not be able to edit it so bare that in mind! It will not be ready to be called using "Call Data Action" within the flow. It should work for any channel.
    Please forgive the shoddy formatting of this, I hope it makes sense! Let me know how you get on and I will show try show an Inbound Message flow that calls the data action should you need!
    Cheers!


    ------------------------------
    Dale Wylie
    GCX-GCP
    Unified Communications Engineer
    ------------------------------



  • 7.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-29-2025 08:28
    No replies, thread closed.

    Thank you for the detailed walk-through, Dale! I especially like that Translation Map.



    ------------------------------
    George Ganahl GCCX-AI, GCP, GCSME, ICCE, ICHD, etc.
    Technical Adoption Champion
    Genesys
    ------------------------------



  • 8.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-29-2025 09:54
    No replies, thread closed.

    Thank you @George Ganahl! I wont pretend I wrote it all myself. I spent time on here and the internet to get the working initially, there are probably cleaner or easier ways, but it works well for me!

    Happy to be able to share some knowledge and I hope it is able to help @Nick Horman - If there are any issues I will try my best to assist!



    ------------------------------
    Dale Wylie
    GCX-GCP
    Unified Communications Engineer
    ------------------------------



  • 9.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-29-2025 18:10
    No replies, thread closed.

    Amazing Dale!  Thanks!  I'll give it a go.

    Very much appreciated.



    ------------------------------
    Nick Horman
    Genesys Cloud Admin
    ------------------------------



  • 10.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-29-2025 19:16
    Edited by Nick Horman 05-29-2025 19:25
    No replies, thread closed.
    Test
    Hey Dale,
    Almost!  I configured as per instructions but received the following error when running the test.
    Any thoughts?

    (Note: I don't want to take up too much of your time....If it looks like it is too complec to trouble-shoot, I'll chase up some internal resourcs that are familiar with API's).

    Cheers!


    ------------------------------
    Nick Horman
    Genesys Cloud Admin
    ------------------------------



  • 11.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-30-2025 01:07
    No replies, thread closed.

    UPDATE!  I managed to get it working.  Thanks everyone for comments.



    ------------------------------
    Nick Horman
    Genesys Cloud Admin
    ------------------------------



  • 12.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-30-2025 06:07
    No replies, thread closed.

    Sorry Nick! I in the the UK and I think you are in Australia so we are working on opposite time-zones! I actually remember getting the error you shown when I did it, and it was because for some reason the URL disappeared for the API. Was it the same for you?

    Happy to help though! Glad you managed to get it working - Does it seem OK? - Have you tried using it in a flow yet?



    ------------------------------
    Dale Wylie
    GCX-GCP
    Unified Communications Engineer
    Holcim UK (Formally Aggregate Industries UK)
    ------------------------------



  • 13.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 06-01-2025 20:37
    Edited by Nick Horman 06-01-2025 20:37
    No replies, thread closed.

    Hey Dale, no need to apologise mate! 

    One of the main issues was that I hadn't set up a Genesys Cloud Data Actions - Integration, which in turn affected the Action 'Type'.

    All good and thanks again for your help!



    ------------------------------
    Nick Horman
    Genesys Cloud Admin
    ------------------------------



  • 14.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-28-2025 15:30
    No replies, thread closed.

    Nick,

    You can create a Data Action to call the API to look for this information. If required, you can look for a count of Agents who are On Queue, On Queue and idle, On Queue with a particular skill / skill combination and so on. It really depends on exactly what you need. Then, in your Flow, you can call your Data Action to get the current state of affairs and make decisions accordingly.

    HTH



    ------------------------------
    Paul Simpson
    Views expressed are my own and do not necessarily reflect those of my employer.
    ------------------------------



  • 15.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-28-2025 18:39
    No replies, thread closed.

    Hi, Nick...lots of folks have done similar, but one thing you need to narrow down is exactly what your criteria are...no matter what, it will require using a data action to call the API.

    For example, some folks just want to know how many agents associated with a queue are logged in. That's one API endpoint.

    Some folks want to know how many agents are logged in and On Queue, which is a different API endpoint.

    Some folks want logged in, with a Routing Status of IDLE (meaning immediately able to take a new interaction)...

    I tend to look for agents On Queue, since they can change Routing Status at any time (or go Off Queue...but that's a risk you have to take). Don't get over-complicated. Then set up the In-Queue flow to overflow to a back-up queue if a message sits in it for too long (whatever you determine to be too long) if you so desire.

    The other key is to make sure you use WFM to calculate the staffing needed for the queues to match forecasted demand, and watch shrinkage/adherence throughout the day.

    Probably Too Much Information....



    ------------------------------
    George Ganahl GCCX-AI, GCP, GCSME, ICCE, ICHD, etc.
    Technical Adoption Champion
    Genesys
    ------------------------------



  • 16.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-28-2025 18:50
      |   view attached
    No replies, thread closed.

    In case anyone is interested, here's a data action that takes a queueId as input and outputs parallel arrays with a count of agents for each Routing Status found.

    e.g.,



    ------------------------------
    George Ganahl GCCX-AI, GCP, GCSME, ICCE, ICHD, etc.
    Technical Adoption Champion
    Genesys
    ------------------------------

    Attachment(s)



  • 17.  RE: Messaging - How Check If Agent Logged into Queue before sending to Queue?

    Posted 05-28-2025 18:52
    No replies, thread closed.

    You can have a Collection variable to take the output of each array and get the values, sum them or do whatever in an Architect flow



    ------------------------------
    George Ganahl GCCX-AI, GCP, GCSME, ICCE, ICHD, etc.
    Technical Adoption Champion
    Genesys
    ------------------------------