Skip to Content
ReferenceWorkflows.sleepUntil()

Workflow.sleepUntil()

The .sleepUntil() method pauses execution until a specified date.

Usage example

workflow.sleepUntil(new Date(Date.now() + 5000));

Parameters

dateOrCallback:

Date | ((params: ExecuteFunctionParams) => Promise<Date>)
Either a Date object or a callback function that returns a Date. The callback receives execution context and can compute the target time dynamically based on input data.

Returns

workflow:

Workflow
The workflow instance for method chaining

Extended usage example

workflow.sleepUntil(async ({ inputData }) => { return new Date(Date.now() + inputData.value); });