---
title: createWorld
description: Create a new World instance from environment configuration.
docs_index: /llms.txt
lastUpdated: 2026-10-21
type: reference
summary: Use createWorld to construct a fresh instance of the build-injected World, bypassing the cached instance.
prerequisites:
  - /docs/api-reference/workflow-runtime/get-world
related:
  - /docs/api-reference/workflow-runtime/set-world
---

> For an index of all documentation, see [/llms.txt](/llms.txt).

Creates a new [World](/docs/api-reference/workflow-runtime/world) instance by invoking the World factory that was statically injected into the bundle at build time. The `WORKFLOW_TARGET_WORLD` environment variable selects the implementation, such as the local development World or the Vercel production World, when the app is built. Changing the variable at runtime has no effect.

Unlike [`getWorld()`](/docs/api-reference/workflow-runtime/get-world), 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.

```typescript lineNumbers
import { createWorld } from "workflow/runtime";

const world = await createWorld(); // [!code highlight]
```

## API signature

### Parameters

This function does not accept any parameters. Configuration comes from the World that was injected at build time (World implementations typically read their own settings from environment variables when constructed).

### Returns

Returns a `Promise<World>` with a newly constructed World instance.

> Tooling that needs to construct a World with explicit (non-environment) configuration should instantiate the specific World implementation directly and register it with [`setWorld()`](/docs/api-reference/workflow-runtime/set-world).

## Related functions

- [`getWorld()`](/docs/api-reference/workflow-runtime/get-world): Resolve the cached World instance (preferred in application code).
- [`setWorld()`](/docs/api-reference/workflow-runtime/set-world): Override the cached World instance.

---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/agents.md](/agents.md)