In my case I am trying to execute the script twice. So for the first time it checks the status of the API and till it does not get completed it keeps calling the GET Status API multiple times. And once the status is updated to completed, it executes the second iteration, but in second iteration it does not get in to the while loop. Any idea regarding this ?