Skip to main content
The Flow Registry allows you to register flows by string ID for reuse across your application. This is useful for:
  • Centralizing flow definitions
  • Referencing flows from serialized configurations
  • Building flow libraries

Basic Usage

Register a Flow

Retrieve and Run

Registry API

registerFlow

Register a flow builder function:
If a flow with the same ID already exists, it will be overwritten with a warning.

getFlow

Retrieve a flow builder by ID:
Returns undefined if the flow is not registered.

hasFlow

Check if a flow exists:

unregisterFlow

Remove a flow from the registry:
Returns true if the flow was removed, false if it didn’t exist.

listFlows

Get all registered flow IDs:

getFlowCount

Get the number of registered flows:

clearRegistry

Remove all registered flows:

Provider Registry

Flow builders receive an optional ProviderRegistry for dependency injection:
This allows flows to be configured with different providers at runtime:

Global Registry

The SDK provides a global registry instance:
The helper functions (registerFlow, getFlow, etc.) operate on this global registry.

Use Cases

Flow Library

Create a library of reusable flows:

Configuration-Driven Flows

Reference flows from configuration:

Testing

Use the registry to swap providers for testing:

Multi-Tenant Configuration

Different flows per tenant:

Best Practices

Use Descriptive IDs

Version Your Flows

Handle Missing Flows

Initialize Registry on Startup

Next Steps

Creating Flows

Build custom flows

Pre-built Flows

Ready-to-use flow templates