Loop in a workflow doesn't allow the dynamic approver to work properly

Hi, I’m building a workflow that dynamically is able to calculate the approver.


This workflow is receiving the input of the dynamic approver external trigger and than with an HTTP request is getting the tags about that access item. The loop iterates over those tags and inside the loop I have an HTTP request that is sending back to the dynamic approver event trigger the right governance group based on the info of the tag. The problem is that the HTTP request is sending the approval to the governance group if I don’t use the loop, if I use the loop instead it is not sending anything. This is the workflow output:

type,timestamp,attributes
WorkflowExecutionStarted,"2025-03-31T09:52:27.504195379Z","{""input"":{""_metadata"":{""callbackURL"":""https://partner11902.api.identitynow-demo.com/beta/trigger-invocations/5ba8408f-3ee3-4e3b-bc8a-603d62e40f34/complete"",""responseMode"":""async"",""secret"":""214e04e7-9dd7-4ba6-8d76-f8261c8890c8"",""triggerId"":""idn:access-request-dynamic-approver"",""triggerType"":""requestResponse""},""accessRequestId"":""fbb26ae7bc5e46fc8944c7749365a057"",""requestedBy"":{""id"":""991a7a89b20c43528aedd62e5ae2af43"",""name"":""s.tartaglione"",""type"":""IDENTITY""},""requestedFor"":{""id"":""9088ba74998d4ff4976b8a46b4faffd8"",""name"":""12121"",""type"":""IDENTITY""},""requestedItems"":[{""assignmentContext"":null,""comment"":null,""description"":""Questo Access Profile ti da il gruppo Entra: TestGroup3"",""id"":""40bb5595af7c4c8f810e3a20f4bce43f"",""name"":""AD Liquid Access Profile Test Group 3"",""operation"":""Add"",""type"":""ACCESS_PROFILE""}]}}"
ActivityTaskScheduled,"2025-03-31T09:52:27.650923876Z","{""displayName"":""HTTP Request 1"",""input"":{""authenticationType"":""OAuth"",""basicAuthPassword"":null,""basicAuthUserName"":null,""csvRequestBody"":null,""formRequestBody"":null,""headerAuthName"":null,""headerAuthValue"":null,""jsonRequestBody"":null,""method"":""get"",""oAuthClientId"":""dbd8217073b4414ea4ec322e647e18bb"",""oAuthClientSecret"":""$.secrets.33b1394f-ad4d-4073-a576-43a31de4c992"",""oAuthCredentialLocation"":""oAuthInBody"",""oAuthScope"":null,""oAuthTokenUrl"":""https://partner11902.api.identitynow-demo.com/oauth/token"",""requestContentType"":null,""requestHeaders"":null,""suppliedInlineExpression"":{""url"":""https://partner11902.api.identitynow-demo.com/v2024/tagged-objects/{{$.trigger.requestedItems[0].type}}/{{$.trigger.requestedItems[0].id}}""},""textRequestBody"":null,""url"":""https://partner11902.api.identitynow-demo.com/v2024/tagged-objects/ACCESS_PROFILE/40bb5595af7c4c8f810e3a20f4bce43f"",""urlParams"":null,""xmlRequestBody"":null},""stepName"":""hTTPRequest1"",""task"":""sp:http"",""technicalName"":""HTTP Request 1""}"
ActivityTaskStarted,"2025-03-31T09:52:27.650962907Z","{""attempts"":1,""displayName"":""HTTP Request 1"",""stepName"":""hTTPRequest1"",""task"":""sp:http"",""technicalName"":""HTTP Request 1""}"
ActivityTaskCompleted,"2025-03-31T09:52:28.209198118Z","{""displayName"":""HTTP Request 1"",""result"":{""body"":{""objectRef"":{""id"":""40bb5595af7c4c8f810e3a20f4bce43f"",""name"":null,""type"":""ACCESS_PROFILE""},""tags"":[""TAG2"",""DYNAMICAPPROVERTYPE_FCP""]},""headers"":{},""responseTime"":""0.127333 seconds"",""statusCode"":200},""stepName"":""hTTPRequest1"",""task"":""sp:http"",""technicalName"":""HTTP Request 1""}"
ActivityTaskScheduled,"2025-03-31T09:52:28.256835348Z","{""displayName"":""Loop"",""input"":{""context.$"":"""",""input"":[""TAG2"",""DYNAMICAPPROVERTYPE_FCP""],""start"":""Compare Strings"",""steps"":{""Compare Strings"":{""choiceList"":[{""comparator"":""StringEquals"",""nextStep"":""HTTP Request"",""variableA.$"":""$.loop.loopInput.value"",""variableB"":""TAG2""}],""defaultStep"":""HTTP Request 2"",""displayName"":"""",""type"":""choice""},""End Step - Success 1"":{""displayName"":"""",""type"":""success""},""End Step - Success 3"":{""displayName"":"""",""type"":""success""},""HTTP Request"":{""actionId"":""sp:http"",""attributes"":{""jsonRequestBody"":{""output"":{""id"":""d835f415-32d2-414e-97de-9526e2daeca1"",""name"":""Test_Sprint_Jira"",""type"":""GOVERNANCE_GROUP""},""secret"":""{{$.trigger._metadata.secret}}""},""method"":""post"",""requestContentType"":""json"",""url.$"":""$.trigger._metadata.callbackURL""},""displayName"":"""",""nextStep"":""End Step - Success 3"",""type"":""action"",""versionNumber"":2},""HTTP Request 2"":{""actionId"":""sp:http"",""attributes"":{""jsonRequestBody"":{""output"":{""id"":""d835f415-32d2-414e-97de-9526e2daeca1"",""name"":""Test_Sprint_Jira"",""type"":""GOVERNANCE_GROUP""},""secret"":""{{$.trigger._metadata.secret}}""},""method"":""post"",""requestContentType"":""json"",""url.$"":""$.trigger._metadata.callbackURL""},""displayName"":"""",""nextStep"":""End Step - Success 1"",""type"":""action"",""versionNumber"":2}}},""stepName"":""loop"",""task"":""sp:loop:iterator"",""technicalName"":""Loop""}"
ActivityTaskStarted,"2025-03-31T09:52:28.256883676Z","{""attempts"":1,""displayName"":""Loop"",""stepName"":""loop"",""task"":""sp:loop:iterator"",""technicalName"":""Loop""}"
ActivityTaskCompleted,"2025-03-31T09:52:28.282113652Z","{""displayName"":""Loop"",""result"":{""loopOutput"":{""failureItems"":[{""errorMessage"":""task failed: activity error (type: sp:external:http:v2, scheduledEventID: 11, startedEventID: 12, identity: 1@sp-workflow-worker-internal-74d78b8d46-pvdxc@sp-workflow-engine): invalid URL Format:  (type: incorrect activity configuration, retryable: false)"",""payload"":null},{""errorMessage"":""task failed: activity error (type: sp:external:http:v2, scheduledEventID: 11, startedEventID: 12, identity: 1@sp-workflow-worker-internal-74d78b8d46-pvdxc@sp-workflow-engine): invalid URL Format:  (type: incorrect activity configuration, retryable: false)"",""payload"":null}],""successfulItems"":[]}},""stepName"":""loop"",""task"":""sp:loop:iterator"",""technicalName"":""Loop""}"
StartChildWorkflowExecutionInitiated,"2025-03-31T09:52:28.332517555Z","{""input"":{""start"":""Compare Strings"",""steps"":{""Compare Strings"":{""choiceList"":[{""comparator"":""StringEquals"",""nextStep"":""HTTP Request"",""variableA.$"":""$.loop.loopInput.value"",""variableB"":""TAG2""}],""defaultStep"":""HTTP Request 2"",""displayName"":"""",""type"":""choice""},""End Step - Success 1"":{""displayName"":"""",""type"":""success""},""End Step - Success 3"":{""displayName"":"""",""type"":""success""},""HTTP Request"":{""actionId"":""sp:http"",""attributes"":{""jsonRequestBody"":{""output"":{""id"":""d835f415-32d2-414e-97de-9526e2daeca1"",""name"":""Test_Sprint_Jira"",""type"":""GOVERNANCE_GROUP""},""secret"":""{{$.trigger._metadata.secret}}""},""method"":""post"",""requestContentType"":""json"",""url.$"":""$.trigger._metadata.callbackURL""},""displayName"":"""",""nextStep"":""End Step - Success 3"",""type"":""action"",""versionNumber"":2},""HTTP Request 2"":{""actionId"":""sp:http"",""attributes"":{""jsonRequestBody"":{""output"":{""id"":""d835f415-32d2-414e-97de-9526e2daeca1"",""name"":""Test_Sprint_Jira"",""type"":""GOVERNANCE_GROUP""},""secret"":""{{$.trigger._metadata.secret}}""},""method"":""post"",""requestContentType"":""json"",""url.$"":""$.trigger._metadata.callbackURL""},""displayName"":"""",""nextStep"":""End Step - Success 1"",""type"":""action"",""versionNumber"":2}}},""workflowId"":""72386cdd-3e78-4610-ad22-06d967736b26-1""}"
StartChildWorkflowExecutionInitiated,"2025-03-31T09:52:28.332596611Z","{""input"":{""start"":""Compare Strings"",""steps"":{""Compare Strings"":{""choiceList"":[{""comparator"":""StringEquals"",""nextStep"":""HTTP Request"",""variableA.$"":""$.loop.loopInput.value"",""variableB"":""TAG2""}],""defaultStep"":""HTTP Request 2"",""displayName"":"""",""type"":""choice""},""End Step - Success 1"":{""displayName"":"""",""type"":""success""},""End Step - Success 3"":{""displayName"":"""",""type"":""success""},""HTTP Request"":{""actionId"":""sp:http"",""attributes"":{""jsonRequestBody"":{""output"":{""id"":""d835f415-32d2-414e-97de-9526e2daeca1"",""name"":""Test_Sprint_Jira"",""type"":""GOVERNANCE_GROUP""},""secret"":""{{$.trigger._metadata.secret}}""},""method"":""post"",""requestContentType"":""json"",""url.$"":""$.trigger._metadata.callbackURL""},""displayName"":"""",""nextStep"":""End Step - Success 3"",""type"":""action"",""versionNumber"":2},""HTTP Request 2"":{""actionId"":""sp:http"",""attributes"":{""jsonRequestBody"":{""output"":{""id"":""d835f415-32d2-414e-97de-9526e2daeca1"",""name"":""Test_Sprint_Jira"",""type"":""GOVERNANCE_GROUP""},""secret"":""{{$.trigger._metadata.secret}}""},""method"":""post"",""requestContentType"":""json"",""url.$"":""$.trigger._metadata.callbackURL""},""displayName"":"""",""nextStep"":""End Step - Success 1"",""type"":""action"",""versionNumber"":2}}},""workflowId"":""72386cdd-3e78-4610-ad22-06d967736b26-2""}"
ChildWorkflowExecutionStarted,"2025-03-31T09:52:28.34970662Z","{""runId"":""0195eb9d-e4b3-7c8c-8480-f08ed6851af1"",""workflowId"":""72386cdd-3e78-4610-ad22-06d967736b26-2""}"
ChildWorkflowExecutionStarted,"2025-03-31T09:52:28.368920906Z","{""runId"":""0195eb9d-e4c4-76f1-b0bd-a7759282cbde"",""workflowId"":""72386cdd-3e78-4610-ad22-06d967736b26-1""}"
ChildWorkflowExecutionFailed,"2025-03-31T09:52:28.684980566Z","{""error"":""task failed: activity error (type: sp:external:http:v2, scheduledEventID: 11, startedEventID: 12, identity: 1@sp-workflow-worker-internal-74d78b8d46-pvdxc@sp-workflow-engine): invalid URL Format:  (type: incorrect activity configuration, retryable: false)"",""workflowId"":""72386cdd-3e78-4610-ad22-06d967736b26-1""}"
ChildWorkflowExecutionFailed,"2025-03-31T09:52:28.689944104Z","{""error"":""task failed: activity error (type: sp:external:http:v2, scheduledEventID: 11, startedEventID: 12, identity: 1@sp-workflow-worker-internal-74d78b8d46-pvdxc@sp-workflow-engine): invalid URL Format:  (type: incorrect activity configuration, retryable: false)"",""workflowId"":""72386cdd-3e78-4610-ad22-06d967736b26-2""}"
ActivityTaskScheduled,"2025-03-31T09:52:28.744377398Z","{""displayName"":""End Step - Success 2"",""input"":{},""stepName"":""End Step - Success 2"",""task"":""sp:internal:operator"",""technicalName"":""End Step - Success 2""}"
ActivityTaskStarted,"2025-03-31T09:52:28.744418522Z","{""attempts"":1,""displayName"":""End Step - Success 2"",""stepName"":""End Step - Success 2"",""task"":""sp:internal:operator"",""technicalName"":""End Step - Success 2""}"
ActivityTaskCompleted,"2025-03-31T09:52:28.771282356Z","{""displayName"":""End Step - Success 2"",""result"":{},""stepName"":""End Step - Success 2"",""task"":""sp:internal:operator"",""technicalName"":""End Step - Success 2""}"
WorkflowExecutionCompleted,"2025-03-31T09:52:28.806765854Z","{""result"":{""72386cdd-3e78-4610-ad22-06d967736b26"":""0195eb9d-e170-72f7-be0e-1d5650420177"",""hTTPRequest1"":{""body"":{""objectRef"":{""id"":""40bb5595af7c4c8f810e3a20f4bce43f"",""name"":null,""type"":""ACCESS_PROFILE""},""tags"":[""TAG2"",""DYNAMICAPPROVERTYPE_FCP""]},""headers"":{},""responseTime"":""0.127333 seconds"",""statusCode"":200},""loop"":{""loopOutput"":{""failureItems"":[{""errorMessage"":""task failed: activity error (type: sp:external:http:v2, scheduledEventID: 11, startedEventID: 12, identity: 1@sp-workflow-worker-internal-74d78b8d46-pvdxc@sp-workflow-engine): invalid URL Format:  (type: incorrect activity configuration, retryable: false)"",""payload"":null},{""errorMessage"":""task failed: activity error (type: sp:external:http:v2, scheduledEventID: 11, startedEventID: 12, identity: 1@sp-workflow-worker-internal-74d78b8d46-pvdxc@sp-workflow-engine): invalid URL Format:  (type: incorrect activity configuration, retryable: false)"",""payload"":null}],""successfulItems"":[]}},""trigger"":{""_metadata"":{""callbackURL"":""https://partner11902.api.identitynow-demo.com/beta/trigger-invocations/5ba8408f-3ee3-4e3b-bc8a-603d62e40f34/complete"",""responseMode"":""async"",""secret"":""214e04e7-9dd7-4ba6-8d76-f8261c8890c8"",""triggerId"":""idn:access-request-dynamic-approver"",""triggerType"":""requestResponse""},""accessRequestId"":""fbb26ae7bc5e46fc8944c7749365a057"",""requestedBy"":{""id"":""991a7a89b20c43528aedd62e5ae2af43"",""name"":""s.tartaglione"",""type"":""IDENTITY""},""requestedFor"":{""id"":""9088ba74998d4ff4976b8a46b4faffd8"",""name"":""12121"",""type"":""IDENTITY""},""requestedItems"":[{""assignmentContext"":null,""comment"":null,""description"":""Questo Access Profile ti da il gruppo Entra: TestGroup3"",""id"":""40bb5595af7c4c8f810e3a20f4bce43f"",""name"":""AD Liquid Access Profile Test Group 3"",""operation"":""Add"",""type"":""ACCESS_PROFILE""}]}}}"

Anyone that has experience with workflows can help me? Thanks

@s_tartaglione Can I know the loop input that you are passing?


I taking it with the variable selector

@s_tartaglione, Below is the JSON output from “HTTP Request 1” step. You need to loop through the tags if the access item has multiple tags. So, input to the “Loop” step should be “tags”

{
    "objectRef": {
        "type": "ACCESS_PROFILE",
        "id": "f5ab670daceb4a8fbcf7373fi334h9ub2addc9",
        "name": null
    },
    "tags": [
        "DEMO_TEST"
    ]
}