> Discover all available pages from the documentation index: https://mastra.zisheng.pro/zh-TW/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(); ```