Suspends workflow execution for a durable, crash-safe duration. Unlike
setTimeout, this sleep survives process restarts — the engine persists
the wake-up time and resumes the workflow when the timer expires.
On replay, sleepFor returns immediately with the stored duration
(no actual waiting occurs). This makes it safe for deterministic
re-execution.
Duration Formats
Accepts any human-readable duration string parsed by the ms module:
'5 seconds', '30s', '2 minutes', '1m', '1 hour', '2h',
'1 day', '7d'.
Suspends workflow execution for a durable, crash-safe duration. Unlike
setTimeout, this sleep survives process restarts — the engine persists the wake-up time and resumes the workflow when the timer expires.On replay,
sleepForreturns immediately with the stored duration (no actual waiting occurs). This makes it safe for deterministic re-execution.Duration Formats
Accepts any human-readable duration string parsed by the
msmodule:'5 seconds','30s','2 minutes','1m','1 hour','2h','1 day','7d'.Examples