Skip to main content
context.createWebhook() creates a unique webhook that can be called by external services to trigger workflow continuation. The webhook URL generated can be called multiple times to resume multiple context.waitForWebhook steps.

Arguments

stepName
string
required
Name of the step.

Response

webhookUrl
string
The unique webhook URL that external services should call to resume the workflow.Can be called multiple times to resume multiple context.waitForWebhook steps.
eventId
string
The internal event identifier associated with this webhook. This is primarily used internally by context.waitForWebhook.

Usage

import { serve } from "@upstash/workflow/nextjs";

export const { POST } = serve(async (context) => {
  const webhook = await context.createWebhook("create webhook");

  console.log(webhook.webhookUrl); // Use this URL with external services
});
For more complete examples and use cases, see the page on webhooks.