await step.delay('delay', async () => {
    return {
        unit: 'day',
        amount: 1,
    };
});
const { duration } = await step.delay('delay-1-week', resolver);

The delay step allows you to pause the execution of a workflow for a specified amount of time. This is useful when you need to wait for a certain amount of time before executing the next step in the workflow.

await step.delay('delay', async () => {
    return {
        unit: 'day',
        amount: 1,
    };
});
const { duration } = await step.delay('delay-1-week', resolver);

Step Outputs

amount
number
required

This combined with the unit field determines the amount of time to digest events for.

unit
Enum: 'seconds', 'minutes', 'hours', 'days', 'weeks', 'months'
required

The measurement unit for the amount field.

Step Result

duration
number

The duration of the delay in milliseconds.