Greetings!
Sleep is not allowed in the script, as you can see.
I suggest installing one of the official IBM Apps in the exchange, that come in with a "Timer" function you can directly add as an step in your workflow:
https://exchange.xforce.ibmcloud.com/hub?q=timer
For random time, in the function pre-process, you can generate a random time with python, just as you are doing in the script, and pass it to the function with "inputs.nameoftheinput = random.randrange(10)"
Hope this helps!
Cheers,
------------------------------
Pol Estecha Hernández
------------------------------
Original Message:
Sent: Thu June 01, 2023 08:46 AM
From: Łukasz Tyński
Subject: Stop workflow for a random time
Hi, I would like to write a script that stops the workflow for a random time between 0-300 seconds, how can I do it?

I Receive Message :

------------------------------
Łukasz Tyński
------------------------------