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

推荐订阅源

J
Java Code Geeks
G
Google Developers Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
A
About on SuperTechFans
Vercel News
Vercel News
B
Blog
Martin Fowler
Martin Fowler
MyScale Blog
MyScale Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
腾讯CDC
D
Docker
V
Visual Studio Blog
博客园 - 叶小钗
The Cloudflare Blog
Jina AI
Jina AI
B
Blog RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
WordPress大学
WordPress大学
T
Tailwind CSS Blog
MongoDB | Blog
MongoDB | Blog
D
DataBreaches.Net
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏

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
Queue
2026-06-12 · via Workflow SDK Documentation

Low-level queue interface for dispatching workflow and step invocations.

Queue methods live directly on the world object (not nested). They dispatch internal workflow and step invocations to the queue backend.

These methods are used internally by the Workflow SDK to dispatch execution. You do not need to call them in normal operations — use start() to trigger workflows instead. Direct queue access is only needed if you programmatically create a run via world.events.create() with a run_created event and need to kick off its initial execution, or for debugging resumption of a flow or step route.

import { getWorld } from "workflow/runtime";

const world = await getWorld(); 
// Queue methods are called directly on world — e.g. world.queue()

getDeploymentId()

Get the current deployment ID. Used internally for routing queue messages to the correct deployment.

const deploymentId = await world.getDeploymentId(); 

Returns: string — The current deployment ID

queue()

Dispatch a message to a named queue. The message payload is an internal SDK type (WorkflowInvokePayload, StepInvokePayload, or HealthCheckPayload).

const { messageId } = await world.queue(queueName, payload, opts); 

Parameters:

ParameterTypeDescription
queueNameValidQueueNameThe queue name (branded string)
messageQueuePayloadInternal SDK payload
optsQueueOptionsOptional — deploymentId, idempotencyKey, delaySeconds, headers

Returns: { messageId: MessageId | null }

createQueueHandler()

Create an HTTP handler that processes messages from a queue. Used to set up the queue consumer endpoint.

const handler = world.createQueueHandler(prefix, callback); 

Parameters:

ParameterTypeDescription
prefixQueuePrefixQueue name prefix to match
callback(message, meta) => Promise<void | { timeoutSeconds: number }>Handler called for each message. meta contains attempt, queueName, messageId, requestId.

Returns: (req: Request) => Promise<Response>

  • start() — The standard way to start workflow runs
  • Starting Workflows — Core concepts for workflow invocation
  • Storage — Create events that trigger queue dispatch