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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Jina AI
Jina AI
博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
美团技术团队
腾讯CDC
博客园 - Franky
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
aimingoo的专栏
aimingoo的专栏
博客园_首页
V
V2EX
Martin Fowler
Martin Fowler
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
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