Genesys Cloud - Main

 View Only

Sign Up

  • 1.  v2.users.{id}.activity trigger for NOT_RESPONDING isn't invoking workflow

    Posted 09-10-2025 03:20
    Edited by Phaneendra Avatapalli 09-10-2025 03:21

    Goal: Auto-reset agents who hit NOT_RESPONDING back to IDLE, with a cap of 2 resets per 1 minute (we log resetCount, lastResetTime, Not Responding start Time to a data table keyed by userId).

    Trigger:

    • Topic: v2.users.{id}.activity

    • Data format: Json

    • Match: routingStatus.status == "NOT_RESPONDING"

    • Target: Workflow (Published)

    Workflow (first step):

    • JSON input activityevent (Input to flow = ON)

    • Parse (root):

      State.userId     = GetJsonObjectProperty(Flow.activityevent,"id")
      State.nrStartUtc = GetJsonObjectProperty(GetJsonObjectProperty(Flow.activityevent,"routingStatus"),"startTime")
      State.status     = GetJsonObjectProperty(GetJsonObjectProperty(Flow.activityevent,"routingStatus"),"status")

    What works: Data action PUT /users/{id}/routingstatusIDLE succeeds when tested directly; GET /users/{id}/routingstatus shows status=NOT_RESPONDING when applicable.

    Issue: When an agent times out to NOT_RESPONDING, I often see no Workflow run (Run History), so status isn't reset. Trigger tester matches but (as expected) doesn't execute.

    Any help with the community would be very helpful.

    Regards,
    Phaneendra


    #API/Integrations

    ------------------------------
    Phaneendra
    Technical Solutions Consultant
    Monash University
    Australia
    ------------------------------



  • 2.  RE: v2.users.{id}.activity trigger for NOT_RESPONDING isn't invoking workflow
    Best Answer

    Posted 09-10-2025 08:07

    Hello Phaneedra, 

    Looking at your workflow setup and see a couple of things that might be wrong:

    1. Variable naming conflict
      1. I believe there is a naming conflict between your workflow variables and the event schema properties
      2. Based on your setup, ensure that your Flow variables (State.userId, State.nrStartUtc, State.status) are properly set as inputs if they match properties in the event schema 
    2. Event Schema Verification:
      1. Double-check that the event payload structure matches exactly what you're expecting
      2. the path routingStatus.status should be verified in the actual event data
      3. Confirm the JSON structure includes all the required fields: id, routingStatus.status, and routingStatus.startTime
    3. Trigger Config:
      1. Verify the topic pattern v2.users.{id}.activity is correctly mating the events
      2. Consider logging the raw event data to verify the tigger conditions are being met

    I have some troubleshooting steps that you can try. First, enable debug logging for the workflow if available. Second, Create a simple test workflow that only logs the incoming event data to verify the trigger activation. Third, verify the match condition syntax: routingStatus.status == "NOT_RESPONDING". Finally, you can test with a more general match condition temporarily to ensure events are being received. 

    I also have an idea for an alternative approach. Consider using a more general trigger condition initially and add the NOT_RESPONDING check as the first step in the workflow. This should help verify if it's a trigger matching issue or an event reception issue. 

    Let me know what you think. 



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



  • 3.  RE: v2.users.{id}.activity trigger for NOT_RESPONDING isn't invoking workflow

    Posted 09-11-2025 23:37

    Hi Phaneendra,

    I noticed that you named your input variable on the Flow as "activityevent". Is that right?

    If so, you HAVE to name it as "jsonData" for it to receive the data from the event that was triggered (if you are using the Json Data Format, which it seems you are).

    You can confirm that information here: https://help.mypurecloud.com/articles/create-a-trigger/

    "For JSON data format, the entire event is sent to the workflow as a JSON object. The workflow must be configured to have an input variable named jsonData of type JSON."

    But aside from that, you also mentioned that you often see no workflow run in the history, which might also indicate something wrong in the Trigger setting.

    But before checking that, try changing your workflow to use the jsonData input variable, this should at least fix the flow. Then you can check if every NOT_RESPONDING status is actually being triggered correctly.



    ------------------------------
    Marcello Jabur
    ------------------------------



  • 4.  RE: v2.users.{id}.activity trigger for NOT_RESPONDING isn't invoking workflow

    Posted 09-12-2025 00:44
    Edited by Phaneendra Avatapalli 09-12-2025 00:48

    Thanks you for your reply Cameron very helpful for troubleshooting I have fixed the variables now.

    @Marcello Jabur thank you for your reply & yes I have realised that and change it which has fixed the issue. 

    What we changed

    ·        Trigger

    o   Topic: v2.users.{id}.activity

    o   Data format: Json

    o   Match: routingStatus.status Equals NOT_RESPONDING (no quotes)

    o   Targeted the latest published workflow

    ·        Workflow

    o   Added a JSON input named jsonData (Input to flow = ON)

    o   At the top, parsed fields:

    Flow.userId =
      ToString(GetJsonObjectProperty(Flow.jsonData, "id"))
    Flow.status =
      ToString(GetJsonObjectProperty(GetJsonObjectProperty(Flow.jsonData, "routingStatus"), "status"))
    Flow.nrStartUtc =
      ToString(GetJsonObjectProperty(GetJsonObjectProperty(Flow.jsonData, "routingStatus"), "startTime"))

      • (Optional) 1s wait
      • Called our Set User Routing Status: Idle action with userId = Flow.userId
      • Later, we added a GET /api/v2/users/{id} for the agent name and a data-table update core reset worked even without these.

    Everything's working now.Thank you! 🙏