> Discover all available pages from the documentation index: https://mastra.zisheng.pro/llms.txt # Workflow\.sleepUntil() `.sleepUntil()` 方法暂停执行直至指定日期。 ## 使用示例 ```typescript workflow.sleepUntil(new Date(Date.now() + 5000)) ``` ## 参数 **dateOrCallback** (`Date | ((params: ExecuteFunctionParams) => Promise)`): Date 对象或返回 Date 的回调函数。该回调接收执行上下文,并可根据输入数据动态计算目标时间。 ## 返回值 **workflow** (`Workflow`): 用于方法链式调用的 workflow 实例 ## 扩展示例 ```typescript import { createWorkflow, createStep } from "@mastra/core/workflows"; const step1 = createStep({...}); const step2 = createStep({...}); export const testWorkflow = createWorkflow({...}) .then(step1) .sleepUntil(async ({ inputData }) => { const { delayInMs } = inputData; return new Date(Date.now() + delayInMs); }) .then(step2) .commit(); ```