Skip to content

API Reference

Complete reference for all public APIs.

PageCovers
WorkflowBuildercreateWorkflow, defineAction, addStep, addFork, addJoin, addWait, setInitial, setTerminal, addTransition, build, createInstance, restoreInstance
WorkflowInstance & DispatchResultdispatch, canExecute, getCurrentStates, getStateStatus, isTerminal, getAvailableTransitions, injectGuard, getSnapshot, resolveWait, DispatchResult union
State TypesStepState, ForkState, JoinState, WaitState, StateStatus, StateKind
GuardsGuard.inject, Guard.fn, Guard.and, Guard.or, Guard.not, Guard.stateCompleted, Guard.stateActive, Guard.always, Guard.never, IGuard, GuardContext
VisualizationMermaidExporter, JsonGraphExporter, JsonGraph, JsonGraphNode, JsonGraphEdge

Import paths

ts
// Core
import { createWorkflow, Guard } from 'flowyd';
import type { WorkflowInstance, InstanceSnapshot, DispatchResult } from 'flowyd';
import type { IGuard, GuardContext } from 'flowyd';

// Visualization (separate, tree-shakeable)
import { MermaidExporter, JsonGraphExporter } from 'flowyd/visualization';
import type { JsonGraph } from 'flowyd/visualization';

Released under the MIT License.