Overview
resumeHook() and resumeWebhook() allow you to resume paused workflows by sending data from external contexts like API routes or server actions. These functions deliver payloads to hooks created with createHook() or createWebhook().
resumeHook
Resume a workflow by sending data to a hook identified by its token.Signature
Parameters
string | Hook
required
The unique token identifying the hook, or the hook object itself
T
required
The data payload to send to the hook. Must be serializable.
CryptoKey
Optional encryption key override for the payload
Returns
Promise<Hook>
Promise resolving to the hook object containing
runId, token, and metadataExample
resumeWebhook
Resume a workflow via a webhook by sending an HTTP request. This function processes the incoming request and sends the response.Signature
Parameters
string
required
The unique token identifying the webhook
Request
required
The incoming HTTP request object
Returns
Promise<Response>
Promise resolving to the HTTP response from the workflow’s
respondWith() callExample
Common Use Cases
Manual Approval Flow
Webhook Integration
Related
- createHook() - Create hooks in workflows
- createWebhook() - Create webhooks in workflows
- defineHook() - Type-safe hook definitions
- Hooks Guide - Understanding hooks and webhooks