flow Generated TypeScript API reference. typescript api api/reference build/apidocs/Variable.flow.md variable flow

flow

TypeScript
const flow: {
<TInput, TOutput>  (options?: AxFlowOptions): AxFlow<TInput, TOutput, {
}, TInput>;
<TInput, TOutput>  (mermaid: string, bindings?: AxFlowMermaidBindings): AxFlow<TInput, TOutput, any, any>;
} = flowFn;

Defined in: https://github.com/ax-llm/ax/blob/3ac75e381dcefb739712993c304c34295567283a/src/ax/flow/flow.ts#L1720

Creates a new AxFlow builder. Passing a string compiles a mermaid flowchart in the AxFlow dialect (see AxFlow.toString) into a runnable flow — node contracts come from %%ax nodeId: <signature> directives or from bindings.nodes, data wiring is by field name (a node input binds to the nearest upstream producer of that field), labeled out-edges of a decision node become branches, and back-edges become feedback/while loops. flow(String(otherFlow)) round-trips.

Call Signature

TypeScript
<TInput, TOutput>(options?: AxFlowOptions): AxFlow<TInput, TOutput, {
}, TInput>;

Type Parameters

Type ParameterDefault type
TInput extends Record<string, any>Record<string, unknown>
TOutputobject

Parameters

ParameterType
options?AxFlowOptions

Returns

AxFlow<TInput, TOutput, { }, TInput>

Call Signature

TypeScript
<TInput, TOutput>(mermaid: string, bindings?: AxFlowMermaidBindings): AxFlow<TInput, TOutput, any, any>;

Type Parameters

Type ParameterDefault type
TInput extends Record<string, any>Record<string, any>
TOutputRecord<string, any>

Parameters

ParameterType
mermaidstring
bindings?AxFlowMermaidBindings

Returns

AxFlow<TInput, TOutput, any, any>

Docs