Delay until time within a workflow


I have a process that reads files in a directory after sending inputs earlier in the process. The return files are delivered by batch process, so I’d like the robot to delay after sending files until the next hour, say, so I’m not using inefficient delay loops.

So, send file at 9:45, so delay until 10:00. Send file at 10:07, delay until 11:00…

Any help on if this is even possible? All I can think of is using a delay loop and a time check, though I almost may as well check the directory in that case!


May I know why we have this delay
Because if that delay is meant to go for next process to start with then we can keep the process till that sends file alone and SCHEDULE that process to run at certain time interval like every one hour using orchestrator

Cheers @SoqedHozi

Several reasons:

  1. The process needs to remember how many files were sent and the details of them. The sent files are emails so there’s more information, and personal data, than I’d be comfortable storing in a csv.
  2. Files aren’t sent in a batch process. Scheduling that send would add unnecessary delay.
  3. I don’t have an orchestrator licence.

If possible, a “wait until files appear” type solution would work, though there’ would need to be a catch in case of long waits to warn the user by email.

I would consider a do while solution for this, but the files would be archived after processing and this would cause the automation to stop after 1. Any other solution is appreciated

1 Like

yah thats possible
–keep the whole sequence inside the TRY block of TRY CATCH activity
–we can use PATH EXISTS Activity where mention the file path as input and the output will be of type Boolean name it as bool_FileExists
–now use a IF condition like this
bool_FileExists = True
–if true it means file is created and it will go to THEN part where we can have the process to be continued if file exists or it will go to ELSE part where we can have use DELAY activity with a time stamp around 01:00:00 (one hour or whatever time we want but must be explicitly mentioned) and next to this delay activity use again PATH EXISTS activity with same file path and with same variable bool_FileExists
–again next to this path exists use a IF condition and with the same condition and same sequence of activities in THEN part and if the condition fails it goes to ELSE part where this time we will keep a THROW activity with a business exception like this New BusinessException(“file is not yet created”)
so that it will go to CATCH block of the TRY CATCH activity where we can send a mail to the user with a note

thats all buddy
hope this would help you
Cheers @SoqedHozi

I’ll be doing this for sets of files up to 10, so I’d use

Directory.GetFiles(filepath).Where(Function(n) path.GetExtension(n)=".json").count=Files.Count