close

getWorldHandlers

Build-time-safe access to the World's queue handlers without binding to runtime environment variables.

Returns a restricted view of the World exposing only the members that are safe to use at build time: createQueueHandler and specVersion. Framework adapters use it while generating workflow route handlers, before the deployment's runtime environment variables exist.

Unlike getWorld(), this function does not cache a fully configured World instance — caching at build time would lock in incomplete environment configuration.

import { getWorldHandlers } from "workflow/runtime";

const handlers = await getWorldHandlers();
console.log(handlers.specVersion);

API Signature

Parameters

This function does not accept any parameters.

Returns

Returns a WorldHandlers object (synchronously in workflow 4.x; async in 5.x), where:

import type { World } from "@workflow/world";

type WorldHandlers = Pick<World, "createQueueHandler" | "specVersion">;

This is SDK infrastructure used by framework adapters and the workflow entrypoint. Application code should use getWorld() instead.