You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add workflow migration guides and migration skill
Create migration guides for AWS Step Functions, Inngest, and Temporal under
docs/content/docs/getting-started/. Each guide provides side-by-side code
comparisons and a realistic order-processing saga example.
Add skills/migrating-to-vercel-workflow/ with SKILL.md, reference docs for
each source platform (aws-step-functions, inngest, temporal), shared patterns,
resume routing, runtime targets, and 5 eval scenarios.
Update create-webhook API reference with webhook resume choice clarifications.
Update getting-started meta.json to include migration guide navigation entries.
Copy file name to clipboardExpand all lines: docs/content/docs/api-reference/workflow/create-webhook.mdx
+37-18Lines changed: 37 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,9 +51,25 @@ The returned `Webhook` object has:
51
51
52
52
-`url`: The HTTP endpoint URL that external systems can call
53
53
-`token`: The unique token identifying this webhook
54
-
- Implements `AsyncIterable<RequestWithResponse>` for handling multiple requests
54
+
- Implements `AsyncIterable<T>` for handling multiple requests, where `T` is `Request` (default) or `RequestWithResponse` (manual mode)
55
55
56
-
The `RequestWithResponse` type extends the standard `Request` interface with a `respondWith(response: Response)` method for sending custom responses back to the caller.
56
+
When using `createWebhook({ respondWith: 'manual' })`, the resolved request type is `RequestWithResponse`, which extends the standard `Request` interface with a `respondWith(response: Response): Promise<void>` method for sending custom responses back to the caller.
57
+
58
+
<Callouttype="info">
59
+
Use the simplest option that satisfies the prompt:
60
+
61
+
-`createWebhook()` — generated callback URL, and the default `202 Accepted` response is fine
62
+
-`createWebhook({ respondWith: 'manual' })` — generated callback URL, but you must send a custom body, status, or headers
63
+
-`createHook()` + `resumeHook()` — the app resumes from server-side code with a deterministic business token instead of a generated callback URL
64
+
</Callout>
65
+
66
+
<details>
67
+
<summary>Common wrong turns</summary>
68
+
69
+
- Do not use `respondWith: 'manual'` just because the flow has a callback URL.
70
+
- Do not use `RequestWithResponse` unless you chose manual mode.
71
+
- Do not invent a custom callback route when `webhook.url` is the intended callback surface.
72
+
</details>
57
73
58
74
## Examples
59
75
@@ -80,27 +96,29 @@ export async function basicWebhookWorkflow() {
80
96
}
81
97
```
82
98
83
-
### Responding to Webhook Requests
99
+
### Responding to Webhook Requests (Manual Mode)
100
+
101
+
Use this section only when the caller requires a non-default HTTP response. If `202 Accepted` is acceptable, use `createWebhook()` without `respondWith: "manual"`.
84
102
85
-
Use the `respondWith()` method to send custom HTTP responses. Note that `respondWith()` must be called from within a step function:
103
+
Pass `{ respondWith: "manual" }`to get a `RequestWithResponse` object with a `respondWith()` method. Note that `respondWith()` must be called from within a step function:
-[`resumeWebhook()`](/docs/api-reference/workflow-api/resume-webhook) — Low-level runtime API. Most integrations should call `webhook.url` directly instead of adding a custom callback route.
0 commit comments