Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Workflow - Increase Loop Limit

    Posted 08-25-2025 14:34

    I currently have a main loop in my workflow that has a limit of 99. 

    I have this workflow work through a data table and preform a few actions but my issue is that in the next little while, I will have more than 200 data table entries so this workflow will stop after 99. Does anyone know how I can increase this? In a perfect world, I would have it look at the data table and only run the amount of times needed based on how many entries are in there. 


    #Architect

    ------------------------------
    Connor Maxwell
    -
    ------------------------------


  • 2.  RE: Workflow - Increase Loop Limit

    Posted 08-26-2025 10:49

    Please disregard, I was able to fix it by setting a variable before the loop with a higher number and then having the loop reference that variable as the limit. 



    ------------------------------
    Connor Maxwell
    -
    ------------------------------



  • 3.  RE: Workflow - Increase Loop Limit

    Posted 08-27-2025 02:21

    That´s a good idea!



    ------------------------------
    Thomas Repking
    CS
    ------------------------------



  • 4.  RE: Workflow - Increase Loop Limit

    Posted 08-28-2025 05:07
    Edited by Brian Jones 08-28-2025 05:08

    I respect the persistence in finding a suitable answer for your use case 🫡 Out of curiosity, did you use a data action to get the actual total row count via the data table API and set that result as your loop integer?

    Note: For others curious about how to loop more than 99 times, you can also use a calculated expression in the Loop Count field itself (e.g. 99+20) to define the maximum loop count.



    ------------------------------
    Brian T. Jones | Ascension | Senior Specialist - Technology
    ------------------------------



  • 5.  RE: Workflow - Increase Loop Limit

    Posted 08-28-2025 10:30

    No I just set a random high number that I don't think we will hit. 

    I was not aware that I could build a data action to get it so thank you for that idea because it worked! I used GET /api/v2/flows/datatables/{datatableId}/rows to get the toal number of rows. I did leave in my previous fix under the failure path just to make sure that variable is set and doesn't error out right at the beginning. 

    Thank you for your help with this! 



    ------------------------------
    Connor Maxwell
    -
    ------------------------------



  • 6.  RE: Workflow - Increase Loop Limit

    Posted 08-28-2025 10:36

    Yes, what I like to do is to use the GET /api/v2/flows/datatables/{datatableid}/rows with showbrief and page size to 99.  Then I look at the pageCount in the response to know how many pages I need to iterate through.  Then I use iterate through the same call without showbrief using different page numbers and get all the data.  I use the pageCount for the initial loop then a second loop with 99 inside of that.  



    ------------------------------
    Robert Wakefield-Carl
    ttec Digital
    Sr. Director - Innovation Architects
    Robert.WC@ttecdigital.com
    https://www.ttecDigital.com
    https://RobertWC.Blogspot.com
    ------------------------------