Operations Registry
Operations are reusable workflow primitives. Instead of every workflow re-implementing "post to Discord" or "write rows to Supabase," each primitive is registered once in the operations registry and referenced from any workflow step via step.operationId.
When an operation fails — say, the Strapi token expires — every workflow that uses it lights up red on the same diamond in the Loom sculpture. That's the rope-braiding effect. optimalOS/client/loom-braid.ts draws connection lines across strands to make the shared dependency visible at a glance.
Where operations live
Two scan roots, same convention as workflows:
optimalOS/operations/— shipped with OptimalOS.~/.optimalos/operations/— user-added. Wins on id collision.
Each .ts file may export either:
export const operation: OperationDef— a single primitive.export const operations: OperationDef[]— a group (e.g. allstrapi.*in one file).
Loader: optimalOS/src/loom/operations.ts.
OperationDef shape
From optimalOS/src/loom/types.ts:54-60:
{
id: string, // 'category.name' — e.g. 'strapi.create-draft'
label: string, // 'STRAPI DRAFT' — short, uppercase
description?: string,
category: OperationCategory,
fn: StepFn, // same signature as a workflow step
}The id is validated against ^[a-z0-9]+(\.[a-z0-9-]+)+$ so registry references stay parseable.
Categories
Defined in optimalOS/src/loom/types.ts:44-52:
strapi— Strapi headless CMS reads/writes.supabase— Supabase row reads/writes.llm— language-model calls (OpenRouter, Anthropic, etc.).notify— outbound notifications (Discord, etc.).scrape— HTTP scrapes.storage— object storage uploads.dw— data warehouse (Snowflake) operations.other— escape hatch.
Seed operations
The shipped operations as of 2026-04-27 (verify against the source files; this list reflects what's in optimalOS/operations/):
| Operation id | Label | Category | File |
|---|---|---|---|
strapi.fetch-drafts | STRAPI FETCH | strapi | optimalOS/operations/strapi.ts |
strapi.create-draft | STRAPI DRAFT | strapi | optimalOS/operations/strapi.ts |
strapi.publish-draft | STRAPI PUBLISH | strapi | optimalOS/operations/strapi.ts |
supabase.read-rows | SUPABASE READ | supabase | optimalOS/operations/supabase.ts |
supabase.write-rows | SUPABASE WRITE | supabase | optimalOS/operations/supabase.ts |
llm.generate-text | LLM GEN | llm | optimalOS/operations/llm.ts |
notify.discord-webhook | DISCORD | notify | optimalOS/operations/notify.ts |
scrape.http-fetch | SCRAPE | scrape | optimalOS/operations/scrape.ts |
storage.upload-file | STORAGE | storage | optimalOS/operations/storage.ts |
dw.snowflake-merge | SNOWFLAKE | dw | optimalOS/operations/dw.ts |
Cross-validation
When the workflow loader processes a workflow, every step.operationId is cross-validated against the operations registry. Unknown ids surface as validationErrors on the workflow rather than crashing at runtime.
Visual braiding
optimalOS/client/loom-braid.ts overlays curves between same-operation step diamonds in different strands. The visual signal is intentional: when a SQL operation breaks, you see every workflow that depends on it pulse red simultaneously.
API
GET /api/loom/operationsReturns each loaded operation with a usedBy: string[] field listing the workflows that reference it. Code: optimalOS/src/routes/loom.ts:9.