Is it possible to have a sleep and wake-up function for the bot?

Hi all,

I would like to know if the following example is possible, and if so, how it can be implemented.

E.g. the bot should check a folder for a file. If not found, it must go to sleep for 60 seconds and comeback to check the folder after 60 seconds. If found, process the file and go to sleep for 60 seconds and wake up to check if there are any new files inside the folder.

Basically, the bot process never stops as an end of process. Once I start it, unless I go and explicitly stop it, it must do this sleep and wake up process again and again.

Hi @anonymous3 !
The function that you describe seems for me the same approach as in Orchestrator, when you create a job, in its properties you can schedule it so that it runs each XX minutes (so in your case 1 minute).
Are you looking for a specific solution on UiPath Agent, or with Windows scheduler ?

Hi @Hiba_B ,

With Windows Scheduler please.

To do so, you need first to create a batch file, here is an interesting post that is treating the subject :smile:

Let us know if you have further question after trying his solution :wink:


You could use while loop here,

While false {
If check for file {
No found
Put delay activity for 60 sec
Do file processing

In while loop, you iterate number of times like 4 6