Genesys Cloud - Developer Community!

 View Only

Sign Up

Expand all | Collapse all

Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

  • 1.  Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 04-15-2025 19:57
      |   view attached

    Here is the challenge we are facing and need your help: 

    We created a trigger for the following event: v2.users.{id}.workforcemanagement.notifications, data format: json. The workflow that is triggered by this event has some custom logic on how to handle Time Off requests. 

    The problem we're encountering is that as soon as the workflow is triggered, the workflow is triggered more than once, and the event body has always the same "id" and "timestamp" and different "mutableGroupId". We have performed a few tests for the topic v2.users.{id}.workforcemanagement.notifications:

    • Subscribing to the event via the Developer Notification tool (Web Socket) 
    • Trigger Workflow via Process Automation
    What we found during these tests is:  when the agent submitted a Time-off request, there was only one event on the Developer Notification and at the same time, there were 10 events via Process Automation. Each event via Process Automation differed only by mutualGroupId. Here are the screenshots and event details for both of our tests so you can see the difference in the events.

    Can you please advise on what is mutableGroupId used in WFM events? Why there is a difference for the same event between Developer's Notification and Process Automation ?


    #Triggers

    ------------------------------
    Tatjana Knezevic

    www.startelecom.cloud

    https://www.linkedin.com/company/star-telecom-www-startelecom-ca-/
    ------------------------------

    Attachment(s)

    zip
    WFM_Notifications.zip   2 KB 1 version


  • 2.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 04-17-2025 09:42

    Without getting too far into the weeds, wfm notifications are stored in "groups", with a mutable group id. Any time anything changes for any notification within that "group", the mutable group ID is changed for all of the notifications in the group. It can be viewed as a kind of a version for those notifications, and the latest mutableGroupId is needed for PATCH calls to mark individual notifications as read/unread. This is why changing or adding a notification results in updates to multiple other notifications.



    ------------------------------
    Brian Trezise
    Lead Software Engineer
    ------------------------------



  • 3.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 04-21-2025 11:42

    @Brian Trezise

    Thank you!

    The description for the topic v2.users.{id}.workforcemanagement.notifications  is "Notification that a user's wfm inbox has a new message

    We understood this as you explained, and we noticed the difference in mutableGroupId for the events emitted when the user submits time-off notifications in Process Automation. At the same time, the same topic had only one event in Developer notifications (Web Socket). 

    Are there any APIs from which we can get the details about the WFM notification groups? 



    ------------------------------
    Tatjana Knezevic

    www.startelecom.cloud

    https://www.linkedin.com/company/star-telecom-www-startelecom-ca-/
    ------------------------------



  • 4.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 04-21-2025 13:29

    There is an API route to get notifications for the current logged in user (getting notifications for any user other than the currently logged in user is not possible via the api):

    GET /api/v2/workforcemanagement/notifications

    This route here is related, for marking a notification read or unread

    POST /api/v2/workforcemanagement/notifications/update



    ------------------------------
    Brian Trezise
    Genesys - Employees - Lead Software Engineer
    ------------------------------



  • 5.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 04-21-2025 14:24

    Hi @Brian Trezise,

    I've tried that API previously, and it is very limited . First, it requires user context i.e. it cannot be invoked from a Workflow, and it also returns the same mutableGroupId for the logged-in user (via implicit grant). Here is the excerpt from the API response on mutableGroupId attribute, and you can see that there are multiple instances of it: 



    ------------------------------
    Tatjana Knezevic

    www.startelecom.cloud

    https://www.linkedin.com/company/star-telecom-www-startelecom-ca-/
    ------------------------------



  • 6.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 04-21-2025 15:07

    That is intentional. The notification topic was never intended to be invoked from a workflow, as it is solely intended to be used to populate the "inbox" of the logged in user. The topic itself goes hand-in-hand with the api routes I mentioned, they're the two halves of the same feature.

    Perhaps if you can tell me more about what you're trying to accomplish I could point you at some better topics/apis to accomplish your goals?



    ------------------------------
    Brian Trezise
    Genesys - Employees - Lead Software Engineer
    ------------------------------



  • 7.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 04-21-2025 16:03

    Did you see the question related to the difference in the events, JSON files provided in my original post? 



    ------------------------------
    Tatjana Knezevic

    www.startelecom.cloud

    https://www.linkedin.com/company/star-telecom-www-startelecom-ca-/
    ------------------------------



  • 8.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId
    Best Answer

    Posted 04-21-2025 16:10

    Yes. Mutable group ID is different, and additional notifications where added under otherNotificationIdsInGroup, which is expected when new notifications are added for that user (until the "group" is full), as per my initial response.

    This topic was not intended to be used for workflows. Can you explain further what you're trying to accomplish?



    ------------------------------
    Brian Trezise
    Genesys - Employees - Lead Software Engineer
    ------------------------------



  • 9.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 04-21-2025 16:25

    Hi Brian,

    I just wanted to let you know that I would park this for now, since the topic is not intended for workflow. The use case we were trying to solve was too premature for what we currently have available.  We'll continue to monitor new topics for the workforcemanagement for the Process Automation. 

    Thank you for getting back to me so quickly. 



    ------------------------------
    Tatjana Knezevic

    www.startelecom.cloud

    https://www.linkedin.com/company/star-telecom-www-startelecom-ca-/
    ------------------------------



  • 10.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 04-21-2025 16:35

    If you let me know what you're trying to solve I can try to help. Otherwise, we do have an ideas portal where you can enter your use case and what you need to accomplish it.

     
    Genesys Cloud Ideas Portal



    ------------------------------
    Brian Trezise
    Genesys - Employees - Lead Software Engineer
    ------------------------------



  • 11.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 05-15-2025 16:28

    We are trying to achieve a result similar to Tatjana's. We're trying to send an email notification when an agent has submitted a Time-off Request. Some of our upper leadership and team managers aren't always in Genesys Cloud, and so having an email notification is a feature they had before we used Genesys WFM and would like to have back. If this wasn't intended to be used in WorkFlows, why would it be a topic in Triggers that call a WorkFlow?



    ------------------------------
    Izeck McRae
    Product Manager 2
    The Church of Jesus Christ of Latter-day Saints
    ------------------------------



  • 12.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 05-16-2025 13:29

    Hi @Izeck McRae,

    Agree with your comment regarding available topics. We learned as soon as we started implementing that this topic should not be used to trigger Workflows. Unfortunately, Brian confirmed it and suggested opening the idea. 

    Thanks,



    ------------------------------
    Tatjana Knezevic

    www.startelecom.cloud

    https://www.linkedin.com/company/star-telecom-www-startelecom-ca-/
    ------------------------------



  • 13.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 05-16-2025 13:32

    I don't have a great answer to your question but it sounds like this topic might be a better fit for your needs?

    v2.users.{id}.workforcemanagement.timeoffrequests



    ------------------------------
    Brian Trezise
    Genesys - Employees - Lead Software Engineer
    ------------------------------



  • 14.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 05-16-2025 13:37

    I had originally tried that one, but my findings of that topic are for only when the request is updated (either denied or approved). The initial submission of the timeoff request doesn't initiate a trigger. I may be looking at it wrong though.



    ------------------------------
    Izeck McRae
    Product Manager 2
    The Church of Jesus Christ of Latter-day Saints
    ------------------------------



  • 15.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 05-16-2025 13:47

    Hi,

    Izeck, you are right! The topic v2.users.{id}.workforcemanagement.timeoffrequests is emitted only with on update via Time-Off Requests from WFM Admin UI. Below is the screenshot of the topic from Dev Center: 



    ------------------------------
    Tatjana Knezevic

    www.startelecom.cloud

    https://www.linkedin.com/company/star-telecom-www-startelecom-ca-/
    ------------------------------



  • 16.  RE: Topic v2.users.{id}.workforcemanagement.notifications and mutableGroupId

    Posted 05-16-2025 13:51

    I would suggest adding an idea to the Genesys Cloud Ideas Portal to publish events on time off request creation. 



    ------------------------------
    Brian Trezise
    Genesys - Employees - Lead Software Engineer
    ------------------------------