Workflow loop not even initiating inner tasks

Hi there,

I have been trying to use loops within the workflows and they just don’t seem to work at all. I have tried a number of things including changing the inputs, context and operations within the loops but nothing at all works. I have tested them with differing syntax also, but with no luck at all.

I then created a very basic workflow that looks for a firstname change, gets the identity, goes into a loop which should send an email, but again, nothing happens.

I have the input as - $.trigger.identity - in which it states it loops round once in the test.
The context as - $ - As this is the most basic way to set the context, which results in the getIdentity payload. This is not used anywhere though.
The email has hardcoded values to force it to send to something, but it does nothing.

I have tried similar when it loops round 11 times, but still nothing.

Any help would be appreciated, as it seems like this feature doesnt work at all.

Hi @jon_brown,

I have replicated your workflow and the loop operator works:

I noticed one difference - your Loop operator’s Context parameter. Instead of $, I had left mine blank as such (ignore the hint text displayed):

If the problem still persists, I would suggest starting afresh by creating a new workflow.

Hope this helps!

Hi there,

Thanks for the advice, but unfortunately I still havent had any luck. I created a new workflow and also changed it to an account disable operation inside the loop, but again, nothing happens.

If anyone has a json file i could look into that is working that would be appreciated and ill try to load that into our environment.

Thanks

Jon

Hi @jon_brown I think your problem is on what is being brought on the trigger. For debugging purpouses, let just add an Send Mail action just after Get Identity, and in the body of email only put the variable $.trigger.identity

Let see what is being brought in that variable, perhaps por some reason is an empty array, so loop will exit immediately after it starts.

I suspect that $.trigger.identity is not an array. The loop input requires an array as an input in order to process the inner actions. Try setting the loop input to $.trigger.changes instead.

Assuming this means it has looped round twice, it still hasnt initiated what is inside the loop. I attempted to add a disable account action too but this didnt work.

I had problems in the past using the Manage Accounts actions inside loop. Instead, I used the HTTP Request action, combined with IDN API:

Although in this case, I had to remove entitlements. Perhaps you may try the disable account API:
{{baseUrl}}/accounts/:id/disable
is documented here:

By the way, what is the purpose of the entire workflow? Do you have to disable accounts based on what?

I think what you are doing is wrong. Loop is used with arrays. In you case above, you are fetching identity, instead you should have been fetching “Get List Of Identities” and then only use the loop values. Remember, loop have some limitations and it can run only for array of size 100 or less as per the sailpoint documentation. Hence, you should be careful while using loops. Also, instead of using basic method to choose identity attribute change trigger, use script so that you can have more flexibility. Something like $.changes[?(@.attribute=='firstName')].

In case of manageAccounts, again you are doing it wrong. When you fetch the identity, you cannot directly use Manage Accounts. First you have to use another Action called “Get Accounts” which will pull all the account associated with the identity and then once you pull all the accounts on that identity, then only you use the Manage Accounts action. Hope that helps. You can find documentation for the script used.

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