Skip to main content
context.sleepUntil() pauses workflow execution until a specific timestamp. When a workflow is paused, the current request completes and a new one is automatically scheduled to resume at the target time. This ensures no compute resources are consumed while sleeping.
Always await a sleepUntil step to properly pause execution.

Arguments

stepName
string
A unique identifier for the step.
datetime
Date|number|string
The target time when the workflow should resume. Accepted formats:
  • A number: Unix timestamp in seconds
  • A Date object
  • A string that can be parsed by new Date(string) in JavaScript

Usage