# Over 250 Iterations for Get Accounts and Loop

**URL:** <https://developer.sailpoint.com/discuss/t/over-250-iterations-for-get-accounts-and-loop/79192>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows, identity-security-cloud\
**Created:** [September 3, 2024, 5:21pm UTC](https://developer.sailpoint.com/discuss/t/over-250-iterations-for-get-accounts-and-loop/79192 "2024-09-03T17:21:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasmedina](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@jasmedina](https://developer.sailpoint.com/discuss/u/jasmedina)\
**Post date:** [September 3, 2024, 5:21pm UTC](https://developer.sailpoint.com/discuss/t/over-250-iterations-for-get-accounts-and-loop/79192/1 "2024-09-03T17:21:10Z")

</div>

Hi All,

I am using a Get Accounts method inside my Loop in our workflow. However, I am exceeding the 250 iterations threshold for Get Accounts and exceeding 100 items threshold for Loop which is making my workflow error out.

What would be the workaround to cater more than the limit threshold for both Get Accounts and Loop?

Thank you!

---

<div class="post-metadata">

**Author:** ![atarodia](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@atarodia](https://developer.sailpoint.com/discuss/u/atarodia)\
**Post date:** [September 3, 2024, 5:43pm UTC](https://developer.sailpoint.com/discuss/t/over-250-iterations-for-get-accounts-and-loop/79192/2 "2024-09-03T17:43:37Z")

</div>

Hi @jasmedina,

You can try leveraging Recursive Workflow:

> [@Recursive Workflows in IdentityNow](https://developer.sailpoint.com/discuss/t/recursive-workflows-in-identitynow/16235):
>
> IdentityNow Workflows provides a [loop operator](https://documentation.sailpoint.com/saas/help/workflows/workflow-operators.html#loop) that allows a workflow to process many items in a list of data in a quick and efficient manner. While the loop operator is a built-in component of Workflows, there is another way to achieve looping functionality using features that are currently supported in the product. In this blog, I will demonstrate how to implement recursion in Workflows to achieve looping behavior without the need for the loop operator. What is recursion? …

---

<div class="post-metadata">

**Author:** ![jasmedina](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@jasmedina](https://developer.sailpoint.com/discuss/u/jasmedina)\
**Post date:** [September 5, 2024, 2:31pm UTC](https://developer.sailpoint.com/discuss/t/over-250-iterations-for-get-accounts-and-loop/79192/3 "2024-09-05T14:31:22Z")

</div>

Hi Animesh,

Is there another way other than using Recursive Workflow? I read in the Cons that there are some limitations to it as well and it will depend on the use case if Recursive Workflow can support it.

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [September 18, 2024, 3:17pm UTC](https://developer.sailpoint.com/discuss/t/over-250-iterations-for-get-accounts-and-loop/79192/4 "2024-09-18T15:17:50Z")

</div>

I have yet to figure out a way to get past the 250 record limit on our APIs within Workflows. Recursion can’t handle pagination due to the lack of integer operations in workflows. The only way to get past 250 is to create multiple HTTP Request actions that invoke the [list-accounts | SailPoint Developer Community](https://developer.sailpoint.com/docs/api/v2024/list-accounts) API and do the pagination manually. So if you need to get 1000 accounts, you would need to have 4 HTTP actions and set the pagination appropriately in each one.

As for iterating over the accounts, recursion will work as long as you do not need to pass a context like you would with the loop context.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [November 17, 2024, 3:18pm UTC](https://developer.sailpoint.com/discuss/t/over-250-iterations-for-get-accounts-and-loop/79192/5 "2024-11-17T15:18:38Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
