Genel bakış
typeCore Runtime

Behavior

Executable Flow workflow unit.

Signature

tsSignature
export type Behavior<I, O, E = unknown, C extends object = {}> = (
input: I,
context: RuntimeContext<C>,
) => Promise<Result<O, E | RuntimeError>>;

Imports

tsImport
import { Behavior } from "@/lib/flow/core/runtime";
import { Behavior } from "@/lib/flow";

Type Parameters

I

Input type.

O

Output type.

E

Expected domain error type.

C

Custom context type.

Details

A behavior receives typed input, reads runtime context, and resolves to a `Result` containing

either typed output, typed domain error, or a runtime error.

input

Creates an identity behavior for starting typed pipelines.

function
Result

Explicit success-or-failure outcome used throughout Flow.

type
RuntimeError

Runtime-level failure union added around every behavior's domain error type.

type

Source

tsflow/core/runtime.ts:55-58
export type Behavior<I, O, E = unknown, C extends object = {}> = (
input: I,
context: RuntimeContext<C>,
) => Promise<Result<O, E | RuntimeError>>;