<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00007tNSQxCAOOkta Identity EngineWorkflowsAnswered2024-08-23T09:00:35.000Z2022-08-01T23:44:38.000Z2022-08-23T23:05:35.000Z

u7n8v (u7n8v) asked a question.

Helper workflow stack limit

There is a workflow running in the system which creates unique email address for new users. I'm calling a helper workflow from the parent where the helper reiterates through the loginname database and creates a username that has not been used. The helper workflow increments by 1 and then rechecks the database for duplicity. It looks like this call and iterative step has a limit of only 249 steps. Currently I have usernames in the system with xyz350, so the workflow is not able to check and create a unique loginname. The error that I receive is Stack limit exceeded.

Is there a way to go beyond 249 steps and not have the workflow error out.

 


  • TimL.58332 (Workflows)

    I found this one sort of interesting so I built out some logic to take an input (first.last123@domain.com), do a search to return the first page (200 records) of users that Start With (first.last). I then make a list of numbers from those users then determine the highest numbered value of that list.

     

    This is an example. A complete flow would require you to build out pagination using Call Flow card to return the entire list before parsing it out to find the highest increment.

     

    This however would be performing very few API calls and would be quite quick.

     

    See attached

    Expand Post
    Selected as Best
  • Paul S. (Okta, Inc.)

    Hello @u7n8v (u7n8v)​  Thank you for reacting out to our Community!

     

    Based on our System limitation doc, the maximum number of steps is 2 million. Please see our doc here: https://help.okta.com/wf/en-us/Content/Topics/Workflows/workflows-system-limits.htm

    In this case we recommend to review the configuration and see what is causing the error and correct it.

     

    Hope this helps and if this answered your question, please mark this as Best Answer!

    Expand Post
  • Hi @u7n8v (u7n8v)​ 

     

    There is a recursive stack limit of 250, as you've discovered, put in place to prevent system abuses and infinite loops.

     

    My recommendation would be to see if you can call your API to check for the usernames in descending order, etc, so it's not necessary to make 351 recursive calls to generate the username for xyz351 in your example.

     

    Hopefully, it will be possible for you to redesign the search to be more efficient, or come up with a way to avoid recursion in your flow.

    Expand Post
  • TimL.58332 (Workflows)

    I found this one sort of interesting so I built out some logic to take an input (first.last123@domain.com), do a search to return the first page (200 records) of users that Start With (first.last). I then make a list of numbers from those users then determine the highest numbered value of that list.

     

    This is an example. A complete flow would require you to build out pagination using Call Flow card to return the entire list before parsing it out to find the highest increment.

     

    This however would be performing very few API calls and would be quite quick.

     

    See attached

    Expand Post
    Selected as Best
  • u7n8v (u7n8v)

    Thank you Tim LaBorn for taking the time and designing a workaround. I was able to include this in my workflow and get it to work.

This question is closed.
Loading
Helper workflow stack limit