Steps

context.createWebhook

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

stepNamebodystringrequired

Name of the step.

Response

webhookUrlstring

The unique webhook URL that external services should call to resume the workflow.

Can be called multiple times to resume multiple context.waitForWebhook steps.

eventIdstring

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.

Loading search…