Problems with the loop execution

I have created an workflow

But I get error’s in my loop and I cannot figure it out where it is. I have also read the documentation about loops but still can’t figure out where it goes wrong.

In the loop I want only the identity ID’s going inside the loop to have less data. How can I do this?

Also with those identity ID’s I want to do some search actions. Where I have the following code in the request Body, is that loop.loopinput.id correct?

{"indices":["identities"],"query":{"innerHit":{"query":"disabled:true","type":"accounts"},"query":"id:{{$.loop.loopInput.id}}"}}

are you able to see what is the error?

A loop has a maximum capacity of 100 items in the input. Is it the error you are getting?

I believe that was updated to 250 items. See Workflow Operators - SailPoint Identity Services

The array you select can contain a maximum of 250 items. If your loop input exceeds the maximum of 250 items, the workflow will fail and exit.

@zeross
We’ll want the error to be of better support, but this thread may help:

1 Like

I replicated some of your steps like get list of identies, loop and do a search with the same query I am able to get the identity id inside the loop and able to do a search to find disabled accounts. can you make sure you are passing exactly like this in your search http operation inside the loop

One suggestion here in your get list of identities you can also use a query to fetch identities with disabled accounts using this query. This will allow you to get only identities that has disabled accounts and you can narrow down your list of identities

@accounts(disabled:true)

The error I got was:

},
        "loop": {
          "loopOutput": {
            "failureItems": [
              {
                "errorMessage": "task failed: activity error (type: sp:email:send:v2, scheduledEventID: 29, startedEventID: 30, identity: 1@sp-workflow-worker-stg-eu-central-1-7d9ffd945c-kx2sc@sp-workflow-engine): unable to send email: request failed (type: Bad Request, retryable: false): 400 - 400 Bad Request (type: HTTP Response Returned a Client Error, retryable: false): request failed (type: Bad Request, retryable: false): 400 - 400 Bad Request (type: fundamental, retryable: true)",
                "payload": null
              },

And this 7 times, because 7 identities came into the loop.

It looked to me it’s in the send email function. But that thing is very basic and have done nothing weird in it, and used it the same as in my other workflows.

My getIdentities have this query

attributes.endDate:[now-92d TO now-35d]

Because I want to check for these population if there are still open accounts or roles/entitlements granted.

Weird stuff. I just removed the email task, and added a new one with the same settings.
And the error is gone.

I can continue now on my workflow.

1 Like

One thing I cannot get working. I want to check if the variable entitlement is not empty, but its not working.

The entitlement variable json context:

{
  "_type": "identity",
  "_version": "v2",
  "access": [
    {
      "displayName": "Ketentest_Beheerder_AD",
      "type": "ENTITLEMENT"
    },
    {
      "displayName": "MDT CRM Help & Training",
      "type": "ENTITLEMENT"
    }
}

This is the code in the email template

#if ( ${entitlement.length()} > 0 )
<p>De volgende rechten zijn nog toegekend:</p>
<ul>#foreach ( $i in ${entitlement} )
<li>$i</li>
</ul>
#end