Skip to content

Pipelines

Pipelines

Pipelines define canonical collection import and export behavior. Each is one file beside the model, discovered automatically.

import type { Pipelines } from './$types.js';
import { exportPipeline } from './lib/export.js';

export default { export: exportPipeline } satisfies Pipelines;

One contract everywhere

The tenant collection UI, agents, and integrations reuse the same pipeline contract, so a file imported in one place behaves identically everywhere.

Imports reach the same write path

An import posts one document. The authored import handler decodes it with its Effect Schema and returns the insert payloads; the row batch is written together through the same canonical mutation pipeline, so policy, hooks, history, sync, and audit apply exactly as they do to any other write.

Who runs pipelines

A pipeline is not tied to one caller — the same definition serves every surface that touches collection data:

  • Collection UI — the import and export actions on the collection table
  • Agents — bulk ingest the agent performs through its tools
  • Integrations — inbound and outbound delivery that reuses the contract

Choose the narrowest role

Companion roles overlap on purpose — pick the narrowest one that fits:

  • Hooks — mutation invariants and same-transaction effects ( hooks)
  • Pipelines — reusable bulk ingest and artifact contracts
  • Integrations — reliable external delivery that reuses pipelines ( integrations)