{
  "created": "2026-11-06T23:52:30.230490432Z",
  "modified": "2026-11-07T18:53:33.858514647Z",
  "modifiedBy": {
    "type": "IDENTITY",
    "id": "{admin-id}",
    "name": "{admin-name}"
  },
  "definition": {
    "start": "Define Variable",
    "steps": {
      "Define Variable": {
        "actionId": "sp:define-variable",
        "attributes": {
          "id": "sp:define-variable",
          "variables": [
            {
              "description": "Source-agnostic onboarding mapping configuration",
              "name": "mappingRules",
              "transforms": [],
              "variableA": [
                {
                  "accountAttribute": "",
                  "destinationAttribute": "Description",
                  "entitlementAttribute": "customNotes",
                  "sourceName": "Enterprise ERP - Onboarding Demo"
                },
                {
                  "accountAttribute": "email",
                  "destinationAttribute": "Owner",
                  "entitlementAttribute": "managedBy",
                  "sourceName": "Enterprise ERP - Onboarding Demo"
                },
                {
                  "accountAttribute": "email",
                  "destinationAttribute": "AdditionalOwners",
                  "entitlementAttribute": "backupOwner",
                  "sourceName": "Enterprise ERP - Onboarding Demo"
                },
                {
                  "accountAttribute": "",
                  "destinationAttribute": "Requestable",
                  "entitlementAttribute": "selfServiceAllowed",
                  "sourceName": "Enterprise ERP - Onboarding Demo"
                },
                {
                  "accountAttribute": "",
                  "destinationAttribute": "Tags",
                  "entitlementAttribute": "complianceTag",
                  "sourceName": "Enterprise ERP - Onboarding Demo"
                }
              ]
            }
          ]
        },
        "displayName": "Define Source Mapping Rules",
        "nextStep": "Serial Loop",
        "type": "Mutation"
      },
      "End Step - Success": {
        "actionId": "sp:operator-success",
        "displayName": "All Rules Dispatched",
        "type": "success"
      },
      "Serial Loop": {
        "actionId": "sp:serial:iterator",
        "attributes": {
          "input.$": "$.defineVariable.mappingRules",
          "loopType": "forLoop",
          "start": "HTTP Request",
          "steps": {
            "Define Comparison": {
              "actionId": "sp:compare-multi-type",
              "choiceList": [
                {
                  "comparator": "NumericGreaterThan",
                  "nextStep": "HTTP Request 1",
                  "variableA.$": "$.hTTPRequest.body.length()",
                  "variableB": 0
                }
              ],
              "defaultStep": "End Step - Success 2",
              "displayName": "Check If Source Found",
              "type": "choice"
            },
            "End Step - Success 1": {
              "actionId": "sp:operator-success",
              "displayName": "Rule Dispatched",
              "type": "success"
            },
            "End Step - Success 2": {
              "actionId": "sp:operator-success",
              "displayName": "Source Not Found",
              "type": "success"
            },
            "HTTP Request": {
              "actionId": "sp:http",
              "attributes": {
                "method": "get",
                "param_authenticationRef": "oauth",
                "param_oauth": {
                  "mapping": {
                    "auth_client_id": "clientId",
                    "auth_client_secret": "clientSecret",
                    "auth_credential_location": "credentialLocation",
                    "auth_token_url": "tokenURL"
                  },
                  "paramID": "<YOUR_PARAMETER_STORAGE_ID>",
                  "paramType": "1.4",
                  "refID": "ec6caa9c-faa9-4c1e-87c6-fa14d58a0bc4"
                },
                "param_oauth_scopes": {
                  "mapping": {
                    "auth_scopes": "scopes"
                  },
                  "paramID": "",
                  "paramType": "3.1"
                },
                "requestContentType": "json",
                "url": "https://<TENANT>.api.identitynow.com/sources/v1",
                "urlParams": {
                  "filters": "name eq \"{{$.loop.loopInput.sourceName}}\""
                }
              },
              "displayName": "Resolve Source ID By Name",
              "nextStep": "Define Comparison",
              "type": "action",
              "versionNumber": 3
            },
            "HTTP Request 1": {
              "actionId": "sp:http",
              "attributes": {
                "jsonRequestBody": {
                  "accountAttribute": "{{$.loop.loopInput.accountAttribute}}",
                  "currentOffset": 0,
                  "destinationAttribute": "{{$.loop.loopInput.destinationAttribute}}",
                  "entitlementAttribute": "{{$.loop.loopInput.entitlementAttribute}}",
                  "limit": 250,
                  "sourceId": "{{$.hTTPRequest.body[0].id}}",
                  "sourceName": "{{$.loop.loopInput.sourceName}}"
                },
                "method": "post",
                "param_authenticationRef": "oauth",
                "param_oauth": {
                  "mapping": {
                    "auth_client_id": "clientId",
                    "auth_client_secret": "clientSecret",
                    "auth_credential_location": "credentialLocation",
                    "auth_token_url": "tokenURL"
                  },
                  "paramID": "<YOUR_PARAMETER_STORAGE_ID>",
                  "paramType": "1.4",
                  "refID": "ec6caa9c-faa9-4c1e-87c6-fa14d58a0bc4"
                },
                "param_oauth_scopes": {
                  "mapping": {
                    "auth_scopes": "scopes"
                  },
                  "paramID": "",
                  "paramType": "3.1"
                },
                "requestContentType": "json",
                "url": "https://<TENANT>.api.identitynow.com/workflows/v1/execute/external/<PAGINATION_WORKER_WORKFLOW_ID>"
              },
              "displayName": "Dispatch Paginated Worker For Rule",
              "nextStep": "End Step - Success 1",
              "type": "action",
              "versionNumber": 3
            }
          }
        },
        "displayName": "Loop Through Mapping Rules",
        "nextStep": "End Step - Success",
        "type": "action",
        "versionNumber": 1
      }
    }
  },
  "owner": {
    "type": "IDENTITY",
    "id": "{admin-id}",
    "name": "{admin-name}"
  },
  "trigger": {
    "type": "SCHEDULED",
    "attributes": {
      "cronString": "0 6 * * *",
      "frequency": "cronSchedule",
      "id": "idn:cron-schedule",
      "integrationId": null,
      "timeZone": "America/Phoenix"
    }
  },
  "creator": {
    "type": "IDENTITY",
    "id": "{admin-id}",
    "name": "{admin-name}"
  },
  "id": "<CONTROLLER_WORKFLOW_ID>",
  "name": "Entitlement Metadata Sync - Controller",
  "description": "Source-agnostic onboarding controller that defines source, entitlement attribute, account attribute, and destination governance field mappings and dispatches the paginated worker sub-workflow.",
  "executionCount": 0,
  "failureCount": 0,
  "enabled": false
}
