Home > @aws/durable-execution-sdk-js > DurableContext > wait
Pauses execution for the specified duration
Signature:
wait(name: string, duration: Duration): DurablePromise<void>;|
Parameter |
Type |
Description |
|---|---|---|
|
name |
string |
Step name for tracking and debugging |
|
duration |
Duration to wait |
Returns:
DurablePromise<void>
// Wait 5 seconds before retrying
await context.wait("retry-delay", { seconds: 5 });
// Wait for a longer duration
await context.wait("long-delay", { minutes: 5, seconds: 30 });