Hi Clément
I recently wrote a Timer function that is part of the fn_utilities package in the Resilient Community Apps .
The function is currently going through QA and should be available within in the next week or 2??
Here is current documentation on the function:
This function implements a timer (sleep) function that when called from a workflow will cause the workflow to pause for the specified amount of time. The function takes one of two parameters as input: utilities_time or utilities_epoch.
The utilities_time parameter is a string that specifies the total amount of time to pause. The input string is of format "time value" concatenated with a "time unit" character, where character is:
· 's' for seconds
· 'm' for minutes
· 'h' for hours
· 'd' for days
For example: '30s' = 30 seconds; '20m' = 20 minutes; '5h' = 5 hours; '6d' = 6 days
The utilities_epoch parameter is the epoch time that the timer function should stop sleeping. An epoch time value is returned from the date time picker UI widget.
The timer function will break down the total amount of time to pause into smaller sleep time intervals and check in between sleep time whether the workflow has been terminated while the function is running. If the workflow has been terminated, the function will end execution.
Also included are 2 example workflows and 2 examples rule to show how to call the timer using the 2 input parameters.
------------------------------
AnnMarie Norcross
------------------------------
Original Message:
Sent: Mon April 08, 2019 02:33 AM
From: Clément Fouque
Subject: How to make a time delay in workflows
Good morning,
Does someone know how to implement a time delay in workflows/scripts ?
Time python library can't be imported and from what I know, workflow timers minimum delay is 15 minutes.
For information, I need to make a REST api call, wait few minutes and get the results with another API call.
Thank you.
------------------------------
Clément Fouque
------------------------------