Hey all, has anyone implemented @colin_mckibben’s workflows shown in this post:
I’m trying to set them up and the actual “sub-workflows” that do the reassignment are failing when trying to test them.
I can make the JSON patch call in postman just fine but when I take that and put it into IDN to test the workflow, it fails. Even when putting newOnwerId directly into the workflow request body.
Can you share the JSON of the workflow that is failing? It would also help if you can share the execution log. Please be sure to redact any sensitive information first.
Here’s the step input from the workflow test. Specifically, reassign roles HTTP Request 1 step. Inside jsonPatchRequestBody, I specified the ID of the new identity for testing purposes but normally it would use {{$.trigger.newOwnerId}}
I found the results CSV file with @edmarks help. I’m getting a 403. That fixed the original issue so apparently the API wants to be run in user context.
The last question I have then is how do we address the use case of multiple items of the same type? I can see you repeated the patch request but the original HTTP request only gets 1 role, AP, etc. But what if someone has 2 or more? Do we need to modify it to loop the steps?
That’s where the recursion comes in . The child workflow will process one access item at a time. For example, if an identity has three roles, then the child workflow will execute three times. The flow will look like this.
Get roles owned by the identity. Use limit=1 so we only get the first role in the list.
Change the owner of the role to the new owner.
Invoke this workflow’s external trigger so it executes again.
Repeat steps 1-3 until step 1 returns an empty response. This means the original identity has no more roles to reassign. Terminate the child workflow.