Human-readable workflow name.
Attach a transport backend to this workflow.
When type is 'voice', the compiled workflow will route graph I/O
through the voice transport adapter at runtime. The config values
override per-field defaults from agent.config.json.
The transport config is stored as _transportConfig on the builder
instance and is available for inspection or forwarding to the runtime.
Transport kind; currently only 'voice' is supported.
Optional config: Omit<VoiceTransportConfig, "type">Optional voice pipeline overrides (STT, TTS, voice, etc.).
this for fluent chaining.
const wf = workflow('voice-flow')
.input(inputSchema)
.returns(outputSchema)
.transport('voice', { stt: 'deepgram', tts: 'openai', voice: 'alloy' })
.step('listen', { tool: 'listen_tool' })
.compile();
Append a single named step to the workflow.
The step is connected from all current tail nodes and becomes the new single-element tail after it is added.
Unique step identifier within this workflow.
Execution and policy configuration for the step.
Alias for step() — reads more naturally when chaining sequential steps.
Unique step identifier.
Execution and policy configuration.
Append a conditional branch to the workflow.
The condition function is evaluated at runtime against GraphState and must
return one of the keys of routes. Each route becomes its own branch node; all
branches become the collective tail that the next declared step connects from.
Routing function; return value must match a key in routes.
Map of route key → step config for each branch arm.
Append a parallel fan-out to the workflow.
All steps execute concurrently (subject to runtime scheduling). After all
branches complete, their outputs are merged using the join.merge reducers.
The parallel branch nodes collectively become the new tail.
Array of step configs to execute concurrently.
Fan-in configuration including merge strategy and reducers.
Optional quorumOptional timeout?: numberCompile the workflow into an executable CompiledWorkflow.
Compilation steps:
.input() and .returns() schemas were declared.InternalStep into GraphNode + GraphEdge IR objects,
threading tailNodeIds to connect steps sequentially.END.GraphCompiler.compile() to produce a CompiledExecutionGraph.GraphValidator.validate() with { requireAcyclic: true } — throws on cycle.CompiledWorkflow with a GraphRuntime backed by the given store.Optional options: { Optional compilation options.
Optional checkpointCustom checkpoint backend; defaults to InMemoryCheckpointStore.
When .input() or .returns() was not called.
When the compiled graph contains a cycle (should never happen via this API).
Fluent builder for deterministic DAG workflows.
Steps are appended in declaration order and connected sequentially. Branch and parallel primitives fan out and automatically rejoin at the next declared step.
Call
.compile()to validate the graph (must be acyclic) and obtain aCompiledWorkflowready forinvoke(),stream(), orresume().