Sleep
Create an Airplane sleep for a specified duration.
Airplane's Sleep SDK makes it easy to pause a run. See Sleep documentation for a
high-level overview. This works best within the workflow runtime where your task
will not consume resources while sleeping.
Sleep
Sleep
The sleep API takes in a duration as a millisecond formatted
string and returns a promise that resolves when the sleep finishes.
typescriptCopied1await airplane.sleep("7d");
airplane.sleep(duration)
duration
The duration of time to sleep. Can be a ms formatted string or millisecond number.
pythonCopied1airplane.sleep("7d")
airplane.sleep(duration)
duration
The duration to sleep for. Accepts a float of how long to sleep in seconds. Or a string of how long to sleep with a specified unit of time. (e.g. '2' to sleep for 2 seconds, or '1h' to sleep for an hour)
Raises
If the prompt cannot be created properly.
If the duration is invalid.