@Siena, what's the use case for waiting for completion? One possible idea, is to have two scheduled scripts: script 1 initiates the search task, then passes the search task id to script 2 as a parameter. Script 2 can then check the status of the task and either take action, or reschedule itself and check again, until the task is complete.