# Issue with Scheduled Search Trigger in IDN Workflow

**URL:** <https://developer.sailpoint.com/discuss/t/issue-with-scheduled-search-trigger-in-idn-workflow/77580>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows, identity-security-cloud\
**Created:** [August 21, 2024, 11:51pm UTC](https://developer.sailpoint.com/discuss/t/issue-with-scheduled-search-trigger-in-idn-workflow/77580 "2024-08-21T23:51:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![adebomol2024](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@adebomol2024](https://developer.sailpoint.com/discuss/u/adebomol2024)\
**Post date:** [August 21, 2024, 11:51pm UTC](https://developer.sailpoint.com/discuss/t/issue-with-scheduled-search-trigger-in-idn-workflow/77580/1 "2024-08-21T23:51:19Z")

</div>

Hello fellow Sailors,

I am encountering an issue when using the scheduled search trigger in an IdentityNow (IDN) workflow. The workflow is intended to use a saved search (which I have created a subscription for) as the trigger for the scheduled search. The search successfully returns a set of identities, and the workflow is supposed to:

1. Trigger based on the scheduled search.
2. Retrieve the identities from the search result.
3. Call our HRIS API.
4. Send an email to the IAM team.

While the scheduled trigger appears to initiate the workflow, the identities returned from the search are not being recognized by the “Get Identity” action in the workflow. As a result, the workflow is not able to process the identities as expected.

Could you please advise on how I can ensure that the identities returned from the scheduled search (which triggers the workflow) are correctly recognized and processed within the workflow?

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/4/4cf8a7d6815bb86830d8abd73a707da0fa05fc7b.png)

Per the workflow execution logs, here’s a snippet of the error I get:

Here’s the error message I get when the workflow is triggered:

```auto
{"input":{"_meta":{"invocationId":"dfsdfsd-b78c-sdfsdf-b43b-sdfsdfsdf","subscriptionId":"sdd-d4f7-4dfdf-adbc-sdfsd","triggerType":"FIRE_AND_FORGET"},"fileName":"Search Export.2024-08-19 15'01 GMT","ownerEmail":"myemail@company.com","ownerName":"John","query":"attributes.compareHireDateAndNow:TRUE AND attributes.compareHireDateAndPast7Days:TRUE","searchName":"Hire Date Within 7 Days","searchResults":}
{"attempts":1,"displayName":"Get Identity","stepName":"getIdentity","task":"sp:get-identity"}
{"displayName":"Get Identity","error":"request failed: 404 - 404 Not Found: ","stepName":"getIdentity","task":"sp:get-identity"}
{"error":"task failed: activity error (type: sp:internal:http, scheduledEventID: 5, startedEventID: 6, identity: dfdsfsf-1135-4b3f-bd1e-sdfsdf): request failed: 404 - 404 Not Found: (type: HTTP Response Returned a Client Error, retryable: false): request failed: 404 - 404 Not Found (type: fundamental, retryable: true)"}

```

---

<div class="post-metadata">

**Author:** ![Irshaad\_Laher\_WS](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/irshaad_laher_ws/32/12713_2.png) [@Irshaad\_Laher\_WS](https://developer.sailpoint.com/discuss/u/Irshaad_Laher_WS)\
**Post date:** [August 22, 2024, 12:26am UTC](https://developer.sailpoint.com/discuss/t/issue-with-scheduled-search-trigger-in-idn-workflow/77580/2 "2024-08-22T00:26:11Z")

</div>

Hi @adebomol2024

It appears you are using the input to your “Get Identity” step as “$.trigger.identity.id”.  
But since your trigger is a scheduled trigger that just initiates the workflow at given time, the trigger has not input to provide to this step (v3/identities/_\<no value_\>) As a result the get identity fails. Using this trigger you would need to provide the input either with another step after the schedule or changing your trigger.

It sounds like you want to use a scheduled search instead and then use the result of the search to get that specific identity / identities to continue in the workflow.

> **[Triggers - SailPoint Identity Services](https://documentation.sailpoint.com/saas/help/workflows/workflow-triggers.html#scheduled-search)**
>
> SailPoint Identity Services Documentation

The schedule search will return a JSON which you can then reference specific blocks in it to use in the Get Identity step with a JSONPath expression $.trigger.xyz.xyz.

Other considerations would be, your search might return more than one identity but your workflow is only processing one, you may want to consider a loop through the array of identities returned from your search if more than one. i.e. all steps after the trigger will be in a loop until all items have been processed.

I hope that helps

---

<div class="post-metadata">

**Author:** ![vkashat](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vkashat/32/9721_2.png) [@vkashat](https://developer.sailpoint.com/discuss/u/vkashat)\
**Post date:** [August 22, 2024, 2:55am UTC](https://developer.sailpoint.com/discuss/t/issue-with-scheduled-search-trigger-in-idn-workflow/77580/3 "2024-08-22T02:55:07Z")

</div>

Can you share the details on what you’re inputting on the get identity step?

---

<div class="post-metadata">

**Author:** ![Irshaad\_Laher\_WS](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/irshaad_laher_ws/32/12713_2.png) [@Irshaad\_Laher\_WS](https://developer.sailpoint.com/discuss/u/Irshaad_Laher_WS)\
**Post date:** [August 22, 2024, 4:14am UTC](https://developer.sailpoint.com/discuss/t/issue-with-scheduled-search-trigger-in-idn-workflow/77580/4 "2024-08-22T04:14:21Z")

</div>

Hi @adebomol2024

Looking at the error, the search results are blank, can you check the search directly and ensure you are getting results:

_ **“searchResults”:}** _

Irshaad

---

<div class="post-metadata">

**Author:** ![jesvin90](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/jesvin90/32/5301_2.png) [@jesvin90](https://developer.sailpoint.com/discuss/u/jesvin90)\
**Post date:** [August 22, 2024, 9:21am UTC](https://developer.sailpoint.com/discuss/t/issue-with-scheduled-search-trigger-in-idn-workflow/77580/5 "2024-08-22T09:21:48Z")

</div>

Hi @adebomol2024,

Since your search result returns multiple identities, you would want to loop through each of them.

Here is a draft workflow which you can work on that uses a looping on the search results. It uses the scheduled trigger, then calls the Search API to retrieve the identities and then loop through each of the identities.

Let me know if you need any further assistance on this.

[SearchWorkflow20240822.json](https://developer.sailpoint.com/discuss/uploads/short-url/qOdFKkqi1tm3KbBkut6dCHI8eum.json) (2.5 KB)

---

<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:** [October 21, 2024, 9:22am UTC](https://developer.sailpoint.com/discuss/t/issue-with-scheduled-search-trigger-in-idn-workflow/77580/6 "2024-10-21T09:22:38Z")

</div>

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