Loop in flow kept repeating the same entitlement

I have this workflow designed to create roles. I have a link and I set the limit to two(2). When I ran the workflow the first time it created two roles (let’s say A &B). When I ran it the second time it created a role (let’s say C). If I run it from the third attempt it kept repeating the already created roles (i.e A,B & C). Any idea on what to do to fix this ?

My link is: https://abc.api.identitynow.com/v3/search?limit=2 Find attached my Workflow

can you please share what is loop input?

The loop input is https://xxx.api.identitynow.com/v3/search?limit=2

@mobadaki

Is my understanding correct ?

you are trying to fetch 2 entitlements using search query and sending these into the loop which will be part of the role , and you are seeing repeated compostion of these entitlements

If true ,
My observation is that , you are making search api call with limit 2 which will result in 2 objects every time , BUT , will not be a case that it will not return the same 2 objects on the next call .

1 Like

Exactly. you are correct

I suggest , go with Powershell script. This repetition can be resolved using offset path variable but Loop cannot handle more than 100 inputs which is not a possible scenario

Can you attach your workflow, minus any sensitive bits?

I know it can not handle 100 but it should be able to handle it in tranches. Let say 2,10, 20 or 50 at a time or what do you think ?

@mobadaki

Michael , workflows Do Not Support Loop inside a loop.

Hi Michael,

You may find this article: Recursive Workflows in IdentityNow helpful.

Also, based on your search, it’ll keep picking the beginning items. You might need to look at adding an ‘offset’ parameter so that it will pick up item number 3 and 4, 5 and 6, etc. search-post | SailPoint Developer Community

Thanks,
Margo

1 Like