Skip to content

Commit 8f26d12

Browse files
authored
workflows: Clarify timeout default (#26112)
* workflows: Clarify timeout default
1 parent 3e3e2c1 commit 8f26d12

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/content/docs/workflows/build/events-and-parameters.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,21 @@ The above example:
105105
- Uses a TypeScript [type parameter](https://www.typescriptlang.org/docs/handbook/2/generics.html) to type the return value of `step.waitForEvent` as our `IncomingStripeWebhook`.
106106
- Continues on with the rest of the Workflow.
107107

108+
The default timeout for a `waitForEvent` call is 24 hours, which can be changed by passing `{ timeout: WorkflowTimeoutDuration }` as the second argument to your `waitForEvent` call.
109+
110+
<TypeScriptExample>
111+
112+
```ts
113+
let event = await step.waitForEvent(
114+
"wait for human approval",
115+
{ type: "approval-flow", timeout: "15 minutes" },
116+
);
117+
```
118+
119+
</TypeScriptExample>
120+
121+
You can specify a timeout between 1 second and up to 365 days.
122+
108123
### Send events to running workflows
109124

110125
Workflow instances that are waiting on events using the `waitForEvent` API can be sent events using the `instance.sendEvent` API:

0 commit comments

Comments
 (0)