# Workflow Loop Error

**URL:** <https://developer.sailpoint.com/discuss/t/workflow-loop-error/184748>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows, identity-security-cloud\
**Created:** [October 7, 2025, 3:15am UTC](https://developer.sailpoint.com/discuss/t/workflow-loop-error/184748 "2025-10-07T03:15:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shikhadeliveroo](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@shikhadeliveroo](https://developer.sailpoint.com/discuss/u/shikhadeliveroo)\
**Post date:** [October 7, 2025, 3:15am UTC](https://developer.sailpoint.com/discuss/t/workflow-loop-error/184748/1 "2025-10-07T03:15:20Z")

</div>

I am trying to pass the identity ID that I am getting from Search Query into the loop. But I am getting this error  
`{`  
`“loopOutput”: {`  
`“failureItems”: [`  
`{`  
`“errorMessage”: “expected top-level JSON object in string, got array without attribute wrapper (type: Error Parsing Activity Output, retryable: false)”,`  
`“payload”: null`  
`}`  
`],`  
`“successfulItems”: `  
`}`  
`}`

Attaching the screenshot for reference.

Also I have used Send email where I am checking whether the value getting fetched into ‘$.getInactiveIdentities.identities[\*].id’ is correct or not and it is giving me correct result.

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/4/5/45d0946ec4f2e1698b5e6a3e164c955238eff551.png)

Any suggestion would be helpful.

---

<div class="post-metadata">

**Author:** ![MattUribe](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/matturibe/32/20300_2.png) [@MattUribe](https://developer.sailpoint.com/discuss/u/MattUribe)\
**Post date:** [October 7, 2025, 5:38am UTC](https://developer.sailpoint.com/discuss/t/workflow-loop-error/184748/2 "2025-10-07T05:38:13Z")

</div>

I don’t think that `$` is a valid expression for context. It should reference a specific step. If you have a requirement to get the output of multiple steps into the context, you can use a Define Variable step to put all the variables into one step, and add the define variable to the loop context.

More details in this post:

> [@Unable to PATCH role owner in workflow](https://developer.sailpoint.com/discuss/t/unable-to-patch-role-owner-in-workflow/183982/5):
>
> Ah, you have a loop - recall that variables that are configured outside of a loop are not available within the loop, unless you add them to the context. I like to use a define variable step to add all the values I might need inside the loop, then add that define variable itself to the loop context.

Thanks

---

<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:** [December 6, 2025, 5:38am UTC](https://developer.sailpoint.com/discuss/t/workflow-loop-error/184748/3 "2025-12-06T05:38:51Z")

</div>

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