Get List of Identities breaking loop in Workflows

Hi Mohamad,

Yes, the Get List of Identities action will return all attributes of an identity, which can be an enormous amount of information depending on how many accounts and access your identities have. At the time of my reply, Workflows have the following limitation:

The maximum allowed size for a workflow definition is 400KB. The maximum allowed size for a workflow definition plus its input is 1.5MB

Additionally, loops have the following limit at the time of this reply:

The array you select can contain no more than 100 items. If an item in this list is larger than 512KB, that item will fail when the loop is executed.

Get List of Identities relies on the search API under the hood, which, by default, returns all information about each identity. Consider the following search query:

{
    "indices": [
        "identities"
    ],
    "query": {
        "query": "*"
    }
}

In my tenant this will return a response that is 2.25 MB. That alone will exceed the workflow limit.

To answer your question about limiting what is returned, you can do that by replacing your Get List of Identities action with an HTTP Request that uses the search API. Craft your query to narrow down the results to just the identities you need and add queryResultFilter to specify exactly which fields you need. For example:

{
    "indices": [
        "identities"
    ],
    "query": {
        "query": "*"
    },
    "queryResultFilter": {
        "includes": [
            "id",
            "name",
            "attributes.email"
        ]
    }
}

This query reduced my response size from 2.5 MB to 58 KB! This may resolve your loop issue.