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

推荐订阅源

WordPress大学
WordPress大学
MyScale Blog
MyScale Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
人人都是产品经理
人人都是产品经理
C
Check Point Blog
宝玉的分享
宝玉的分享
B
Blog RSS Feed
博客园 - 三生石上(FineUI控件)
量子位
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
J
Java Code Geeks
The Cloudflare Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
腾讯CDC
P
Proofpoint News Feed
美团技术团队
H
Help Net Security
B
Blog
博客园_首页

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

Create a new World instance from environment configuration.

Creates a new World instance based on environment configuration. The WORKFLOW_TARGET_WORLD environment variable determines which World implementation is instantiated (for example the local development World or the Vercel production World).

Unlike getWorld(), which caches a singleton instance, createWorld() constructs a fresh instance on every call. Application code should almost always use getWorld()createWorld() is for infrastructure code that manages World lifecycles itself.

import { createWorld } from "workflow/runtime";

const world = await createWorld(); 

Parameters

This function does not accept any parameters. Configuration is read from environment variables.

Returns

Returns a newly constructed World instance.

In workflow 4.x, createWorld() is synchronous and returns World directly. It becomes async in 5.x, so writing await createWorld() works on both versions.

Tooling that needs to construct a World with explicit (non-environment) configuration should instantiate the specific World implementation directly and register it with setWorld().

  • getWorld() - Resolve the cached World instance (preferred in application code).
  • setWorld() - Override the cached World instance.