Pipelines
What this is for
A pipeline is a multi-step workflow run by the pipeline runner. It can be triggered manually, on a schedule (via a timer), by a webhook, or by an event (via a trigger). This page controls pipeline metadata, trigger type, and the JSON stages the runner executes.
Why it exists
You need repeatable workflows such as "validate schema, notify Slack, transition stage" without hardcoding them in every custom function.
Why it exists (5-whys):
- "Validate → notify → transition" sequences get re-coded per app if there's no declared flow — same logic, N handlers.
stagesis a real column (reconciled in migration020— dev lineage had it,001dropped it) interpreted bypipeline-runner.ts, so every app's workflow shares one executor instead of bespoke code.UNIQUE(app_id, slug)+type_idmake pipelines domain vocabulary — apps declare flows (triage, escalation) scoped to their app, typed like everything else.pipeline_executionsrecords status, input/output data, and errors per run — async workflows are unauditable without a durable run log.- Root: automation is domain behavior, so it must be declarable like the rest of the domain —
pipelinesturns multi-step business logic into seeded data the platform executes and audits. (confirmed 2026-11-13)
Fields and settings
- Name — string. Display name; missing name prevents saving.
- Trigger Type — select:
manual(run by button),scheduled(invoked by a timer),webhook(HTTP call),event(Spine trigger event). Determines what causes a run. - Active — checkbox. Inactive pipelines never run, regardless of trigger.
- App ID — select, optional. Owning app; blank = account-scoped.
- Description — string, optional.
- Config (JSON) — free-form runtime configuration passed to the runner.
- Stages (JSON) — required array of step definitions executed in order by the runner. Each stage is
{ "stage_type": "<action slug>", "config": {...}, "continue_on_error": false }—stage_typeis looked up inpublic.actions(is_active) at run time; an unknown slug fails the run with "Action not found for stage type". - Metadata (JSON) — optional metadata.
Downstream effects
- The runner executes
stagesin array order; the JSON is the source of truth — there is no visual step editor. Stage config can embed{{trigger.*}}and{{record.*}}placeholders, resolved recursively at run time (record= the entity row that fired the event). - A failed stage aborts the run unless the stage sets
continue_on_error: true. - Triggers and timers reference pipelines by ID. Changing
trigger_typedoes not rewire existing triggers/timers — relink them separately. scheduledwithout a linked timer, oreventwithout a matching trigger, means the pipeline never fires.
Minimal configuration
{
"name": "Notify on create",
"trigger_type": "event",
"is_active": true,
"stages": [
{
"stage_type": "send_notification",
"config": {
"recipients": ["role:admin"],
"message": "Record {{record.id}} created"
}
}
]
}Full configuration
Multi-stage pipelines compose the seeded built-in action slugs — update_item, create_record, http_request, send_notification, run_pipeline, search_knowledge, query_items, agent_inference, generate_embeddings, revoke_embeddings, create_interaction — with config carrying shared settings (batch sizes, model names, endpoints) and metadata carrying ownership/version notes. Each stage's own config is merged over the action row's defaults.
Example
A support app ships an auto_embed_on_publish pipeline (trigger_type: "event"): stage 1 fetches the published record via admin-data, stage 2 calls an AI agent to generate the embedding, stage 3 writes it back. Two apps can each own a same-named pipeline — the App column disambiguates them in the list.
Core files
.framework/functions/pipelines.ts— API.framework/functions/pipeline-runner-background.ts— background executor.framework/functions/pipeline-executions.ts— run history (observability/executions).framework/src/pages/admin/PipelinesPage.tsx/PipelineDetailPage.tsx— admin UI- Tables:
public.pipelines,public.pipeline_executions
Agent notes
- "Runs today" and "last run" come from
pipeline_executions— a pipeline with no executions showsNever. - Stages must be a JSON array; a pasted object or string is the most common save-time mistake.
- The runner also implements
send_email,kb_ingest, andkb_revokehandlers, but noactionsrows are seeded for them — a stage using those slugs throws "Action not found" until you insert a matchingpublic.actionsrow yourself. - Activating/pausing is
is_active— a paused pipeline keeps its triggers but they no-op.