Exports Temporal's sleep() function for advanced use cases. Pause workflow execution for a specified duration.
Use this for delay-based throttling when calling external APIs.
Duration to sleep in milliseconds (or a string like '1s', '100ms')
A promise that resolves after the specified duration
import { sleep } from '@output.ai/core';for ( const url of urls ) { await fetchUrl( url ); await sleep( 100 ); // 100ms delay between calls} Copy
import { sleep } from '@output.ai/core';for ( const url of urls ) { await fetchUrl( url ); await sleep( 100 ); // 100ms delay between calls}
https://docs.temporal.io/develop/typescript/timers
Exports Temporal's sleep() function for advanced use cases. Pause workflow execution for a specified duration.
Use this for delay-based throttling when calling external APIs.