Skip to main content

Overview

NodeRegistry manages all node definitions. It’s generic over node type strings for type-safe lookups.
You can optionally constrain type strings:

Methods

register

Register a single node definition. Throws if the type is already registered.

registerAll

Register multiple nodes at once.

unregister

Remove a registered node type. Returns true if it existed.

has

Check if a type is registered.

getDefinition

Get the full definition including executor.

getMetadata

Get client-safe metadata (no executor). Safe to send to the browser.

getExecutor

Get just the executor function.

getNodeTypes

Get all registered type identifiers.

getAllDefinitions / getAllMetadata

getByCategory / getMetadataByCategory

Filter definitions or metadata by category.

validateInput / validateOutput

Validate data against a node’s Zod schema. Throws ZodError on failure.

size

Example

Factory Function

createRegistry<TNodeType>() creates a new empty NodeRegistry.