Skip to content

Chains ​

A Chain is an executable workflow. It either executes admitted instructions directly, or composes ordered and conditional Bits. A Bit is an executable atomic task. Merely storing checklist items does not execute a Chain and cannot produce a successful run.

Runtime invariant ​

Every run is denied unless the current instructions have a valid admission decision whose digest matches the current Chain revision. Missing or stale decisions are revalidated before execution. If classification is unavailable, the Chain remains unexecuted. Historical records are never silently grandfathered.

Core endpoints ​

MethodPathPurpose
GET/chainsList Chains
GET/chains/:idRead one Chain
POST/chainsCreate an instruction-backed executable Chain
PATCH/chains/:idUpdate a Chain and revalidate changed instructions
POST/chains/from-bit-dagCreate a Chain from executable Bits and Agent bindings
PATCH/chains/:id/execution-sourceReplace the executable source atomically
POST/chains/:id/trigger-runRequest an idempotent run
GET/chains/:id/runsList execution runs
GET/chains/:id/runs/:runIdInspect a run
POST/chains/:id/runs/:runId/cancelCancel a run
GET/chains/:id/bit-treeRead the composed Bit graph
GET/chains/:id/artifactsList produced artifacts
GET/chains/:id/provenanceTrace runs, Bits, Agents and artifacts

Create an instruction-backed Chain ​

bash
curl -X POST "$BASE_URL/chains" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Weekly customer update",
    "instructions": "Collect this week’s approved customer changes, produce a concise update, and save it as a workspace artifact.",
    "assistantAgentInstanceId": "00000000-0000-4000-8000-000000000001"
  }'

instructions is required and must describe work the runtime can execute. A human practice, passive reminder, or source-less record is rejected. description is explanatory text and never substitutes for instructions.

Compose Bits ​

Use /chains/from-bit-dag when the workflow has multiple atomic units. Each Bit must have an executable source, such as an active Agent execution profile. The API owns graph validation, admission, grants, revisioning and persistence as one domain operation.

Templates ​

Executable templates expose ordered Bit slots. Installation requires exactly one accessible Agent binding for every slot and creates the matching execution grant. Use GET /chains-templates, GET /chains-templates/:id, and POST /chains-templates/:id/fork.

Admission failures ​

Non-executable requests, stale decisions, unavailable classifiers, missing Bit execution sources, invalid graphs, or insufficient grants fail closed. Responses contain stable error codes; instruction text is not emitted in admission telemetry.

Built with purpose.