惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
V
V2EX
Jina AI
Jina AI
爱范儿
爱范儿
M
MIT News - Artificial intelligence
量子位
L
LangChain Blog
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
腾讯CDC
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss

Workflow SDK Documentation

Patterns for Defining Tools Human-in-the-Loop Building Durable AI Agents Queueing User Messages Resumable Streams Sleep, Suspense, and Scheduling Streaming Updates from Tools API Reference Workflow Globals Changelog Resilient run start Cookbook Building a World Deploying Astro Express Fastify Hono Getting Started NestJS Next.js Nitro Nuxt Python SvelteKit Vite corrupted-event-log fetch-in-workflow hook-conflict Errors
resumeWebhook
2026-05-31 · via Workflow SDK Documentation

Resume a paused workflow by sending an HTTP request to a webhook token.

Resumes a workflow run by sending an HTTP Request to a webhook identified by its token.

This function creates a hook_received event and re-triggers the workflow to continue execution. It's designed to be called from API routes or server actions that receive external HTTP requests.

resumeWebhook is a runtime function that must be called from outside a workflow function.

import { resumeWebhook } from "workflow/api";

export async function POST(request: Request) {
  const url = new URL(request.url);
  const token = url.searchParams.get("token");

  if (!token) {
    return new Response("Missing token", { status: 400 });
  }

  try {
    const response = await resumeWebhook(token, request); 
    return response;
  } catch (error) {
    return new Response("Webhook not found", { status: 404 });
  }
}

Parameters

NameTypeDescription
tokenstringThe unique token identifying the hook
requestRequestThe request to send to the hook

Returns

Returns a Promise<Response> that resolves to:

  • Response: The HTTP response from the workflow's respondWith() call

Throws an error if the webhook token is not found or invalid.

In most cases, you should not need to call resumeWebhook() directly. When you use createWebhook(), the framework automatically generates a random webhook token and provides a public URL at /.well-known/workflow/v1/webhook/:token. External systems can send HTTP requests directly to that URL.

For server-side hook resumption with deterministic tokens, use resumeHook() with createHook() instead.

Forward an incoming HTTP request to a webhook by token:

import { resumeWebhook } from "workflow/api";

export async function POST(request: Request) {
  const url = new URL(request.url);
  const token = url.searchParams.get("token");

  if (!token) {
    return new Response("Token required", { status: 400 });
  }

  try {
    const response = await resumeWebhook(token, request); 
    return response; // Returns the workflow's custom response
  } catch (error) {
    return new Response("Webhook not found", { status: 404 });
  }
}