Skip to content

Pipelines ​

Pipelines combine deterministic TypeScript, agents, and extractors into a typed, inspectable workflow.

Explore pipelines ​

PageLearn how to
Typed inputValidate input before any work begins.
StepsTransform values with synchronous or asynchronous logic.
Agents and extractorsAdd model reasoning and schema-validated extraction.
CompositionReuse pipelines and name inspectable stages.
Parallel and batchRun independent branches or many inputs safely.
Runs and errorsExecute, observe, inspect, and map failures.
Production workersMove long-running workflows out of HTTP requests.

The pipeline flow ​

text
Validate input → run typed stages → return final output

A pipeline is useful when work is more than one prompt: normalize input, load product data, ask an agent, extract fields, run independent checks, and shape the final result.

Use ordinary TypeScript first ​

Keep normalization, authorization, database access, branching, side effects, and final response shaping in .step(...). Use .prompt(...) only for model reasoning and .extract(...) only when existing content must become structured data.

If one function already expresses the workflow clearly, it does not need a pipeline. Reach for a pipeline when typed composition, reusable stages, bounded batch work, or graph inspection adds practical value.

Built for Anvia.